Skip to content

FabioSeixas/rinha-de-compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rinha de Compiler

This is my implementatio of an interpreter for the rinha de compilers competition.

Although the challenge's name includes 'compilers', the organizers made their own compiler, which generates the AST. Since I'm starting from the AST, my solution is an interpreter.

It's my first time with an interpreter and I am new to Rust, so take everything here with a piece of salt.

Build

docker build -t interpreter .

Run

Map a file named source.rinha.json to the container:

docker run --rm -v ./source.rinha.json:/var/rinha/source.rinha.json interpreter

TODO or ideas to improve

  • - Use command line to turn on/off memoization (clap crate)
  • - Memoize only pure functions
  • - Memoize binary operations
  • - Apply Tail Optimization
  • - Test more scenarios
  • - Print closures
  • - Support Tuple

About

having fun with rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.6%
  • Dockerfile 0.4%