Skip to main content

The Xanathar programming Language

Project description

Xanathar

Name inspired by Xanathar's Guide to Everything (© Wizards of the Coast)

Pipeline

Made in draw.io

Xanathar Pipeline

Features

  • Compiles directly to a binary (through LLVM IR)
  • Fast (uses Lark and LLVMLite) for speed
  • Strong typing (enforced by LLVM IR)
  • Easy to learn syntax
  • Written in Python, so no installation required

Spec

Implemented operations

Keep in mind, Xanathar is a huge WIP
  • Variables (statically allocated)
    • Int / UInt
      • 1 Bit (Bool)
      • 8 Bit (Char)
      • 16 Bit
      • 32 Bit
      • 64 Bit
      • 128 Bit
      • 512 Bit
      • 1024 Bit
    • Floats
    • Strings (implemented as a statically allocated int8[])
  • Printing
    • libc printf can be used
    • print_s, print_i, print_x, print_c print with the printf format string (%s for print_s, etc.)
      • Implemented as a libc call to printf with the corresponding format string
      • Deprecated in favour of printf
  • Casting
    • Works!
    • string >> int gives pointer to the int'th character in string
      • useful for (e.g.) printf
  • Loops
    • While and For
      • While loops: more like a C-style do-while
      • For loops: similar to a do-while style loop
  • Modules
    • stdio
      • i8* get[i8*, i32]
        • Implements fgets in C (source can be viewed in stdlib/stdio.c)

It's the best of both worlds: it keeps the amazing speed of low-level languages, but with the power and ease of high-level languages. On a test of the Collatz conjecture, run for i = 1 to 10, and 77,031, (100 runs of the entire program) Python 3 ran in 1.9s, whereas Xanathar ran in 0.064s. For 1000 runs of the program, Python 3 took 20.7s whereas Xanathar took 0.531s.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xanathar-0.0.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xanathar-0.0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file xanathar-0.0.1.tar.gz.

File metadata

  • Download URL: xanathar-0.0.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for xanathar-0.0.1.tar.gz
Algorithm Hash digest
SHA256 62b0853edf159b4420ad22184d7f93e136fca3a950bb426d1c011b1acfdbdcb7
MD5 1a14597015b3c7eff72b4096064e7518
BLAKE2b-256 7201492475fde7378038d2f3319f6c21a69386c86e2499f73d16213912152983

See more details on using hashes here.

File details

Details for the file xanathar-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xanathar-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for xanathar-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64ea9cacabc13e6cb9fd77048819093d8f47afd1081fd0867b3980f4002d99b3
MD5 efba1cbfa710a118fb85818aaa718939
BLAKE2b-256 e6e9e7d26dc928a086e1a8efdbcffd6d84d26c081f4f9fbf5e1aa1c4e5de1734

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page