150 points · by susam · 5y ago · 108 comments
Lisp as an alternative to Java (2000) - https://news.ycombinator.com/item?id=26720403 - April 2021 (94 comments)
Lisp as an Alternative to Java – Faster, More Productive - https://news.ycombinator.com/item?id=21899854 - Dec 2019 (1 comment)
Lisp as an Alternative to Java (1999) - https://news.ycombinator.com/item?id=12197131 - July 2016 (103 comments)
Lisp as an Alternative to Java (2000) [pdf] - https://news.ycombinator.com/item?id=9045574 - Feb 2015 (21 comments)
Lisp as an alternative to Java (2000) [pdf] - https://news.ycombinator.com/item?id=8446368 - Oct 2014 (55 comments)
Lisp as an Alternative to Java - https://news.ycombinator.com/item?id=3447101 - Jan 2012 (37 comments)
Lisp as an Alternative to Java [PDF] - https://news.ycombinator.com/item?id=61320 - Sept 2007 (9 comments)
> Just to put this paper in an appropriate historical context, I wrote it back when I was trying to convince NASA that flying Lisp on a spacecraft would not be a completely insane thing to do. The Powers That Be had already mostly accepted that it would be OK to fly Java, but they thought Lisp was too big and slow. This study and paper were designed specifically to address those concerns.
Were this a "professional" component/service, in perhaps the majority of situations today, he'd probably separate his docs into two kinds of documentation: the committed interface/API what, and the internal maintenance how.
The docstring for `print-translations`, for example, conflate these two kinds.
Incidentally, by 2000, Java had emphasized reuse API documentation for a few years, with how it presented Javadoc for both the core Java API and layered development, from the start.
By contrast, Lisp environments that exposed docstrings in IDE hypertext, like Emacs did, did some doc things better than Java for decades before, and are still really well-suited to army-of-one genetically-enhanced supersoldier Lisp hackers.
Enterprise development, SaaSes, microservices, large systems with multiple teams, etc., were arguably better off heading in the more software engineering direction that Java was going.
(Which is not to say that Lisps can't do the what&how docs separation. I've done a few embedded API docs things for Scheme and Racket that initially were inspired by Javadoc, Perl, and some of the less-commonly-used embedded docs setups for other languages. And have worked on a couple large Lisp systems that arguably wouldn't have been possible in a language without some of the Lisp family's other still-unusual strengths, nor without the highly-skilled developers that Lisps seem to attract disproportionately.)
QuickLisp is simply a joy to use, and the language is very portable with a fantastic specification and many top notch compilers.
IMO, what holds it back is a lack of a top notch IDE. It took me a year of love & hate with Emacs, I can now make pretty good use of the amazing software that is Emacs (where everything can be changed), but honestly at times I want a simple point & click free IDE which is polished and does most things well and out of the box. Portacle is a step in the right direction, but the Emacs dependency IMO does make the language a bit more niche and lose out to other languages for beginners. If some big corporation can mix sublime with slime with paredit with some of the customize ability of Emacs, then Common Lisp could explode in popularity.
Don’t get me wrong - I LOVE Emacs and everything about Emacs & CL combined, but it took me a year to get to this point.
[1] For those interested, I wrote this article covering the basics: https://ashok-khanna.medium.com/lisp-the-web-4c00c88d11f9
Apart from editors, more editor-independent tools would be nice. McCLIM's Clouseau is a pretty cool graphical inspector/variable watcher.
IMO what holds it back is lack of a big company using and promoting it along with tooling (which might be in the form of alternate IDEs or good plugins for popular editors like VS Code or IntelliJ). Clojure has shown what's possible without such, most use emacs but there are popular alternatives too, and for a time it was even as popular as Go, but Go has BigCo backing, and we can see how much further that brought it despite its many shortcomings.
https://susam.in/blog/lisp-in-vim-with-slimv-or-vlime/ is a good overview of the differences between slimv and vlime (the two vim plugins) and how to use them.
The desire for an Emacs-based out-of-box power-user IDE was how we got Lucid Emacs, aka XEmacs (which was one of the two big forks of GNU Emacs with GUI innovations that GNU took a while to catch up with)...
...from JWZ, et al.'s work on the Lucid Energize IDE for C++...
...and JWZ worked for Norvig early on...
...and Norvig was at Harlequin...
...and Harlequin acquired at least some of Lucid's IP.
I hear good things about Lispworks[1][2], but personally I'm put off by non-free development tools. Especially ones with a 3-4 digit price tag. However, their business model evidently works for them.
[1] http://www.lispworks.com/products/lispworks.html
[2] https://lisp-journey.gitlab.io/blog/discovering-the-lispwork...
Which programming language you choose really doesn't matter very much. Since 1982 Common Lisp has been my favorite language, but I have recently learned to also love Swift.
All the libraries - both open source and commercial that do a million things - do not exist in the Lisp ecosystem.
Even in 2000
This essay starts with the context of his choosing Python to express what was formerly pseudocode.
The bigger issue though is wasting time wrapping Java libraries and most comments I see about Clojure interop talk as if there is no cost to it.
Clojure has good foundations but the ecosystem never really developed.
You are not forced to "waste time" wrapping Java libraries. As a matter of fact, thanks to the interop features that are well thought out, using Java libraries directly via the interop is encouraged and preferred to wrappers (Java Time API is a good example.) You may _choose_ to write wrappers for Java libraries if they make consuming these libraries in your code a bit nicer.
> Clojure has good foundations but the ecosystem never really developed.
There's no separate ecosystem for Clojure(Script). The established ecosystems such as JVM, .NET, and JavaScript _are_ the Clojure ecosystem. The creator of Clojure(Script) realized that it would be practically impossible to build an ecosystem from scratch without significant investment (Sun spent billions of marketing dollars alone in Java) and thus deliberately chose to make Clojure(Script) a language hosted on well-developed platforms such as JVM, .NET, and JavaScript. Also because of this focus on being a hosted language, he went to great lengths to ensure the interop with its hosting platforms is as seamless as possible. If you need an example for awkward interop with Java, try Scala.
"Clojure embraces java and its libraries. Idiomatic Clojure code calls Java libraries directly and doesn't try to wrap everything under the sun to look like Lisp. This surprises make new Clojure developers but is very pragmatic. Where Java isn't broken, Clojure doesn't fix it"
So the ecosystem is a superset of the Java and JS ecosystems, which are pretty developed.
I do agree that the cost of required to know 2 or 3 languages is real though.
I seriously tried to use Common Lisp for numerical programming 10 years ago. It was faster and would have been better platform for numerical programming than Python, R or Julia. Just a great language. (Ross Ihaka had plans to port R into Common Lisp to make R fast at one point)
The real problem was the lack of convergence of data structures and conventions above the language standard.
Python has pandas tables and numpy arrays. R has Data frame. Every numerical library for CL had their own conventions, and ways to implement the basic data structure, Some used lists, some just arrays, some had list of vectors, classes, structs, property lists.
The impedance mismatch was not worth it. Either implement numpy equivalent on your own or half of your code is data massaging data between libraries.
--
Perlis epigram: "9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures."
I'm not sure what kind of question is that. A whole bunch of them? Certainly not worse ratio than many contemporary or even modern languages. There's a lot less friction to get any random GitHub CL project working than say a Swift one.
I haven't tested this but here you go:
I'm pretty sure that due to the curated nature of code in QuickLisp, there's really no problem with that. If something doesn't load properly, it's a bug that you should report.
That said, Common Lisp itself includes many of the more useful but difficult-to-write features like hash tables, sort/merge, bignums, complex numbers, etc.
The most-used stuff that's not in Common Lisp itself like multithreading and sockets are well-covered by external libraries. The lesser-needed stuff is also quite well covered by the quicklisp library infrastructure [0] as well.
So the statement "libraries...do not exist in the Lisp ecosystem" is plainly false and it marks the speaker as someone not very familiar with Lisp.
Having professionally worked in CL and Java, this is true and completely misses the point. Of course you can write your own libraries, the question isn’t whether you can but whether or not that’s a wise usage of your time and energy. Java gives me a ton of fantastic libraries out of the box that let me focus on my domain, which is a good thing!
> You're expected to know how to program if you use Lisp; not to depend on tiny prewritten functions in the npm universe that may or may not solve your problem, that may or may not be written in a secure or efficient fashion, and that possibly pull in a million transitive dependencies you don't need.
Sneering at people who use different languages is both a bad look, and a bad way to convince people that you’re right. I’d recommend staying way clear of any suggestion that your peers don’t know how to program.
> The most-used stuff that's not in Common Lisp itself like multithreading and sockets are well-covered by external libraries. The lesser-needed stuff is also quite well covered by the quicklisp library infrastructure [0] as well.
This is a pretty drastic understatement of how far behind Java CL is. Forget multithreading, think more about metrics, logs, configuration, A/B testing, retries/bulkheads/circuit-breakers, feature flags, and secrets management. All of this stuff I get for free out of Java libraries, often in automatically self configuring ways.
Configuring a Kafka reader in my app and seeing that it automatically discovered Micrometer on my class path and started emitting metrics is a lovely experience. Switching metrics servers from InfluxDB to Datadog with a single code change was damn near nirvana.
If CL wants to be a compelling alternative to Java for industrial use, it’s got to catch up on all this stuff.
This was a bug in the Common Lisp community in the early 2000s when I was getting started with it and looking to the community for help identifying libraries for common functionality. People were friendly and helpful, but they gently pushed me to accept that reaching for libraries was a habit I was bringing from other languages, and in Lisp I could (and should) write my own implementations for things like logging and date formatting. Sharing code was for big hard stuff, not easy stuff.
Since then, it seems like a number of people have put a lot of work into moving the community forward from that romantic approach to a more pragmatic one, but if I wanted to use Lisp now, I would scrutinize that aspect of Common Lisp very closely before getting back into it. I would lean heavily towards Clojure instead.
I'm pretty sure that this was a criticism of NPM rather than of any language.
> Forget multithreading, think more about metrics, logs, configuration, A/B testing, retries/bulkheads/circuit-breakers, feature flags, and secrets management.
I could understand logs and secrets management (if it's what I think you mean by that), but how do the other things relate to the language? Except for retries which I would have thought were much better integrated into CL then they could be in Java, given resumable conditions.
> Configuring a Kafka reader in my app and seeing that it automatically discovered Micrometer on my class path and started emitting metrics is a lovely experience.
Is this a thing that something like asdf-system-connections would solve in Lisp? (IMO also much more elegantly than by "discovering X on my class path".)
Sorry to be so blunt but this is ridiculous. You are mentioning hash tables and multithreading to prove your point. I am pretty sure this is not what parent meant when they wrote "The ecosystem is just not there". And what does "writing your own libraries because it's so easy to do" even mean? You still have to do it and it takes a lot of time and money. A library that talks a specific protocol to a medical devices. A library that writes some obscure data format used by some government somewhere on earth. This is the real world.
Some people love to point out how stupid JS programmers are because of the left-pad incident.
The reality is that, in almost every domain, there are many things which are either difficult and/or time-consuming to implement, or common across several projects and tasks. Do you really want to waste your own time and the time of your teammates reimplementing these things for every project if you don't need to?
Even if the underlying implementation is "easy", having a handful of well-tested libraries with thoughtfully-designed APIs is important for productivity in many (most?) programming tasks. Yes, there might always be a specific case when you can't use the popular library for X, but that's the exception and not the norm.
"It's easy to write your own libraries" is true in any professional-grade language. Arguably it's one of the things that makes a professional-grade language professional-grade. It's not a justification for having a bad library ecosystem, it's a rationalization.
As a side note, I think the Lisp library ecosystem in 2021 is pretty good, considering how unpopular it is in industry.
That statement could be said of any language the programmer is comfortable with. It's no more a LISP philosophy than a C++ one. The difference is that way more people are working with C++ (or Java) thus opensourcing their libraries for others to be used.
I am pretty sure you are expected to know how to program if you use any programming language. And writing everything from scratch, instead of taking advantage of the work done by thousands of other skilled developers, is just silly. With that attitude, no wonders the world runs on C/C++ and not Lisp.
If you are every in need of a subject to write about--I might even pay for a walkthrough of the code that built Hackernews.
I don't think I'm alone either.
Do libraries exist in Lisp on the same scale as they exist in Java? Especially, do they exist with the same level of quality, professionalism, and maintenance as they exist in Java? I'm guessing that the answer is no.
And yet everything you run your software on (Linux/Windows/your browser etc.) is written in those languages. Mostly C/C++. So clearly millions of developers can do real work with those languages. And very little real world useful software (except a few websites and Emacs) is built with Lisp. Despite Lisp being an older language that most. And yes I know the standard reply to this is “all non-Lisp developers are stupid” which is just unbelievably childish/arrogant.
Lisp isn't very popular because, at least in my opinion, it requires a relatively high level of maturity and experience to be used effectively on nontrivial projects.
Every single project in Lisp (Common Lisp, Clojure) that I have observed ended in a disaster mostly because developers could not figure out what the strengths of Lisp are to realize the benefits and then killed themselves with too much freedom.
Absent large enough number of success stories companies will default on Java because it is good enough language to be able to effectively realize typical enterprise application and dumb enough to be used by a beginner dev, even at the cost of boilerplate.
At least that's the official story. It is really difficult to explain to business that you could do whatever they want with 1/5th or 1/50th of the amount of code if you just used a good language for it.
Other languages scale smoothly from beginner to expert. So I guess that your assertion shows that Lisp is a less useful language?
Experienced programmers using non-Lisp languages are successful every day. Your OS/mobile phone/browser/… is the result of their work. So I guess other languages are better for experienced developers as well?
In other words, the real world evidence seems to suggest that Lisp is not good for beginners and not good for experienced developers.
Things are not so simple
[1] talking about speed
"Go as an Alternative to C"
The following mapping from letters to digits is given:
E | J N Q | R W X | D S Y | F T | A M | C I V | B K U | L O P | G H Z
e | j n q | r w x | d s y | f t | a m | c i v | b k u | l o p | g h z
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
|9
We want to use this mapping for encoding telephone numbers by words, so
that it becomes easier to remember the numbers.