Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d3lio/degu-lang
A take at a scripting language with an ML (Meta Language) family syntax. Heavily inspired by F#, OCaml and at some extent - Rust.
https://github.com/d3lio/degu-lang
llvm programming-language rust
Last synced: 3 months ago
JSON representation
A take at a scripting language with an ML (Meta Language) family syntax. Heavily inspired by F#, OCaml and at some extent - Rust.
- Host: GitHub
- URL: https://github.com/d3lio/degu-lang
- Owner: d3lio
- License: apache-2.0
- Created: 2019-03-25T21:21:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-03-31T17:52:02.000Z (over 5 years ago)
- Last Synced: 2024-06-18T11:34:41.256Z (5 months ago)
- Topics: llvm, programming-language, rust
- Language: Rust
- Homepage:
- Size: 52.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# degu-lang
A take at a scripting language with an ML (Meta Language) family syntax. Heavily inspired by F#, OCaml and at some extent - Rust.
### Setting up the project
You need to have a local LLVM sdk. [The llvm cmake guide](https://llvm.org/docs/CMake.html) will help you as well as [the llvm-sys crate](https://crates.io/crates/llvm-sys) since that is what the project depends on.
What I've found useful is to pass a parallel build flag to `cmake --build`. For Windows' MSVC this is `/maxcpucount:` and would look something like `cmake --build . --config MinSizeRel -- /maxcpucount:4`.
The current required version of LLVM is 6 which will change when I get to recompile LLVM again.
Other than just run `cargo run -p compiler`.
### Example output
main.dg
```f#
let max3 a b c = if a > b then a else if b > c then b else clet ifs a b c value =
value + max3 a b clet number_ops a b c =
print_number a
print_number b
print_number c
ifs a b c ((a + 1) * (a + 1) + 2 + (4 + 5 * 2 - 10)) - 4let main _ = print_number (number_ops 1 2 3)
```
stdout
```
1
2
3
9
```