Skip to content

A toy functional programming language, with a tiny VM. Just for fun!

License

Notifications You must be signed in to change notification settings

StepfenShawn/ToyCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bblang[wip]

no loops(For, While...), just use recursion.
Examples:

fn fib(x: i64)
    when x <= 2 then 1 
    otherwise fib(x - 1) + fib(x - 2);

fib(40);

define a macro:

macro hello
    when ($s: str) then "Hello" + $s
    when ($n: ident) then $n
    otherwise "";

print hello!("bblang");
let a: i64 = 1;
print hello!(a);

map as a macro:

let arr = map!([1, 2, 3] x * x);
print arr

Build

  • ghc
  • cabal
cabal run bblang

Test

cabal run test

About

A toy functional programming language, with a tiny VM. Just for fun!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published