News for hackers. Stuff that matters.
Re:Clojure or: How I Learned to Stop Worrying and Love the P... by scott_s on Tuesday August 31, 2010 @03:37PM (#1650628)
I think "Lisp has no syntax" is an unfortunate meme. Lisp has a syntax. It's a very simple syntax for defining trees, and you're basically using it to write the abstract syntax tree for your program, but it still has a syntax.
Re:Clojure or: How I Learned to Stop Worrying and Love the P... by kgo on Tuesday August 31, 2010 @04:20PM (#1650756)
Yes of course, but in the context of a DSL, you're not really defining a new syntax. You've still got an AST at the end of the day.

And of course, this isn't an attack on lisp. If it works for you, cool. But I just don't see how that distinguishes itself from a ruby DSL like say rspec.

I think the nicest feature of lisp DSLs is that lisp doesn't have the concept of an operator, and most langaguages make if difficult to define a function called or <- or something like that. But you can do that in Haskell or or ML, it's not really exclusive to S-exps.

Re:Clojure or: How I Learned to Stop Worrying and Love the P... by scott_s on Tuesday August 31, 2010 @05:26PM (#1650920)
I'm unfamiliar with rspec, but the major difference between designing and implementing DSLs in Lisps versus other languages is ease of code generation. That is, actually generating new code based on what the user of the DSL supplies. In Lisp, this is done because it's trivial to receive the AST that defines what the user wants to do. Then you can generate code directly based on that AST. No need for reflection or any such trickery because it's all just lists of list.

In most other languages, if that sort of transformation is even possible, it is much less direct.

Re:Clojure or: How I Learned to Stop Worrying and Love the P... by ScottBurson on Tuesday August 31, 2010 @06:38PM (#1651106)
I think it's more accurate to say that Lisp has a metasyntax rather than a syntax. Each special form and macro, including user-written macros, has its own syntax; but all of these syntax are layered on top of the standard metasyntax.
Re:Clojure or: How I Learned to Stop Worrying and Love the P... by gnaritas on Tuesday August 31, 2010 @06:51PM (#1651148)
This is a good point, and it's one of the things I don't like about Lisp. You can't know the semantics of evaluation without memorizing each form or having a doc handy. The code at the call site itself is not enough.
Re:Clojure or: How I Learned to Stop Worrying and Love the P... by scott_s on Tuesday August 31, 2010 @10:17PM (#1651597)
Interestingly, that's similar to the criticism often levied at operator overloading in C++.
Re:Clojure or: How I Learned to Stop Worrying and Love the P... by gnaritas on Tuesday August 31, 2010 @11:42PM (#1651751)
Similar, but different. Operator overloading doesn't affect evaluation. You know immediately what is being evaluation now and what isn't, not so in Lisp, and this matters a great deal.