3 ms·
The Lisps core appeal is that it's an extremely flexible and dynamic language family. They got an unparalleled macro system that lets you effectively design you
by simias 6y ago
The Lisps core appeal is that it's an extremely flexible and dynamic language family. They got an unparalleled macro system that lets you effectively design your own DSLs trivially for any scenario you may encounter.
It's also the reason I could never really enjoy CL (or lisps in general): everybody basically ends up using their own dialect of Lisp with their own idiosyncrasies. Some people love the "loop" macro and use it everywhere, some others thing it's ugly and use the equally powerful but syntactically very different "do" construct instead. You can look at some lisp code and have no idea of what it does if you don't expand a few layers of macros first.
That can be true of any language of course, you can abuse overloading, references and macros in C++ if you want, but Lisp really pushes it to the limit in my experience.
Beyond that there's also the problem that the ecosystem is not quite as developed as other more mainstream scripting languages. It doesn't help that the community is split across half a dozen lisp/scheme implementations with often incompatible packages. Do you want to use SBCL? Chicken Scheme? Racket? Guile? Emacs lisp? CLISP? ECL?
- travv0 6y ago> You can look at some lisp code and have no idea of what it does if you don't expand a few layers of macros first. I've not once expanded a macro in order to see what it does. The only reason I can think of that one would do that is to see how it works, but one also has to look at e.g. the definition of a function to see how that function works, and that should almost never be important. How are macros different? Just like functions, one often has to read the documentation to know how to use a macro, but I'm not sure how being a macro makes (loop for i from min to max do ...) harder to read than a function would be.
- simias 6y agoFunctions can be opaque of course, but macros are worse because anything goes. I think the standard loop macro is a good example of this: (loop repeat 10 for x = (random 100) if (evenp x) collect x into evens else collect x into odds finally (return (values evens odds))) This macro is actually fairly well designed, so you can guess what all of this does just by interpreting the names (assuming that you understand English well at least) but it's barely Lisp. Just figuring out what parts of this call are keywords and what part are just normal symbols is hard to figure out. (return ...) looks like a function call, but I don't think it is(?). Is collect a loop-ism or can I replace it by any function name? I think it's the former. Is "into" just here to make grammatical sense or are there other keywords I can use here? If `evens` and `odds` already exist as variable names outside of the loop, will they be used or is it a new local binding? If it is a local binding, how do I tell it to use some existing variable name instead? Basically it's like printf format strings, it's a language within a language, and idiomatic Common Lisp is often full of that stuff in my experience.
- AnimalMuppet 6y ago> Basically it's like printf format strings, it's a language within a language... That's to be expected with a DSL, isn't it? It's almost the definition. But I think you're right. The point of a DSL is to change the language to something that you find more useful for what you're trying to do. The downside is that you've changed the language, and now people don't know what to expect unless they're very familiar with your DSL.
- jackdaniel 6y agoI think that this opinion is shallow. LOOP and DO are both standard operators, like while and for in C. To paraphrase: "Some people love the 'while' operator and use it everywhere, some others think it's ugly and use the equally powerfully but syntactically very different 'for' construct instead". You could make a case that some CL features are underappreciated, some are overused, and some are used chaotically by different programmers, but this example is not a good one. If you use the term "scripting language" as an indication, that Common Lisp is interpreted (it is often used in such context) - that is not true - language can't be interpreted, its implementation could - most Common Lisp implementations feature compilers to binary. The standard even provides you with functions compile and compile-file. Regarding communities: you've mentioned three (or four) different programming languages. Only SBCL, CLISP and ECL are common lisp implementations and they share the same community - because they implement the same standard. It is as if you had said, that there are separate cython and python communities - each implementation has its merits, but users of both are usually part of the same python community. Similar comparison would be between clang and gcc programmers. Many many Common Lisp systems work well on different implementations of that programming language (some with compatibility layers, some are simply portable programs).