Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.04 KB

README.md

File metadata and controls

61 lines (45 loc) · 1.04 KB

Current progress

I like zig and hence the bytecode VM will be in zig. Friendship ended with make, now build.zig is my best friend.

  • Functional interpreter with support for:
  1. function calls
  2. operator precedence
  3. closures
  4. higher order functions
  5. primitive data structures with builtin functionality:
    • string
    • boolean
    • integers
    • hashmaps
    • arrays

Demonstration

output_file.mp4

Usage

  • If you are not using an x86 64 machine, change the TARGET value in the makefile accordingly

Compile

  make compile

Execute

  ./bin/mc # for repl
  ./bin/mc <path-to-file> # for executing a file

Sample program

Fibonnaci numbers

let fib = fn(x){
  if(x == 0){
      return 1;
  }
  if(x == 1){
      return 1;
  }
  return fib(x-1)+fib(x-2);
};
fib(15);

TODO

  • adding support for strings and arrays
  • adding support for hashmaps/hashtables
  • build a bytecode compiler