Skip to content

tree-walking toy interpreter | lexer/parser/evaluator

Notifications You must be signed in to change notification settings

malletgaetan/amVy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amVy interpreter

amVy is a simple language, derived from the Monkey programming language, which was my first source of knowledge while designing amVy. The final objective is to build a language with no heap, that still implement a sort of dynamic memory allocation.

Example

fn fibonacci(n) {
	if (n < 2) {
		return (1);
	}
	return fibonacci(n - 2) + fibonacci(n - 1);
}

let res = fibonacci(10);
print(res);

Usage

First build the interpreter

make

Execute code

./amVy mycode.vY

Print the generated AST

./amVy mycode.vY --ast

Compile amVy with an internal stack trace for debugging purposes

make debug

Main resources

TODO

  • support for arrays
  • add callstack limit
  • make the tracer stack depth aware, like --ast opt
  • own hashmap implementation

About

tree-walking toy interpreter | lexer/parser/evaluator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages