4 ms·
Lisp. Its the most powerful language that has been in existence and yet most modern programmers haven't heard about it or used it. Almost everything to do wit
by kamaal 9y ago
Lisp.
Its the most powerful language that has been in existence and yet most modern programmers haven't heard about it or used it.
Almost everything to do with the ecosystem is magic, and its not even a programming language by many a measure, its a thinking paradigm so powerful that it could make many things that look impossible a walk in the park. I've only been learning it for more than a month now, and this is what I've seen.
1. Unmatchable features when it comes to modifying structured data of any kind. Many eons ago our foregeeks seemed to have imagined everything in computer science as either a list or combination of lists on somekind. Tree, Queues, Heaps, Stacks, Vectors, Graphs, Sequences, Sets... You name it, these are all lists or a combination of lists. The programs too are lists(abstract syntax trees). Most modern day data structures you will will deal with XML, JSON, Tables, Matrices are lists or a combination of lists. And lisp is list processing. Once you get a hold of lisp and its paradigm of thought, even difficult algorithms and data structures feel like a walk in the park. I used to struggle with white board coding and algorithm stuff, these day most of it comes to me naturally or little work, when I think of it in terms of lisp paradigm.
2. Recursion: For some reason, its very easy to think recursively in lisp. And that makes very easy to represent hard solutions.
3. Functional programming: Full functional programming features, no holds barred.
4. REPL: If you haven't used the Lisp REPL, you haven't seen a real REPL yet. I was completely blown away by the REPL. Combination of Emacs + SLIME is just too good. And you can hot swap code by attaching to a live process. Which is totally insane.
4. Continuations: Makes it very easy to express a variety backtracking problems.
5. Macros: Ability to extend and add any language feature and paradigm you want, at compile time at 0 costs. And anything you add becomes a part of the language.
6. Libraries: Most lisps these days have libraries for most of the needs.
7. Books: Lisp easily has the most eccentric, fun and enlightening books in all of CS history.
When you code in lisp it feels you are dropping tiny little recursive functions all over the place which grow like a small organism to a very intelligent being.
This is closest I have to come to programming Nirvana so far. The last time before this was when I used Perl.
- btschaegg 9y agoI strongly concur with this. I'd like to point a very specific thing out, which you only implicitly refer to: homoiconicity Anything else, you can pretty much bolt onto any other language, but that will never happen with homoiconicity. The language has to be built with it in mind, or you won't get it. Ever. It boggles my mind that there are almost no non-lisp-like languages that try to do this. If I had to guess, I'd assume that any language like this that could have been concieved was so similar to Lisp that it just wasn't worth reinventing the wheel. It still makes me wonder though - here we are, the concept is 50 years old, and we're still bolting lexers together.
- kamaal 9y agoI think Perl 6 has this concept of using the language to modify itself. Not exactly through homoiconicity, but the concept is somewhat similar.
- b2gills 9y agosub infix:<d> ( $count, $faces ) { (1..$faces).roll($count) } # from this point on the language has changed to have a # new infix operator say 5 d 20; # (13 5 3 3 14) The Rakudo implementation also has macros and Slangs which are more powerful, but we want it to have a better interface; so they are not part of the Perl 6 spec yet.
- kazinator 9y agoHomoiconicity just means that procedures are stored in the same representation in which they are entered, or nearly (modulo tokenization and such). It was defined that way by the programmer who coined the term in the 1960's, and is well documented in the Wikipedia. POSIX shells are homoiconic; you can type set to see all the functions, which are printed in reformatted source code, that you can copy and paste. That could work in any interpreted language. Classic line number BASIC is homoiconic. You can LIST the lines of code. A Lisp is useful even if it isn't homoiconic (functions cannot be edited). ANSI Lisp has some loosely defined support for homoiconicity via the ed function. This isn't used much; actual Lisp environments have other means to recall and edit a function definition, such as an IDE with buffers or REPL with history. The term homoiconic doesn't really "nail it" when it comes to Lisp.