Xanathar
Name inspired by Xanathar's Guide to Everything (© Wizards of the Coast)
Pipeline
Made in draw.io
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[])
- Int / UInt
- Printing
- libc
printfcan be used print_s,print_i,print_x,print_cprint with theprintfformat string (%sforprint_s, etc.)- Implemented as a libc call to
printfwith the corresponding format string - Deprecated in favour of
printf
- Implemented as a libc call to
- libc
- Casting
- Works!
string >> intgives pointer to theint'th character instring- useful for (e.g.)
printf
- useful for (e.g.)
- Loops
- While and For
- While loops: more like a C-style do-while
- For loops: similar to a do-while style loop
- While and For
- Modules
- stdio
i8* get[i8*, i32]- Implements
fgetsin C (source can be viewed instdlib/stdio.c)
- Implements
- stdio
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.
Release files for xanathar 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xanathar-1.0.1.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xanathar-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.4 kB
Release files / xanathar-1.0.1.tar.gz
| Download URL | xanathar-1.0.1.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb028719292a0864a64aeef182ae65625c5e13c70fca771f60e5905b2cf5bffb
|
|
BLAKE2b-256 checksum How to use checksums |
2d21334161a2910f7717d5b72cb40575b261c4e4ecf2a37b04bf6d59a15b80cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / xanathar-1.0.1-py3-none-any.whl
| Download URL | xanathar-1.0.1-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd7ecf2876549b76dc61bef4693b5d97c305b4fdfba38c3ad5a9909197349096
|
|
BLAKE2b-256 checksum How to use checksums |
8ac3a7e3cb447c830fc37e08b29bf23f8927b8c337a04797176d7e488400a660
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|