Skip to content

Interpreter for a functional programming language inspired by Haskell and Lisp

Notifications You must be signed in to change notification settings

leonidas1712/nova

Repository files navigation

Nova Programming Language

tests

See nova_bytecode for my latest attempt to rewrite Nova and make it faster.

Note: The full set of features is supported in the initial Python version I wrote; not all features have been ported to the Rust versions yet.

Nova is a functional programming language inspired by Lisp, Haskell, and Python.

  • Dynamically typed

  • Lazy evaluation

  • Tail call optimization

  • Curried and higher order functions

  • Importing code

To be ported from Python version:

  • String and list processing

  • Operator precedence with >> (pipe), $, function application by spaces and parentheses

Example code:

>>> (def recr (x) (if (eq x 0) 0 (add x (recr (pred x)))))
recr(x) => (if (eq x 0) 0 (add x (recr (pred x))))

>>> (def app (f elem) (f elem))
app(f,elem) => (f elem)

>>> (app recr 3)
6
>>>

Factorial

(def fac (n)
    (if (eq n 0) 1
        (let p (pred n) (mul n (fac p)))
    )
)

>>> (fac 4)
24

About

Interpreter for a functional programming language inspired by Haskell and Lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages