An experimental stack-based language with 'macros'
debris 5502e1bc87 Updated tff for IF# macro and debug LOG#REAR | 1 year ago | |
---|---|---|
LICENSE | 1 year ago | |
README.md | 1 year ago | |
felth.png | 1 year ago | |
felth.svg | 1 year ago | |
monolithic.lua | 1 year ago | |
repl.lua | 1 year ago | |
tff.lua | 1 year ago |
Felth is an attempt at making a language that's as powerful as a Lisp while operating on a tape (ie, Lisp for Turing Machines).
Factorial:
DEFM# -- | 1 - 2 ! |
DEFM# one? | 1 =? 2 ! |
DEFM# one?: | : 1 ! one? |
DEFM# discard1 | discard 1 ! |
DEFM# dup! | dup 1 ! |
DEFM# swap2! | swap2 2 ! |
DEFM# swap3! | swap3 3 ! |
DEFM# fac' | one?: IF# |² discard1 |² dup! swap3! -- * 2 ! swap2! -- fac' |² |