grzegorz-bielski / scala-lisp

A variation of Lisp written in pure FP Scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scala-lisp

An (outstandingly) partial implementation of Lisp/Scheme based on Write You A Scheme 2.0 ported from Haskell to Scala using pure functional programming techniques with cats, cats effect and cats monad transformers.

It includes an interactive REPL, file system access, and its own, although very poor, standard library.

Running the project

CLI options

  • interpret the file at given path:

    sbt "run path <path>"
     sbt "run path ./src/main/resources/demo/add.scm"
     ...
     3
  • start the REPL session:

    sbt "run repl"
    ...
    λ: (+ 1 2)
    3
  • eval passed expression:

    sbt 'run eval "(+ 1 2)"'
    ...
    3

todo

  • variable declaration in REPL (!)
  • Fix IO bugs, make it more robust
  • rewrite to StateT, implement Y combinator

About

A variation of Lisp written in pure FP Scala


Languages

Language:Scala 99.6%Language:Scheme 0.4%