20 ms·
Running Lisp in Production (2020)
- ravi-delia 5y agoIt's cool to see an organization working with CL in production. I totally understand why more companies don't follow (and honestly I'm not sure I'd want to coexist in a CL codebase with more than a few programmers) but it's still encouraging.
- linkhem 5y ago> (and honestly I'm not sure I'd want to coexist in a CL codebase with more than a few programmers) What are your thoughts here? I’ve found lisps to be my favorite languages to read other people’s code in.
- threatofrain 5y agoPerhaps it's because of typing. Personally I find that structural insights on code from static analysis to be just as important if not more than local readability. I also generally find that it's the complexity of program strategy that impairs local readability more than syntax or style.
- reikonomusha 5y agoThis may help: https://github.com/coalton-lang/coalton https://github.com/coalton-lang/coalton
- brabel 5y agoCommon Lisp has type declarations and I think on a big code base, I would want to declare most if not all of my function types. And the types are not just for information: the compilers can and do optimise heavily if you ask for it with `(optimise 3)`! You can get nearly as fast as C.
- reikonomusha 5y agoWithout a library like Coalton, the type system built into Lisp is pretty limited. (It feels pretty similar to C's.) So you can't[1] declare types like "list of foo" or "function that takes any type and returns the same type". [1] There is something called a SATISFIES type which lets you turn any globally defined predicate function into a type, but I don't find that it's used widely in practice, because the compiler can't reason about it.
- wiz21c 5y agoNot sure if separating the language from its available libraries is really helpful...
- reikonomusha 5y agoIt is, because libraries like Coalton don't give you an expressive type system "for free", you also have to agree to write your code in a certain way. As such, it's completely reasonable for Lispers to opt out of using such opinionated libraries, and instead using only what's provided by the standard. If you do use a library like Coalton, then you get a type system pretty close to Haskell's.
- threatofrain 5y agoHey, do you use Coalton, and how mainstream would you say it is?
- gmfawcett 5y agoI'm fairly sure that their company created Coalton: https://coalton-lang.github.io/20211010-introducing-coalton/ https://coalton-lang.github.io/20211010-introducing-coalton/
- reikonomusha 5y agoIt's pretty new and not yet considered mainstream. But it's under active development and is used for real commercial projects.
- deleted 5y ago[deleted]
- medo-bear 5y agoyou don't need to run lisp in a large team. if you adopt lisp you only need 10 programmers to do what 100 will do in another language :)
- ducharmdev 5y agoI hear sentiments like this often with lisp, but if this were the case, why isn't everyone using lisp?
- mrcode007 5y agoLargely because of myths surrounding it, for example parenthesis syntax and lack of editor support. With paredit, you get meta level direct AST manipulation support in emacs that is still light years ahead of any programming IDE out there. I think the other fear factor is you have to think a lot more about how to approach the problem when writing Common Lisp and it requires a more complete engineer due to a smaller library ecosystem. Usually there is one and sometimes two libraries for doing X and if not you’re up for making a library yourself. I’m attaching an example of how quickly you can write TLS 1.3 by a single person in Common Lisp. At the time I wrote this library most websites still struggled with TLS 1.3 support. The point is that most software creators don’t have the breath and depth of knowledge required to be proficient in LISP if they only posses siloed domain knowledge. Links: https://github.com/mateuszb/tls1.3 https://github.com/mateuszb/tls1.3 If you want an example of expressivity you can take a look at EC crypto with a full NIST test vector set in about 300 lines of code https://github.com/mateuszb/tls1.3/blob/master/elliptic-curves.lisp https://github.com/mateuszb/tls1.3/blob/master/elliptic-curv...
- bmitc 5y ago> With paredit, you get meta level direct AST manipulation support in emacs that is still light years ahead of any programming IDE out there. Do you happen to know of a video or article with visual examples that demonstrates this? I always hear about these things with Common Lisp, but I have personally never seen it. I’d love to understand how this works or enables people.
- na85 5y agoI started a project in 2021 using CL. I'm solo, but I think if your team adhered to a style guide that (among other things) enforces use of Quicklisp or similar for managing dependencies, and puts strict^H^H^H^H^H^H draconian limits on when macros are acceptable, it would be no worse than many other languages.
- quickthrower2 5y agoMacros (and in other languages meta programming) should only be allowed when the writer is going to produce top notch documentation ^H write a oreilly-publish-worthy book on how the hell their thing works. With beginner tutorials! You write DSL, you write book!
- ravi-delia 5y agoI guess when I say I wouldn't want to work on a CL project with other programmers, it's more for their benefit than mine :)
- galaxyLogic 5y agoJust a thought: Writing micro-services might be of some help. Let each programmer write their own micro-service
- hardwaresofton 5y agoAdditionally limiting people to only writing own micro-services if all the platform guarantees (guard rails, really) are implemented is a good idea. If the platform-standard tooling still works -- expected logging libs, tracing, etc -- you can use what you like to do the actual work.
- DerArzt 5y agoAw yes, the hellscape that will exist when someone's pet micro-service losses it's creator as they leave for another org. They decided to write it in a language that nobody else on the team is familiar with, and now that decision has come home to roost.
- eatonphil 5y agoThis post has been around for almost 10 years now: https://news.ycombinator.com/from?site=grammarly.com https://news.ycombinator.com/from?site=grammarly.com. But I guess if they're still updating this post (it mentions November 2020) then they must still be using Common Lisp.
- pfdietz 5y agoOne of Common Lisp's strengths is great stability over time. If it ran in 2010 it very likely runs today as well.
- eatonphil 5y agoIt's not that I doubt Common Lisp but that I doubt the stability of an engineering organization (not that using the same tech stack forever is _necessarily_ the best thing). It's just so common for groups to switch stacks every 5 years.
- Brannon121 5y ago[dead]
- alberth 5y agoBuyer beware: Grammarly is effectively a keylogger. Think about that the next time you log into your bank account.
- User23 5y agoDiscord is also a keylogger. Edit: it literally asks for key logging permission on Mac OS.
- thorwawayrus53 5y agoIn the case of discord it stores the messages in its servers. So what is this news.
- emteycz 5y agoThe point is it has the permission, even outside the app, the entire time it's running (so all the time).
- alberth 5y agoI thought this was fake news? https://www.reddit.com/r/discordapp/comments/hdahy1/any_good_alternatives_to_discord_since_they_are/fvk65j6/ https://www.reddit.com/r/discordapp/comments/hdahy1/any_good... Is it true discord keylogs outside of its app?
- dgb23 5y agoI think their service is impressive but this is the reason I stopped registering (a few years back) when I read their privacy policy.
- victorbstan 5y ago
- speed_spread 5y ago
- fmakunbound 5y agoI love how a library just adds in a JSON literal syntax to the language and it's not even worth noting.
- bmitc 5y agoThis is done all the time in Elixir without fanfare, and you don’t even need to use a DSL. One just uses maps and lists that basically map one-to-one to JSON.
- fmakunbound 5y agoI have not looked at Elixir. It is possible for the user to extend its syntax?
- nesarkvechnep 5y agoYes.
- bmitc 5y agoYes, Elixir has macros.
- reikonomusha 5y agoThen you're not really adding syntax, just re-using existing syntax.
- bmitc 5y agoThat was my point, that you can have “literal” JSON in the language without special syntax, which is preferred since it can be processed with all the built in language functionality. By the way, Elixir does have macros.
- reikonomusha 5y agoUnderstood, but the fanfare is coming from the fact one can take a language without JSON, or SQL, or infix notation, or ..., and add it as a library. It means the language itself is flexible enough to support future paradigms and standards at the code level without a language redesign. I agree it's nice when something as common today as JSON is built in to a language. But for something like Common Lisp, whose roots are now nearly 40 years old, the fact it can easily support JSON literals is nothing short of amazing.
- deleted 5y ago[deleted]
- abc_lisper 5y agoAny reason why they haven't moved to Clojure. For one, Clojure has all the Java libraries at it's disposal.
- User23 5y agoClojure has many pleasant properties, but it’s painfully immature to a seasoned Lisp developer. That said, if I really wanted to use the JVM for business reasons, Clojure would be high on the list. Even so my gut instinct is ABCL. Edit: response to child: The most obvious thing is a lack of TCO. But there are plenty of other things like the limitations of a JVM based object system compared to the MOP. And then there’s the Lisp Machine heritage that shows through in forms like EVAl-WHEN. There’s the condition/restart system too. That’s just a few things off the top of my head. But in no way am I denigrating Clojure. It’s a good Lisp that meets important needs and I’d happily use it anytime it’s right tool.
- rfrey 5y agoAs an honest question from one who learned clojure but never CL, could you expand?
- mikelevins 5y agoI like Clojure okay, but it lacks the deep support for highly-interactive programming that I prefer. I've written fairly extensively about that subject in other posts and elsewhere. To be fair, that kind of support is hard to come by outside Common Lisp and Smalltalk. I miss Common Lisp when working in Clojure, but not vice versa. Clojurescript with figwheel is a pretty nice, pretty interactive way to develop web apps, though.
- sesm 5y agoI don’t think TCO is a big deal, Clojure has loop-recur when you need it
- lispm 5y ago
- exdsq 5y agoEvery couple months I get this huge urge to dive into Common Lisp and use it for work/study it/become a Lisper, but something comes up. I see this, have the same urge, and need to constrain myself from buying all the textbooks.
- quickthrower2 5y agoI did one of the basic tutorials out there and got to macros. In a terse few lines you get to a nice unit testing framework! It gave me a feel for why people live it. But yeah I just need 5 years on an elite team who would take me under their wing, but I can’t afford to pay them!
- mark_l_watson 5y agoPlease help yourself to a free copy of my Common Lisp book (https://leanpub.com/lovinglisp https://leanpub.com/lovinglisp and set the price to free). There are better CL books that cover a broader spectrum of the language, but my book contains both tutorial info and some of my own CL projects. Some people have fun with it.
- exdsq 5y agoThank you, I will do!
- llamataboot 5y agoAnyone else get twitches of imposter syndrome when they read this and then think about the last things they had to debug in prod?
- reikonomusha 5y agoWe've also been using Lisp in production. It has gone wonderfully, and has allowed some of the most simultaneously maintainable, resilient, and efficient code I've seen in my career. It's also attractive differentiator to some programmers who don't want to drone away writing bulk-Java day-in and day-out. A key to running Lisp in production is to step away from thinking of it as a lone-wolf bionic-suit hacker language, and to invest in developing a style guide, code review guidelines, CI/CD, and a culture of training new programmers to write Lisp. I've found that you typically don't have to hire Lisp specialists. As long as you find good programmers, they pick up Lisp just fine in just a few short weeks. The sibling comments are right though: Lisp's reputation is unfortunately affected by so, so many myths that it actually stunts the ecosystem in certain ways. The most rampant myth these days is that (somehow) macros automatically imply doom of a codebase after a certain size or contributor count. Classic myths from decades ago, like "Lisp is interpreted and slow", still echo from time to time too. Lisp's extensive, half-century history is a strength but also clearly a (social) weakness. A lot of myths come from good-intentioned speculation of the supposed consequences of certain features or aspects of Lisp, and not from actual experience using it.
- zshrdlu 5y agoAs I like to say, Lisp's reputation precedes it more so than any other $TECH.
- peebz 5y agoThat's really interesting. Can I ask what you use it for and if you've come across any limitations or problems using Lisp?
- reikonomusha 5y agoFor building optimizing compilers for quantum computers. The biggest hurdle has been difficulties with deployment. Open-source Lisp implementations mostly[1] only let you build an executable, and not things like a C ABI-compatible shared library. Commercial Lisp implementations are a lot better in this regard. Even if your OK with building an executable, there are limited options in terms of "enterprise integration", especially in the arena of databases and RPC. Google only very recently released support for gRPC [2], for example, and it's not a first-class citizen in Google's gRPC offering. Most hobbyist Lisp hackers don't exactly care to build (and more importantly maintain) a bunch of open source stuff for enterprise use. [1] There is a Lisp implementation called "ECL" that compiles Lisp to C, but it's lacking in many other dimensions. [2] https://github.com/qitab/grpc https://github.com/qitab/grpc
- comonoid 5y agoI wonder why do developers use CCL. I haven't work with SBCL and Lisp in general for years, but Emacs + Slime + SBCL worked very good.
- jonathankoren 5y agoI’d like to get back into lisp, but I haven’t found an environment that is as good as the AllegroCL one I used use. Everything seems to fall apart when using the debugger, or doesn’t quite have eval-just this-selection. What’s been your experience with the debugger and integrated repl?
- reikonomusha 5y agoCCL was a hugely popular implementation for a long time. One of its main strengths was extremely fast compile times, and very predictable performance/assembly. The runtime also had a lot of nice configuration options. I think its usage has declined a bit since development of CCL has slowed down.
- blihp 5y agoIn addition to it being a historically popular implementation, from the MCL days, there was a period of time when SBCL was still pretty rough while CCL was mature and performant. They've swapped places IMO in the past decade or so partially due to the excellent work by the SBCL developers while CCL has been less active over the same timeframe.
- TurboHaskal 5y agoI switched from SBCL to CCL for some web services due to issues with the former's GC. Seeing how some developers greatly preferred the native Hemlock environment over Emacs, I made the switch globally without many issues. These days I use LispWorks, although I tend to separate GUI code from back-end code and make sure the latter is portable across implementations. Running tests on SBCL also catches some bugs at compile time which is nice.
- thorondor83 5y agoI used CCL recently at work. I needed to create a binary, copy it to a different machine and execute. SBCL binaries depend on a version of glibc that is not available in every Linux. Clozure CL binaries do not have that dependency, they are portable out of the box. Also, I think Clozure CL is more memory efficient than SBCL. I was running it on a low-memory cheap hosting.
- beermonster 5y ago“ Our Lisp services are conceptually a classical AI application that operates on huge piles of knowledge created by linguists and researchers. It’s mostly a CPU-bound program, and it is one of the biggest consumers of computing resources in our network.” So what I’d like to know, is would a modern “AI” approach (ML/DL) based on literature samples as input, as opposed to classical AI sitting atop an expert system/linguistic knowledge, fair any better if you were starting, say, Grammarly today? That said, I enjoyed the article and it’s nice to have an example of Lisp being used in prod. My only experience of it is from using elisp. What are the differences between elisp and lisp?
- reikonomusha 5y agoCommon Lisp is a compiled language that has a standard. Like many standardized languages, it has multiple free and commercial implementations. It has a pretty extensive object orientation system with multiple inheritance and multiple-dispatch methods.
- BlanketLogic 5y ago> What are the differences between elisp and lisp? common lisp is a general purpose programming language with a well specified language and standard library. Elisp is intricately tied to emacs. Notable differences are , till recently(?), elisp has only dynamic scoping for variables. Common lisp has, by default, lexical scoping for variables (while also allowing dynamic scoping). Common lisp has much better support for closures than elisp. Common lisp has very mature commercial and open source compilers that produce very efficient code.
- Kessler83 5y agoI love Common Lisp. But I don't think you can look at a list of features and decide if it's a good choice to use or if those features are now "covered" by more recent languages. Not all REPLs (for example) are born equal, and recent is rarely a good thing when picking a programming language. I don't always use Common Lisp, but when I do, I enjoy the combination, depth and maturity of many attractive features that have only recently been introduced elsewhere (like poweful macros or the ability to compile into a running program). Also, I think not knowing Lisp is in a way like not knowing any C. Regardless of what you use at work, there are huge parts of the literature and discussion about programming that are closed to you.
- Stevvo 5y agoLisp has been around since before you were born. If the majority of programmers as are still not comfortable with the language after that long, despite having learnt it in college, it suggests the language is fundamentally flawed. Imagine a blog post titled "Using C in production"; it sounds absurd.
- Jtsummers 5y agoThe majority of programmers did not learn Lisp in college. Most universities don't have it in their curriculum, and if they do the closest is usually a "programming language" course that gives 1-2 weeks of coverage for 5-15 languages.
- lispm 5y agoThat was different when I learned Lisp. Our CS intro courses were either Scheme + something else or even Common Lisp + Ada. Basically every CS student at the local university had exposure to either Scheme or Lisp then. There were a bunch of research projects that were mostly using Lisp: advanced chat systems, image processing, planning, diagnosis, route planning, music theory, ...
- Jtsummers 5y agoI'm not sure if that's supposed to be a counterargument or not. I mean, MIT taught SICP for over 20 years with Scheme before dropping it. So it may be true that a majority of MIT trained programmers learned a Lisp in college. But that's not the typical experience across universities, and I doubt it ever was the case that the majority of universities taught the majority of their CS students with a mandatory Lisp course (that is, a course beyond the survey-style course I mentioned before, which seems to be far more common course). Even top universities didn't require it. Georgia Tech, one of the top technical universities in the US, did something like a 2-year stint with a mandatory SICP course before dropping it in favor of Python (IIRC), and had no mandatory Lisp course besides that (though they did have a mandatory Smalltalk course at the time).
- mbrodersen 5y ago
- bruce343434 5y agoWhat makes Lisp so good?
- frockington1 5y agoIts programming in its purest form, lambda calculus
- Koshkin 5y agoYou are talking about Haskell.
- reikonomusha 5y agoThe lambda calculus "in its purest form" is not typed.
- Koshkin 5y agoCommon Lisp, at least, is also (dynamically) typed.
- reikonomusha 5y agoCommon Lisp, however, has a "top type" T which is a supertype of all types. So one can manipulate lambdas themselves as if they're untyped. Of course, I personally don't think programming in Lisp has much to do with wielding lambda calculus in any superlatively direct sense.
- oats 5y agoThere's a lot of different lisps out there, but in general: - simple syntax - extensible with macros that mesh well with the language - tend to be expression-oriented, which some people favor - usually have pleasant functional programming features - usually have well-thought-out semantics
- srcreigh 5y ago
- jksmith 5y agoOT: Allegro CL is still hanging in there as a commercial chain. Anybody use it?
- mikelevins 5y agoI use it in my day job. We use it to write sensing and machine-control systems to reason about the data from telemetry, neural nets, and machine-learning systems, to compute strategies for those components, to compile the strategies to native code, and to control and coordinate the component systems. We also use Python, MatLab, shell and bat scripts, C#, and C++. I work in all of them, but I use Common Lisp for whatever I can.
- Scarbutt 5y agoNot to mention the power of the Lisp approach to solving difficult problems This is why the majority don't see benefit in using it, 95% of devs are not solving difficult problems.
- mbrodersen 5y agoDo you have any examples of difficult problems being solved in Lisp that can’t be as easily solved in other languages?
- reikonomusha 5y agoAt least three quantum computing companies are using it to implement the control system and/or compiler tool chain for their quantum computers. This whole HN post is about an NLP system that seems hitherto unrivaled.
- Scarbutt 5y agoSome stuff requires herculean efforts or are just very painful to do without macros. Clojure's implementation of CSP, core.async is one example. Lisp macros empowers experienced users.
- wglb 5y agohttps://en.wikipedia.org/wiki/ITA_Software https://en.wikipedia.org/wiki/ITA_Software This problem is unlikely to be solved in any other language.
- Scarbutt 5y agoWe use SBCL for production deployment and CCL on most of the developers’ machines. One of the nice things about Lisp is that you have an option of choosing from several mature implementations with different strengths and weaknesses: In our case, we optimized for processing speed on the server and for compilation speed in the dev environment Wouldn't using the REPL during dev remedy the slow compilation issue?