Re:7 lines of code, 3 minutes: Implement a programming langu...
by akkartik on Monday June 28, 2010 @12:01PM
(#1468345)
I wonder: What's a minimal language in this vein with lisp-style macros?
[ Parent
| on HN ]
Re:7 lines of code, 3 minutes: Implement a programming langu...
by fadmmatt on Monday June 28, 2010 @12:47PM
(#1468491)
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)
Re:7 lines of code, 3 minutes: Implement a programming langu...
by akkartik on Tuesday June 29, 2010 @10:49AM
(#1471569)
"Lisp macros need knowledge of the structure of the s-expression."
I recently rediscovered this for myself: http://arclanguage.org/item?id=11880
Re:7 lines of code, 3 minutes: Implement a programming langu...
by fogus on Monday June 28, 2010 @01:55PM
(#1468761)
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
Re:7 lines of code, 3 minutes: Implement a programming langu...
by mahmud on Monday June 28, 2010 @12:41PM
(#1468465)
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.
Re:7 lines of code, 3 minutes: Implement a programming langu...
by stcredzero on Monday June 28, 2010 @02:07PM
(#1468813)
A challenge: get something comparable to macros out of Forth.
Re:7 lines of code, 3 minutes: Implement a programming langu...
by celoyd on Monday June 28, 2010 @03:08PM
(#1469036)
I could be wrong – it’s been a while now – but isn’t that what forth’s “immediate” is?
Re:7 lines of code, 3 minutes: Implement a programming langu...
by silentbicycle on Monday June 28, 2010 @03:26PM
(#1469104)
Yeah, immediate words are executed during compilation.