6 ms·
Honest question: why do people like lisp so much? Everything I've been able to learn about the language is that it was designed for a non-register based hardwar
by guywithahat 8y ago
Honest question: why do people like lisp so much? Everything I've been able to learn about the language is that it was designed for a non-register based hardware that never caught on, so now it's just a less effective language that doesn't run as fast as anything else and has a steep learning curve since you need to learn a new programming paradigm. The only good thing I've heard about it is it's simple to implement since it doesn't have a ton of functions, but that doesn't seem like a very good reason to do something just because it's easy to write the code.
- KingMob 8y agoI doubt anyone in the modern era thinks about 60's hardware when evaluating Lisps. If this is what you think of them, you're reading some odd stuff. Check out Paul Graham's On Lisp, or Seibel's Practical Common Lisp. Most people using lisps aren't implementing them. People are drawn to them for various reasons, among them: strong metaprogramming facilities, real homoiconicity, DSLs, multiple paradigms, REPL development, hot-loading, and sheer elegance.
- MatthewPhillips 8y agoI don't know where you get that it can't be fast, that's certainly not true. Gambit Scheme is just one example of a fast lisp. People like lisps because they are written as ASTs. So you can manipulate programs (ASTs) to create DSLs very easily.
- jmcomets 8y agoMetaprogramming. At least that's what I enjoy. In Lisp you can "quote" s-expressions (think "function body"), manipulate the AST and evaluate them how you see fit. It's like Ruby's blocks or Python's metaclasses, but with any construct in the language.
- ychen306 8y agoPerformance wise it's not slower than languages like Python. For some people (not me) macros simplify their development by a lot. The learning curve is honestly pretty shallow; in my experience Lisp is hard for people who haven't really nailed down recursions, and in this respect it's also a great learning tool. Being simple to implement is a big plus as it allows you to focus on the crucial parts -- IMO people learn better when they get to learn one thing at a time and having a small core to your language is important.
- bjoli 8y agoAre there any CL implementations that are as slow as python?
- ychen306 8y agoI am just providing a lower-bound to its performance.
- 3rdAccount 8y agoThe slowest common lisp I'm aware of is CLISP (used in the Land of Lisp book). I don't even think it is nearly as slow as Python. In fact, even Picolisp (weird, but cool interpreted Lisp outside the Common Lisp and Scheme families) is probably faster than Python, but I've never checked.
- shakna 8y ago> Performance wise it's not slower than languages like Python. That's a low bar. Performance wise, most languages are faster than Python. However, CL and Scheme both blitz Python when it comes to performance.
- bjoli 8y agoSBCL is together with luajit the fastest dynamic programming implementation there is. It runs laps around things like python and ruby. It does not have a steep learning curve. You become quite capable quite fast,but there is a lot to an implementation like SBCL and it will take a long time to understand all of it. The metaprogramming utilities of lisp are still unmatched. Scheme (my daily driver) is a smaller language. It consists of a small set of well chosen primitives that easily compose to build higher abstractions. It is really nice to work with.
- rurban 8y agoChez is also in this performance league
- pjmlp 8y agoAre there benchmarks of SBCL against LispWorks and Allegro?
- bjoli 8y agoNot that I know of, but LW 64bit and SBCL are comparable in my experience. Allegro I have heard is slightly slower but with a better memory usage (so maybe like CCL?)
- pjmlp 8y agoI see. Just mentioned them, because many ignore them as they are commercial products, yet I would consider them the surviving ones from Lisp Machine days developer workflows. So I would assume, parallel to the the graphical developer tooling, they also offer quite good compilers.
- lispm 8y agoThe compiler is only 1/3 of the equation. One needs also a fast runtime (memory management, signal handling, implementation of language primitives like bignum arithmetic, ...) and a fast implementation of the core language library - since that is also mostly written in Lisp. Additionally there are roughly three usage modes for the larger CL implementations: 1) interpreter, often used for development/debugging 2) safe compiled code with full error checking and full generics, often with lots of debug info 3) optimized code, with various degrees of unsafeness, with no debug information, often with limited or no generics Often applications are a mix of 2) and 3), where often 3) is limited to the portion of the code that actually needs to be VERY fast. This means, that the large majority of the code is fully safe and fully generic code -> thus it has a lot of influence how fast the language/application feels. For example when one uses CLOS (providing a lot of generic and extensible machinery), a CLOS implementation will use a lot of caching to make it run fast -> caches cost memory. Now, when one starts a CLOS-based application these caches need to be computed and filled - which might make the application at start up feel a bit slow or sluggish. So it makes sense when generating an application to save it with the caches pre-filled - then at application start, caches are simply already loaded and there is no performance hit at startup. That's not something one can see in a simple micro-benchmark or which depends on the 'compiler' (the part which compiles code and generates the machine code) - that's performance from the wider CL system architecture -> one needs to be able to provide that to CLOS applications to improve user acceptance.
- DonaldFisk 8y agoIt wasn't designed to run on specific hardware, and originally ran on the IBM 709, which has registers. Lisp Machines were designed to run Lisp, not the other way around. Why Lisp? For me, it gives me the freedom to get software written with the minimum of fuss in the least amount of time. I can keep my Lisp up and running, while I make changes to my code. I can type in and print out complex data structures without having to write parsers or print methods. I can experiment with data without defining new classes. If some functionality doesn't exist, I can add it: there's no distinction between the language itself and the libraries. Maybe you should speak to more people who use Lisp, or try it yourself. If you don't know functional programming, you can still write basic Lisp until you learn it.
- mepian 8y ago"Everything I've been able to learn about the language is that it was designed for a non-register based hardware that never caught on" That's a silly thing to say, especially when two of Lisp's primitive operations, CAR and CDR, are literally named after IBM 704's registers and the first implementations were done on register-based hardware (IBM mainframes and DEC minicomputers).
- didibus 8y agoThere are many Lisps, some of them rank as arguably the fastest dynamic programming languages there are. They can even compete with statically typed languages in performance. So you should expect Java level performance to be possible on many Lisps. In the 1950s, Lisps were considered too slow in comparison to Fortran and C. You have to think though, (as I explain later), Lisp is arguably the first higher level language. In the 1950s, Java, Python, C#, Ruby, JavaScript, Haskell, F#, would all have been considered too slow also if they existed. Lisps compete with Java, C#, Haskell, etc. in terms of performance. There's now also more archaic Lisps that don't use a GC, and compile to very efficient machine code, that could compete with C speeds. Most Lisps actually have too many functions. Not that its bad, but I think you got confused with they require very little primitive functions to mean there standard libs to be small. On to why, it's hard to explain, but it's arguably the greatest syntax ever designed. In that it's simple and consistent, yet can express all things and easily be extended. You really have to try it to understand though, and give it a good 30 days. It's only once you're familiar with it and past the initial hump that you understand its appeal. Finally, I'll explain the historical reasons people like Lisps. Its because they pioneered garbage collection, conditionals, closures, multiple inheritance, mixins, dynamic typing, macros, meta-programming, functional programming and REPLs (aka programming prompts). They were also the second OOP language, some people say to this day, only Smalltalk and some Lisps are truly OOP. So there's a lot of love due to its legacy of everything it gave us. They're now being rediscovered, and because most software can now be successful even at Java's performance and memory usage, Lisps are making a come back. Since they no longer have any defeating drawback.
- pjmlp 8y agoYou missed one feature, most of the IDE ideas related to the work done at Xerox PARC languages (Interlisp-D being one of them) and Lisp Machines. :)
- bo1024 8y agoNo comment on why people like to use it, but I know why they like to learn it: it's a new programming paradigm, as you said. It broadens the way you think about code.
- isaachier 8y agoClojure/ClojureScript are pretty popular for a language that "never caught on."
- isaachier 8y agoOK reread and believe you were referring to architecture not language. My mistake.
- nikofeyn 8y agowhy do people not like it so much? i mean, nearly everything you have said is simply incorrect, so it’s hard to know where to start.
- geocar 8y agoI programmed professionally in common lisp for about a decade. Everything you said is exactly backwards: - You can use whatever paradigm you want. - Most implementations are fast enough. - A competent programmer with expert guidance can be effective in common lisp within a day. - It has many functions, perhaps more than any other language - It is tricky to implement fully and correctly (I used to contribute to ECL; Embeddable Common-Lisp) Lisp is perhaps the most effective language. ESR says[1]: [LISP is worth learning for] the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot. (You can get some beginning experience with LISP fairly easily by writing and modifying editing modes for the Emacs text editor, or Script-Fu plugins for the GIMP.) However RG says[2]: I just wasn't a very good programmer any more. Lisp's power had made me complacent, and the world had passed me by. Looking back, I actually don't think I was ever a very good programmer. I just happened to have the good fortune to recognize a good thing when I saw it, and used the resulting leverage to build a successful career. But I credit much of my success to the people who designed Common Lisp. [1]: http://www.catb.org/esr/faqs/hacker-howto.html http://www.catb.org/esr/faqs/hacker-howto.html [2]: http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2006-04/msg01644.html http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2006...