Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narukara/kaleidoscope-rust
a toy compiler
https://github.com/narukara/kaleidoscope-rust
compiler just-for-fun llvm
Last synced: 14 days ago
JSON representation
a toy compiler
- Host: GitHub
- URL: https://github.com/narukara/kaleidoscope-rust
- Owner: Narukara
- Created: 2023-01-07T16:53:26.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-31T06:17:16.000Z (almost 2 years ago)
- Last Synced: 2024-11-15T01:11:50.785Z (2 months ago)
- Topics: compiler, just-for-fun, llvm
- Language: Rust
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
[LLVM Tutorial](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html) Implemented in Rust
Compiler for the toy language Kaleidoscopic (modified)
```
# Kaleidoscope (modified) source code example# import from math lib
extern sin(x)# function definition
def fib(n)
if n < 3 then
1
else
fib(n-1) + fib(n-2)# an expression to be evaluated, optional
find fib(10)
```Features:
- JIT: evaluate the value of `find` expression at compile time
- Output LLVM IR (.ll and .bc files), which can be compiled to object files. Further, it can be linked with C language programs and interoperate