Hacker News new | ask | show | jobs
by _hcuq 1545 days ago
If Lisp is do efficient for development, why are there essentially no commercial products that use it?
9 comments

StandardML vs go is a great illustration.

StandardML is just as fast, is more simple to learn with more simple syntax and basically zero gotchas, has more powerful syntax, has an actually sound type system (which has better generics than the ones proposed in go), does a better job at defining public functionality (via modules), has a better CST model, and many other great features.

The only area where it loses is standard libraries and marketing. Google invested millions into these two things, so people use their decidedly inferior language.

You'll find that pretty much every big language has a big company behind it that threw tons of money at its development.

I am learning SML currently (with the book "Elements of ML Programming" by Jeffrey D. Ullman) and I have to say it is quite elegant. I like the pattern matching for functions. Often it is surprising how much shorter functions become, when you pattern match in the signature of the function. Makes me think, that maybe I should think about using pattern matching more in Scheme as well. And that I don't want to miss it in any new language I learn. Of course also the type safety is great. I could imagine writing critical parts of a system using SML.
Do you know how good SML's concurrency story is these days?

I tried http://mlton.org/ConcurrentML but gave up due to lack of time and the state of the documentation.

SML is great as a language, but has terrible tooling and a balkanized ecosystem of incompatible implementations, many of which only support REPL workflows (and these tend to be the implementations used for teaching). These are a far cry from the typical "point a compiler at a build file and go" that developers are used to. Go may be a strictly worse language as a language but still be better for building and distributing applications. SML is also very poorly documented, and it is rarely clear which implementation's documentation you're even reading when you find something on the web, which can often lead to quite a bit of frustration. Go, on the other hand, is extremely well-documented.
SML doesn't have "incompatible" implementations per-se. If you stick with what the standardized language and basis libraries specify, your code will compile everywhere (I don't know of any popular implementation that doesn't support the spec). If you use their proprietary extra features, then portability will naturally go down.

The primary means of developing uses SML/NJ for development and MLton for the final, optimized build. Both use the same Compilation Manager[0] and generally share the same ecosystem so using them together pretty much just works.

[0] https://www.smlnj.org/doc/CM/new.pdf

Your parent acknowledged everything you said in his comment.
The usual answer here, as several of my sibling comments have pointed out, is that popularity and quality are not necessarily correlated. Since this has already been discussed, I won't delve further.

Another answer that hasn't been discussed much is that... maybe it isn't better for development. The article discusses one way in which this could be true: that technical superiority essentially leads to a hopeless community fragmentation that more or less forces it to be inferior in terms of community effects (which are, presumably, more important for commercial development rather than individual development).

A different facet, though, is that I believe the better language isn't the one that gives you more powerful tools to write correct code, but the one that keeps you from writing incorrect code (while still letting you write correct code). A salient example here is goto. Most modern languages don't have the goto keyword anymore, but they instead retain things like break, continue, and early routine... all of which are restricted forms of goto. By using only these restricted forms instead of the general form, it is much easier to immediately see what the code is doing (and presumably quicker to understand why), even though it may strictly be less powerful.

> If Lisp is do efficient for development, why are there essentially no commercial products that use it?

Same reason most of us use QWERTY keyboards instead of one the many better layouts available. After a long enough time as the dominant tool, things get locked in regardless of whether or not they're the best tool for the job. C-Style languages gained dominance early on and became the defacto standard.

> Same reason most of us use QWERTY keyboards instead of one the many better layouts available.

Many people here are coders, not writers, and the layout for generating human language is irrelevant. With QMK firmware tap-hold, and one finger each hand chording, one opens up a quadratic expansion of expressibility, all near home row. Now one can automate all frequent actions (VSCode commands, application launches, windowing scripts) as paired keystrokes.

Keyboard layouts should be the poster child for "Don't get sucked into taking the problem statement as given, THAT's usually what needs questioning."

> With QMK firmware tap-hold, and one finger each hand chording, one opens up a quadratic expansion of expressibility, all near home row.

I'm a happy qmk enthusiast. My point was that the overwhelming majority of people will stick with the defaults for most things, which is why usage and adoption rates are not always a good indicator of the quality or utility of a tool.

This week there was the annual European Lisp Symposium [0], in Porto, Portugal, and it's sponsored by companies who use Lisp in their products.

If you have ever taken a train or subway in Europe, you depended on Lisp.

[0] https://www.european-lisp-symposium.org/2022/index.html

> If Lisp is [so] efficient for development, why are there essentially no commercial products that use it?

I’m sorry you’ve been downvoted for asking this question, even if it was a rhetorical question.

It’s easily the most important question to ask in the professional programming area, and it’s worth the effort to truly grok the answers rather than look up what everyone seems to say and then repeat it as gospel.

It may be asked and answered ad nauseam, bit it’s worth answering in the context of the very article discussing the Lisp curse.

Read TFA. What if every programmer rolling their own version of everything makes it an astoundingly good language for people but terrible for gaining industry-wide adoption?

JavaScript had this problem with every framework implementing its own OOP. Ember.js comes to mind as a recent example. The language stewards added a class keyword to ES6 in large part to quash further Balkanization of JS OOP.

Why didn’t JS wither while Lisp did? Ah! The answer is very relevant to your question. Every popular language began as the scripting language for an explosively successful platform.

JavaScript being the only way to script browsers bought it over a decade of time to fix its warts while it really wasn’t a “good” general-purpose language strictly on its merits.

Likewise, C and C++ were the scripting languages of Unix and Windows native application development. Ruby is the scripting language of Rails, for another example.

What is Lisp the scripting language of? A CS wag would reply, “Lisp!” And that is simply not good enough to motivate enough people to standardize the things that would lead to widespread adoption.

It’s a social problem, just as TFA says. Which leads us to a different essay about Lisp succeeding and failing:

https://en.wikipedia.org/wiki/Worse_is_better

Lisp was the main language of Symbolic AI. That market largely crashed in the 80s/90s.

Planners&scheduling in the military&logistics (airlines, airports, train operators, satellites, ...), expert systems for maintenance, computational engineering systems (for example for airplanes from Airbus and Boeing), theorem provers (used in chip design), symbolic mathematics, natural language systems (text translation for the EU), ...

Would you agree that the general term for the market crash is the "AI Winter?"

https://en.wikipedia.org/wiki/AI_winter

I always associated all the use cases with Prolog ...
Alan Kay‘s answer to this question:

“Another interesting answer assumed that “the test of time” is somehow a cosmic optimization. But as every biologist knows, Darwinian processes “find fits” to an environment, and if the environment is lacking, then the fits will be lacking. Similarly, if most computer people lack understanding and knowledge, then what they will select will also be lacking. There is abundant evidence today that this is just what has happened.”

This is the case in almost any realms where a decision is made with limited information, whether it be programming languages, accountants, or used cars: https://en.wikipedia.org/wiki/The_Market_for_Lemons
The answer is always that popularity doesn't correlate with merit.
> The answer is always that popularity doesn't correlate with merit.

Exactly. If we used popularity and usage rates as the measure of merit, we'd have to conclude that the highest quality restaurant in the world is MacDonald's.

> the highest quality restaurant in the world is MacDonald's.

Isn't it so? The meal is enough healthy (for hard-workers only, not for calories-gathers), calorage as I have mentioned is excellent, waiting is minimum, non-meal payings (keeping the restaurant attractive) are the lowest possible, the most important thing is that in poor countries (my is in the bottom of bigmac index) the prices are lower than anything else available in big cities.

I'm one of those who actually likes McDonald's burgers. However, in the last year I decided to stop going there because of multiple experiences with restaurants near me where I ordered to go, and parts of the burger were cold. As in fridge cold.

As for price - not sure what you mean by "poor" countries. In the ones I've traveled to, McDonald's is considered a high end restaurant and is not cheap by the local standards.

>The meal is enough healthy Have you been sleeping under a rock for the last 20 years ? McDo food has never been healthy. The nutrient content is poor, potatoes are cultivated with nasty insecticides, shit in the meat, etc, etc
> McDo food has never been healthy

What do you think is needed to be add or to be removed?

> The nutrient content is poor

Can you disclosure your information a little bit? Maybe you have a link to some publications or anything better then just an opinion.

> potatoes are cultivated with nasty insecticides

Of course they are, or you know any better protection from colorado beatle? If you are living in America or in another place where transportated species are not a problem for your local nature - you can not even imagine what a hard problem is to beat a specie which has no nature enemies.

> shit in the meat, etc, etc Well, I don't know where to get better ingredients then MacDo has gotten. I definitely not sure that meat in my fridge has no shit tbh.

High quality ingridients are costly too.
For the same reason we are using VHS and have JavaScript running in the browser.
With Clojure out there now I think the number of products using a Lisp is underestimated.
But Clojure is not a Lisp. It is Lisp-adjacent, a bit, but it is really not the same language.
>Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. [0]

Neither the Clojure page, nor its users seem to agree with you.

[0] https://clojure.org/

I think the typical argument goes something along the lines of, "it uses []{} and doesn't make cons the default data structure, abandoning some simplicity-of-language."
Aren't the brackets/braces just sugar?
It's not Lisp-as-in-Common-Lisp. It's closer to Scheme than to CL.

But it's "a Lisp" in the colloquial sense that it uses s-expression syntax and has macros.

Not s-expressions in the traditional Lisp definition of singly linked lists. In Lisp (a . b) is a cons cell with two symbols a and b. In Clojure it is some complex data structure with three elements a, ., and b.
Let's see:

- Insists on every expression being (wrapped (in parenthesis))

- Uses polish prefix notation

- Profound belief that recursion is more intuitive than loops

- Macros everywhere, because code is data, so why not?

- Whole language built from a very small set of axioms

- REPL-based workflow

QED Clojure is _a_ Lisp.

(FWIW I'm learning Racket right now)

Lisp: "List processing". Clojure doesn't even have cons cells... A Lisp without cons cells is like a C derivative without pointers...is it really C at that point? I'd also question the "profound belief that recursion is more intuitive than loops" since Lisp supports loops extremely well -- better than most languages, since you can build up your own iterative constructs using tagbody. And Clojure doesn't even have proper tail calls, so I doubt that Clojure actually believes in recursion.
Clojure doesn't have tail calls because they should be implemented at the JVM level to be effective, a feature which has been on the back burner for ever because no other languages would use them.
Programming languages on top of the JVM would not use that? Who said that?
Perfect example of the Curse, thank you.