4 ms·
I wonder: What's a minimal language in this vein with lisp-style macros?
by akkartik 16y ago
I wonder: What's a minimal language in this vein with lisp-style macros?
- mahmud 16y agoA lisp with T, NIL, if, and lambda, like "tiny-lisp" here: http://tfeb.org/lisp/hax.html#CONDUITS http://tfeb.org/lisp/hax.html#CONDUITS Literally, a package hack with zero implementation :-) Import defmacro and friends and you have it.
- fadmmatt 16y agoThat'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)
- akkartik 16y ago"Lisp macros need knowledge of the structure of the s-expression." I recently rediscovered this for myself: http://arclanguage.org/item?id=11880 http://arclanguage.org/item?id=11880
- fogus 16y agoMcCarthy'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 http://github.com/fogus/lithp
- stcredzero 16y agoA challenge: get something comparable to macros out of Forth.
- celoyd 16y agoI could be wrong – it’s been a while now – but isn’t that what forth’s “immediate” is?
- silentbicycle 16y agoYeah, immediate words are executed during compilation.