Skip to content

spatters/oc_scheme

Repository files navigation

Scheme interpreter written in OCaml.

Interpreter for a subset of R5RS scheme. Written purely to practice using OCaml.

Lexer and parser are generated using ocamllex and menhir, uses jbuilder to build.

To build:

jbuilder build repl.exe

To run:

# Run on a test scheme file
_build/default/repl.exe test.scm
# Run repl
_build/default/repl.exe 

Currently implemented:

  • Ints (as OCaml ints so fixed precision)
  • Bools
  • If expressions
  • Pairs
  • Variable definition and assignment
  • Function definition and lambdas
  • Quotation
  • Tail recursion (for free, thanks OCaml!)

Still to do:

  • Proper tests
  • Derived syntax such as let / cond
  • More data types - floats, chars, strings, bignums
  • Macros
  • Continuations

About

Scheme interpreter written in OCaml.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •