Skip to content

FabioSeixas/rinha-de-compiler

This branch is 18 commits ahead of, 244 commits behind aripiprazole/rinha-de-compiler:main.

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%