by dreamcompiler · 5y ago · 0 comments
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.
One of my biggest pet peeves when working with Go, is the multitude of logging libraries with disparate interfaces. That can't be configured easily (if at all) or at a desired level of granularity by the end user.
One of the things the Java community got right is SLF4J for a standard interface.
This is exactly where I'm coming from. Maybe it is romantic, but I also find it pragmatic when I write code in Common Lisp.
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".)
> You’re expected to know how to program if you use lisp.
Why would they say this if they weren’t implying that NPM users can’t program?
> 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?
They don’t, not directly. But it’s the community for that language that makes and supports these things, and comparisons between these communities (and the libraries they share) is a fair area of analysis.
> Except for retries which I would have thought were much better integrated into CL then they could be in Java, given resumable conditions.
They could, but they have not to my knowledge. In my opinion the language’s capability is far less important than a community that values creating and maintaining these libraries.
(I also think functional programming aficionados drastically underrate how much Java has changed. There are still issues I personally whine about, but they’ve fixed a lot of warts since the 1.6 days)
Retries in particular are one of those things that seem obviously standalone, but are not. Having my retries automatically expose micrometer counters has been a godsend for monitoring. I’d like to see them automatically expose opentracing information too, which is an obvious area of opportunity for r4j.
> Is this a thing that something like asdf-system-connections would solve in Lisp?
The technical ability to make libraries auto-configure together is meaningless if the community doesn’t have the will to take regular advantage of it.
Frankly, Java the language is incredibly weak for this kind of stuff, yet the Java community is busy doing it anyways. I’ll remain unimpressed by interoperability improvements to CL so long as the culture of “roll your own libraries!” remains in place.
I'm pretty sure that numerous Quicklisp users can't program either, but Quicklisp is manually curated while NPM (AFAIK?) isn't so their code won't end up in Quicklisp.
> You tell me.
I'm not sure what there is to say. The ASDF extension in question allows you to write systems that get loaded when a specific combination of other systems gets loaded, so when there's some room for collaboration of multiple systems, all such code naturally belongs into that autoloaded system. It can assume the presence of all required systems and hook them up together. Is this something like what you're describing? Except for the "discovered Micrometer on my class path" part of course since you're not concerning yourself with any paths here (that feels a bit brittle to me) but the notion of doing something special when combining specific multiple libraries is supported on system loading level.
How do you think those Java libraries got made? Java has also long had a culture of roll your own libraries -- and you had to, because the base language and standard library were quite deficient. (That's a snarky point, admittedly, but there are a lot of libraries in various languages that are just built-in functions in Lisp or Python or whatever, and there's a scale of effort there between built-in functions, built-in standard library, etc. that influences the pressure to make and share libraries. Like, I once wanted to get an approximate fraction, like Python's fractional's Fraction.limit_denominator, but in JS I had to bring in Google's Long.js and then steal a hundred lines of code from Python's implementation and elsewhere. There might be a library now.)
Where Java won out was copying Perl et al. of having a centralized place anyone could upload open source, and then having armies of programmers forced to use it who inevitably end up making and sharing libraries and frameworks to make their lives better and eventually a desirable place to be for lots of things. J2EE and the JCP/JSRs were also masterclass social innovations to improve the ecosystem and take over enterprise and allow groups to agree on specifications if not implementations. Lisp's version of that is still absent. At best there's functionality that implementations add beyond the ANSI spec, and differences papered over with trivial-blah libraries, and occasionally some informal lobbying will get a feature implemented with the same protocol across each active implementation (package-local nicknames coming to mind as a recent one). Of course this situation isn't that different to a lot of other language ecosystems.
CL got quicklisp, much too late, but it's here now and provides a baseline experience to beat if someone wanted to try like has happened in Java with ant/maven/ivy/gradle/etc. CL is then just missing hordes of programmers, and is unlikely to get them without either big company backing, many more small companies using it (this seems to be the way it's slowly been improving in popularity in the last several years), or an unexpectedly popular application domain (perhaps with accompanying hardware) where using it and its tools provides the clear best-in-class experience, or even the only experience, good or not, as is the case for many things involving other languages.
The culture now seems to be "check quicklisp, if it's not there, roll your own, and share to quicklisp". Maybe some more effort needs to be made on "try to collaborate and improve if something is on quicklisp and not quite what you want but close" rather than making something brand new, but collaboration exists on quite a few projects, and Java has lots of overlapping libraries too, it's not that big a problem. If Lispers lost any of their "roll your own" enthusiasm, the logical endpoint when something's not in the quicklisp set is to give up and search for a library in another language. And if it doesn't exist there either? Your only option is to program it yourself or pay someone.
It really seems like you just want CL to get the libraries and tooling you expect from the Java world, especially stuff mostly used by big companies with big deployments. And that's totally fair, Java's a great ecosystem despite annoyances with the language (which a big IDE helps paper over). I just think painting the lack of an equivalent ecosystem as a consequence of "roll your own libraries!" culture is mistaken.
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.
I just imagine telling my boss I could do the job in a week in Python ... or I could use this amazing forgotten language that requires me to implement almost everything from scratch. But it will be totally worth it, some day, I swear!