Monday, April 04, 2022

mini Lisp in TypeScript

nukata/lisp-in-typescript: A Common Lisp-like Lisp-1 in TypeScript with TCO and partially hygienic macros @GitHub

This is a Lisp interpreter compatible with lisp-in-dartlisp-in-cs and lisp-in-go.


another one:

Indy9000/lisper: Lisp Parser Interpreter written in TypeScript @GitHub

test('factorial(5)', () => {
  const t = ParseList(`
    (defn main ()
      (defn factorial (n)
        (if (== n 0)
          1
          (* n (factorial (- n 1)))
        )
      )
      (factorial 5)
    )
  `)
  const actual = Run(t)
  expect(actual.value).toBe(120)
})

TypeScript: Live Coding a Lisp Interpreter from scratch (Part 1) - YouTube




No comments: