#programming-language #statement #give #become #expression #clear #read

bin+lib graviton

Graviton is a fast programming language that is minimal and simplistic with a simple and easy to read compiler. Everything is an expression unless a semicolon is used ; then it becomes a statement which gives a clear distinction between expressions and statements.

8 releases (5 breaking)

0.6.0 Feb 20, 2020
0.5.0 Aug 7, 2019
0.4.1 Aug 3, 2019
0.3.1 Aug 1, 2019
0.1.0 Jul 31, 2019

#470 in Programming languages

MIT license

260KB
6K SLoC

Graviton Programming language

crates.io license build issues repo size code size

Build requirements

  • Rust nightly with cargo

How to build

  1. Run cargo build

What is Graviton?

Graviton is a fast programming language that is minimal and simplistic with a simple and easy to read compiler. Everything is an expression unless a semicolon is used ; then it becomes a statement which gives a clear distinction between expressions and statements.
Graviton is still under heavy development so it is bound to have breaking changes

Examples

Iterative fibonacci example


import "/std";

println("Iterative Fibonacci example");

let fib = (n: I32) {
    let mut prevprevn = 0;
    let mut prevn = 0;
    let mut curn = 1;

    let mut i = 2;

    while i <= n {

        prevprevn = prevn;

        prevn = curn;

        curn = prevprevn + prevn;

        i = i + 1;

    };

    curn
};

print("Enter a number: ");
let n = read_num();

let fib_number: I32 = fib(n);

let output = if fib_number != fib(14) {
        fib_number
    } else {
        println("Input was 14 so result will be negated for demonstration");
        -fib_number
    };

print("Fibonacci of ");
printn(n);
print(" is ");
printnln(fib(n));
println("");

How can follow the progress?

  • There is a Trello board set up for this project

Dependencies

~9–19MB
~259K SLoC