Skip to content

Sheepsody/GenGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

言語

GenGo (言語), is an experimental programming langage I made for the course informatique fondamentale & compilation at Mines ParisTech.

How to use ?

# Compile & run a program
cargo run -- comp \
    --file [filename] \  # Filename with Gengo code
    --ir [filename]      # Optionnal param to save LLVM IR to a file

# JIT
cargo run -- jit

Syntax

/*
Commentaires
*/

# Variables
let a = 3;
let b = 3;
a = b = 1;

# Function (can be recursive)
fn (a, b) {
    let a = 5;
    return 5;
}

# If-Else condition
if cond
then {
    ... ;
    ... ;
} else {
    ... ;
    ... ;
}

# While loop
while cond {
    ... ;
}

# Global variables
global a = 3;
fn test () {
    a = 1;
    return a; # Returns 1
}

5 # Retour implicite sans ;

Running the tests

# Run the tests
cargo test -- --test-threads=1 --nocapture

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages