redF: a tiny Lisp interpreter
redF is a tiny Lisp interpreter I built with a friend during the Samsung Compiler Bootcamp.
It started as a “Build Your Own Lisp” style project, with a couple of our own tweaks:
- Float support.
- Quoting via
'(...)instead of using{...}for macros.
Repository: https://github.com/ValBaturin/redF
Try it in the browser
Output
Runs fully client-side in a Web Worker (with a timeout) to avoid freezing the page.
Notes:
- The demo runs fully client-side in a Web Worker with a timeout.
- Some parts of the interpreter are known to be buggy (e.g.
joincan hang), so the timeout is intentional.
Run locally
You can run the same Fibonacci example locally without creating a temporary file:
cd /home/boss/codes/site/redF
make
./fc /dev/stdin <<'EOF'
((\ '(self n a b)
'(cond (eq n 0)
a
(self self (- n 1) b (+ a b))))
(\ '(self n a b)
'(cond (eq n 0)
a
(self self (- n 1) b (+ a b))))
10 0 1)
EOF