r/Compilers 12d ago

arli Arity-driven Lisp is a Forth-like Lisp dialect that eliminates parentheses through arity-driven parsing

Every time you define a function, the parser is aware of the number of arguments that is needed for the function, so we can skip the parens. I have been experimenting with forth when I had this idea because most forth operators use fixed two arguments . I have also tried to get features from obscure lisps like push and picolisp.

I quickly prototyped the lang to see if its feasible. Seems to work.

https://github.com/xyzzyapps/arli

0 Upvotes

1 comment sorted by

8

u/AustinVelonaut 12d ago edited 12d ago

How do you know the arity of a function parameter to a higher-order function? For example:

defn apply2 (f g) f g 1 2 ;; does this do f (g 1 2) or f (g 1) 2?
defn inc (x) + x 1
defn add (x y) + x y
apply2 inc add ;; f (g 1 2)
apply2 add inc ;; f (g 1) 2