Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snmslavk/lena-lang
The custom llvm programming language for fun
https://github.com/snmslavk/lena-lang
custom-language lena lena-language llvm programming-language
Last synced: 9 days ago
JSON representation
The custom llvm programming language for fun
- Host: GitHub
- URL: https://github.com/snmslavk/lena-lang
- Owner: snmslavk
- Created: 2023-07-18T11:42:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-20T14:39:56.000Z (over 1 year ago)
- Last Synced: 2023-08-03T14:29:50.505Z (over 1 year ago)
- Topics: custom-language, lena, lena-language, llvm, programming-language
- Language: C++
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Lena Programming Langugage
The language supports converting to IR, using JIT, and all features of LLVM.
## Create the code
code_example.lena
```
extern putchard(char);lenadefines printstar(n)
lenarepeat i = 1, i < n, 1.0 in
putchard(42);lenadefines fib(x)
lenaif x < 3 lenathen
1
lenaelse
fib(x-1)+fib(x-2);printstar(100);
fib(2);
fib(4);
fib(5);
fib(6);
```## Run
```
./lena code_example.lena
```
## Try it
You can take the prebuild binaries from the ReleaseOr you can compile it by youself
## How to install llvm on ubuntu
https://apt.llvm.org/The language compiles with the support of llvm 14
## Compile the lang
```
cd srcclang++ -Xlinker --export-dynamic -g lena.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core orcjit native` -O3 -o lena
```