Live data from Hacker News

The Lisp Curse (2017)

winestockwebdesign.com

21–30 of 93 posts

Re: The Lisp Curse (2017)

#21
post #18
post #7

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

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 sta…

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.

Re: The Lisp Curse (2017)

#22
post #2

> Real Hackers have also known, for a while, that C and C++ are not appropriate for most programs that don't need to do arbitrary bit-fiddling. Strongly disagree with this statement. I've read it so many places now that it has to be a meme. I actually wish I could use C++ on the web instead of this JS nightmare ecosystem. I don't understand where the idea comes from. I'm never "bit-fiddling" in C++ and almost never n…

I like working in C++, after a decade of working in Java, Python, Javascript and Clojure, I find working in C++ (which I learned before these other languages) to be quite fun and pleasant, at least with relatively modern C++.

I've been, on and off, working on a little toy game engine, for a few years. Its a mix of keeping up with C++ advancements, learning various concepts like physically based rendering, and just the fun of crafting a big project, with no constraints other than my time and ability, no deadlines, no expectation of releasing anything. Its cathartic and enjoyable. I really do enjoy it.

Last September, I got frustrated with something I was working on in a more serious capacity. It was some server software, it responded to HTTP requests, it accessed third party services over HTTP and Websockets, it talked to a Postgres database. Overall it was an event driven system that transformed data and generated actions that would be applied by talking to third party services. The "real" version was written in Clojure and it worked pretty well. I really like Clojure, so all good.

But because I was frustrated with some things about how it ran and the resources it took up, I wondered what it would be like if I developed a little lean-and-mean version in C++. So I gave it a try as a side project for a few weeks. I used doctest[1] for testing, immer[2] for Clojure-like immutable data structures, [3] lager for Elm-like application state and logic management, Crow[4] for my HTTP server, ASIO[5] and websocketpp[6] for Websockets, cpp-httplib[7] as a HTTP client and PGFE[8] for Postgres, amongst some other little utility libraries. I also wrote it in a Literate Programming style using Entangled[9], which helped me keep everything well documented and explained.

For the most part, it worked pretty well. Using immer and lager helped keep the logic safe and to the point. The application started and ran very quickly and used very little cpu or memory. However, as the complexity grew, especially when using template heavy libraries like lager, or dealing with complex things like ASIO, it became very frustrating to deal with errors. Template errors even on clang became incomprehensible and segmentation faults when something wasn't quite right became pretty hard to diagnose. I had neither of these problems working on my game engine, but both became issues on this experiment. After a few weeks, I gave up on it. I do think I could have made it work and definitely could go back and simplify some of the decisions I made to make it more manageable, but ultimately, it was more work than I had free time to dedicate to it.

So my experience was that, yes, you can write high level application logic for HTTP web backends in C++. You can even use tools like immer or lager to make it feel very functional-programming in style and make the application logic really clean. Its not hard to make it run efficiently both in terms of running time and memory usage, certainly when comparing to Clojure or Python. However, I found that over all, it just wasn't as easy or productive as either of those languages and I spent more time fighting the language deficiencies, even with modern C++, than I do when using Clojure or Python.

I think I would think very long and hard before seriously considering writing a web backend in C++. If I had the time, I'd love to retry the experiment but using Rust, to see how it compares.

[1] https://github.com/doctest/doctest

[2] https://github.com/arximboldi/immer

[3] https://github.com/arximboldi/lager

[4] https://github.com/CrowCpp/crow

[5] https://think-async.com/Asio/

[6] https://www.zaphoyd.com/projects/websocketpp/

[7] https://github.com/yhirose/cpp-httplib

[8] https://github.com/dmitigr/pgfe

[9] https://entangled.github.io/

Re: The Lisp Curse (2017)

#23
post #19
post #17

Earlier quoted context omitted.

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/

Re: The Lisp Curse (2017)

#24
post #7

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

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

Re: The Lisp Curse (2017)

#25
post #19

Earlier quoted context omitted.

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/

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.

Re: The Lisp Curse (2017)

#26
post #19

Earlier quoted context omitted.

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."

Re: The Lisp Curse (2017)

#27
post #6

OP posted despite the opening paragraph! > Update on October 6, 2017. N.B.: Please stop submitting this to Hacker News! Look at the Hacker News search results for this essay. Check out the note for the first entry: Come on, everyone! Let's beat the dead horse one more time! Past discussions https://hn.algolia.com/?query=The%20Lisp%20Curse&type=story&...

AFAIK it is common to repost a story here if there has been enough time since the last post since there can be new voices, opinions, etc since the last time it was posted. Dang sometimes posts a comment with links to previous discussions too.

Perhaps the author is confusing the norms with Reddit where in many subreddits reposts are often frowned upon.

Re: The Lisp Curse (2017)

#28
post #7

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

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.”

Re: The Lisp Curse (2017)

#29
post #3
post #2

> Real Hackers have also known, for a while, that C and C++ are not appropriate for most programs that don't need to do arbitrary bit-fiddling. Strongly disagree with this statement. I've read it so many places now that it has to be a meme. I actually wish I could use C++ on the web instead of this JS nightmare ecosystem. I don't understand where the idea comes from. I'm never "bit-fiddling" in C++ and almost never n…

Webassembly might be the solution to your problem

On the frontend. In a number of years. It's in its infancy. Instead of hacking a webpage to behave like software it actually will be software. So I'm pretty excited about the idea.

Re: The Lisp Curse (2017)

#30
post #14

I just wish more people understood that something being Turing Complete isn't a feature, it's a flaw.

How so?

Maybe the previous speaker means the "tragedy of Common Lisp", where (in my understanding of the problem) it was happened to became too much of clever developers which decided to add too much of clever things in main library which are required to be known for keep writing the compiler in same code style (I am not a real programmer but have a sympathy to that answer, please correct me for creating more precise answer).
Post reply on HN