6 ms·
> and Clojure’s syntax is pretty limited Erm, what? I am confused by the use of the word 'limited' in this context.
by outworlder 8y ago
> and Clojure’s syntax is pretty limited
Erm, what? I am confused by the use of the word 'limited' in this context.
- vbuwivbiu 8y agomaybe they mean 'simple' ? simple is good
- ppppppaul 8y agolisps can be thought of languages that avoid syntax. the code you write is more like a high level AST.
- keymone 8y agoYeah, and since you can represent using an AST any syntactic construct in other languages, it makes lisp the opposite of limited in terms of syntax.
- nfrankel 8y agoI confirm: the syntax is limited. There are only a few keywords and langage constructs. The power is in the number of functions made available, or the ones you create for yourself.
- outworlder 8y agoDoesn't Clojure have reader macros? The whole point of lisps is that you can extend them.
- virmundi 8y agoWhen I worked with Clojure the community seemed to treat macros as a nuclear option. Only use them when absolutely necessary. For some, this translated to “you can’t hug your children with nuclear arms”. If the community hasn’t changed, perhaps macros out of favor.
- serpix 8y agoThis still stands, macros are a really high level abstraction and do not compose. Almost always a function is enough. But if it saves a good chunk of repetition on something complex then go for it. A good example of code with macro overkill is compojure-api. There is just so many clever macros that you need to read the original source code with a microscope to know what the code expands to.
- didibus 8y agoActually, Clojure does not have reader macros, because it was thought to be the biggest cause of the lisp curse.
- grzm 8y agoNit: Clojure does not have user-defined reader macros. There are quite a few built-in reader macros, including #? added for reader conditionals.
- lispm 8y agoThen I'm surprised that it allows the user to define functions and macros.
- didibus 8y agoI think most schemes also don't have reader macros. How often do you actually use them in CL? I feel reader macros have the problem that it modifies/extend the foundational syntax. And that can become overloaded really quickly. Normal macros can change evaluation semantics, but not the fundamental syntax. Which makes it easier to navigate and understand in general. Also, reader macros are pretty hard to write in comparison. Racket has a nice take on them though. Making them more like all new programming grammars, and defining your dialect per file. Even there though, most alternate syntax is for research or fun mostly.
- keymone 8y agoMaybe it’s a problem with translation? “Limited” comes with negative connotation, as in “you can’t do as much as the other, non-limited guy”. Maybe you wanted to say “minimal” instead? s-expression based syntax is as powerful as it gets, as it allows to concisely represent any AST.
- TeMPOraL 8y agoWhen talking about Lisp syntax, what you almost always want to say is "lisp has $most-positive-word-in-context syntax". So it's "limited" for some, "simple" for others, but the overall point is the same - no cruft and unnecessary sugar, and uniformity allows for easy programmatic transformations of code.
- nocman 8y agoI believe they mean "limited in a good way", as in it doesn't have a bunch of unnecessary syntax that increases the number of characters entered, but does not add value to the language. No pun intended, by "value" I mean "things that are worthwhile". Clojure is totally into "values". :-D