Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder: What's a minimal language in this vein with lisp-style macros?


That's a good question, actually.

Lisp macros need knowledge of the structure of the s-expression.

Certainly one can Church encode s-expressions and provide defmacro.

Gensym is trickier. Hygiene might be really challenging.

I might actually try that out.

(/article author)


"Lisp macros need knowledge of the structure of the s-expression."

I recently rediscovered this for myself: http://arclanguage.org/item?id=11880


McCarthy's original could give you macros, although they would be extremely cumbersome. I've been wanting to implement some sort of macro system in my minimal Lisp impl. http://github.com/fogus/lithp


A lisp with T, NIL, if, and lambda, like "tiny-lisp" here:

http://tfeb.org/lisp/hax.html#CONDUITS

Literally, a package hack with zero implementation :-)

Import defmacro and friends and you have it.


A challenge: get something comparable to macros out of Forth.


I could be wrong – it’s been a while now – but isn’t that what forth’s “immediate” is?


Yeah, immediate words are executed during compilation.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: