6 ms·
Does the language support macros? If not, it’s totally worthless. Python is a pretty bad language for even casual FP, and a S-exp syntax layer isn’t going to he
by mruts 7y ago
Does the language support macros? If not, it’s totally worthless. Python is a pretty bad language for even casual FP, and a S-exp syntax layer isn’t going to help.
- tmountain 7y ago_ If not, it’s totally worthless._ Kind of a harsh assessment don't you think? Maybe some people enjoy working in Lisp-like languages while also enjoying Python's huge ecosystem of libraries. I doubt it's worthless for those folks.
- mruts 7y agoNo one actually likes the parens of Lisp. I mean, just look at Racket2. Even the dedicated lispers who work on Racket think they suck. I’ve written both Racket and Common Lisp professionally and consider myself very competent in both. In fact, I think they’re both great languages and one of the best around. It’s not because of the parens though, it’s because what the parens give you: namely homoiconicity and easy macros. Without these things, the increased syntax burden of parens don’t buy you anything except visual noise and being forced to type extra characters.
- kazinator 7y agoYour statement doesn't represent everyone. I thought that the design of Lisp was a great idea before I learned about its macros. (This was at a time twenty years ago when macros weren't being hyped in programming forums.) I was impressed that it simplified the specification of the language and the implementation of parsing, as well that it eliminated ambiguity. Then came the realization that formatting the code to look consistently good, no matter which way it is broken into multiple lines is trivial, and that it enables great editor support. Oh, and being able to just quote any chunk of the program as a datum! Also: Symbols tokens made up of almost any sequence of non-whitespace characters: if you type <->, that is a symbol without having to modify the lexical analyzer of the language to recognize a new token pattern. Basic math operations being variadic:(+ term0 term1 term2 ...). Here is an advantage of Lisp syntax: -123 is an actual negative integer token, and not the unary operator applied to 123, requiring evaluation.
- olzd 7y agoI like the parens for the structured editing they allow. Also, you don't need parens to be homoiconic.
- yomly 7y agoS expressions bring a syntactic simplicity that makes code easier to read and more explicit It also makes it easier to edit structurally. So yes homoiconicity and easy macros are nice but please refrain from including me in your use of "no one"
- cutler 7y agoAnd me :) - I love s-expressions.
- sls 7y ago> Without these things, the increased syntax burden of parens don’t buy you anything except visual noise and being forced to type extra characters So instead of f(x), I have to accept the visual noise and extra characters of (f x)?
- kazinator 7y agoWhat's worse, instead of f(x, y); you have to accept the visual noise and extra characters of (f x y).
- mruts 7y agoI don’t really understand these kind of arguments. Seasoned lispers use ‘ or #’ or a backtick or ,@ all the time. Or look at the CL loop macro. If I had to wrap every function in CL with (function ...) I would shoot myself. Same thing with quotes. Or, what about strings, or vectors? Strings have a special syntax, and no one complains about writing “foo”. You know why? Because it’s nice. This magical syntaxless world everyone wants to live in actually sucks big-time, even for Lispers. If anyone really cared about parens, they wouldn’t be using (or creating) these kinds of things in the first place. I think it’s a pretty indefensible position to say that Lispers actually just like parens for the sake of them. If that was the case, why not start a form with (( or even (((? Like, does anyone like using progn or begin? I mean seriously.. Syntax is great, DSL’s are great, they help you to express things elegantly and succinctly. This is my major beef with Lisp. If I’m not manipulating the AST, I don’t want the heavy syntax burden. If I am, then great, Lisp is awesome. Maybe my career is different from you guys, but I’m not transforming source code even 5% of the time. I’m adding numbers, I’m multiplying stuff, I’m writing out formulas. And let me tell you, trying to write out math with S-exps majorly sucks. You would have to be insane to think that “(+ (fib (n - 1) (fib (n - 2)))” is better than “fib(n - 1) + fib(n - 2)”. Sorry if this sounds like a rant (it kinda is), but I don’t think anyone thinks syntax is bad. It’s just that Lisp has minimal syntax and that seems good enough. You don’t notice all of the nice and convenient things you would have to give up if you actually had a completely regular syntax.
- deleted 7y ago
- reikonomusha 7y agoThe slide that the Racket folks presented recently on allowing non-parenthesized syntax literally had “I <3 ( )” branded to the top. I think you’re mischaracterizing the position of Racket developers, who are interested in catering to folks who don’t want to spend a good 20 minutes on how to use ParEdit.
- cutler 7y agoYes it does support macros. That's one of its main selling points.