News for hackers. Stuff that matters.
Re:Lisp: It's Not About Macros, It's About Read by akkartik on Saturday February 18, 2012 @05:28PM (#3607919)
> You can implement a macro system in 30 lines of Lisp. All you need is read, and it’s easy.

The linked pastebin isn't a macro system. It's merely a macroexpansion system, it needs to be evaluated. And it's not as simple as merely wrapping it in 'eval' because of subtleties in getting at the right lexical scope.

More generally, no fair claiming macros are easy because you managed to build them atop a lisp. You're using all the things other comments here refer to; claiming it's all 'read' is disingenuous.

I'm still[1] looking for a straightforward non-lisp implementation of real macros. The clearest I've been able to come up with is an fexpr-based interpreter: http://github.com/akkartik/wart

[1] From nearly 2 years ago: http://news.ycombinator.com/item?id=1468345

Re:Lisp: It's Not About Macros, It's About Read by wes-exp on Saturday February 18, 2012 @05:52PM (#3607965)
The currently front-paged Julia claims to have macros in a non-lisp. https://news.ycombinator.com/item?id=3606380
Re:Lisp: It's Not About Macros, It's About Read by calibraxis on Saturday February 18, 2012 @06:08PM (#3607994)
And there's Dave Moon's PLOT (Programming Language for Old Timers). http://news.ycombinator.com/item?id=537652

With the interesting critique that "objects" are better than s-expressions for representing sourcecode. (BTW, Moon did a lot of work on Lisp.)

I've too thought that s-expressions don't necessarily contain as much information as you'd want. Using Rich Hickey's word from "Simple Made Easy", maybe they're used to "complect" visual presentation and internal representation.

Then again, there's metadata...

Re:Lisp: It's Not About Macros, It's About Read by akkartik on Saturday February 18, 2012 @08:13PM (#3608278)
Thanks for those links (wes-exp as well). But I meant a non-lisp implementation of lisp macros. Obviously common lisp and racket qualify, but I'd love to see an implementation that's as simple as possible without needing to be production-quality.
Re:Lisp: It's Not About Macros, It's About Read by akkartik on Saturday February 18, 2012 @09:33PM (#3608456)
Also, is PLOT actually available? I think I must have come across it 3 times and searched for a download link without luck.
Re:Lisp: It's Not About Macros, It's About Read by calibraxis on Sunday February 19, 2012 @07:13AM (#3609189)
Last I heard, it's not — Moon didn't think his work was high enough quality to release, and invited others to do so.
Re:Lisp: It's Not About Macros, It's About Read by noblethrasher on Saturday February 18, 2012 @06:35PM (#3608064)