Skip to content

A take at a scripting language with an ML (Meta Language) family syntax. Heavily inspired by F#, OCaml and at some extent - Rust.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

d3lio/degu-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 will help you as well as the llvm-sys crate 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:<n> 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

let max3 a b c = if a > b then a else if b > c then b else c

let ifs a b c value =
    value + max3 a b c

let 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)) - 4

let main _ = print_number (number_ops 1 2 3)

stdout

1
2
3
9

About

A take at a scripting language with an ML (Meta Language) family syntax. Heavily inspired by F#, OCaml and at some extent - Rust.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages