4 ms·
I can see why someone would learn Lisp as learning a different paradigm than what you are currently using helps you see thing in different ways and improves you
by DeathArrow 4y ago
I can see why someone would learn Lisp as learning a different paradigm than what you are currently using helps you see thing in different ways and improves your overall ability to solve problems.
What I miss is what classes of problems Lisp helps you to solve better and faster. Why use Lisp in production?
If you want functional programming there's ML, F#, Haskell and even Javascript. If you want to develop fast, there's Go, C#, Python and so on.
I am not trying to denigrate Lisp here or to say something is better, I am genuinely asking what advantages Lisp has, what are the cases for which is it best suited in production.
- lisper 4y agoBecause Lisp gives you all of these things. Functional programming. Fast development. Incremental compilation. Interactive debugging. But the main thing Lisp gives you is almost unlimited malleability. If there is ever anything in the language you don't like, you can change it. It also gives you generic functions and the ability to redefine classes in a live system. No other language has those features.
- DeathArrow 4y agoThanks. Malleability and redefining classes in running code sound like advantages. Can you point to a situation where you might want to redefine classes in live code?
- pjmlp 4y agoIn a game engine, you don't want to rebuild everything just to change a couple of details in the scene. Live++ and VC++ reload are quite far from what Lisp allows. Or to save a space ship, https://thenewstack.io/nasa-programmer-remembers-debugging-lisp-in-deep-space/ https://thenewstack.io/nasa-programmer-remembers-debugging-l...
- TurboHaskal 4y agoThose Smalltalk and Lisp programmers are again at tweaking their running instances in production. Couldn't they just let it crash and relaunch a new ship as is the best practice these days?
- lisper 4y agoAny time you are developing code with a lot of state. Being able to redefine classes on the fly makes the debug cycle much faster.
- samoit 4y agoI think smalltalk has the same image live system. Anyway I do prefer schemes overs lisps.
- cageface 4y agoI've been hearing similar arguments from lisp advocates for decades but lisp is still a tiny niche in the programming world. Is this because programmers are just slow to catch on to superior technology or because infinite malleability is not that helpful in actually building shipping software? A lot of important ideas originated in the lisp world that are now mainstream like garbage collection, functions as values etc. But I think there are good reasons that most of us don't use s-expression syntax at work.
- wiseowise 4y ago> But I think there are good reasons that most of us don't use s-expression syntax at work. Care to provide one?
- medo-bear 4y agoin general good does not equal popular. and i think its useless wishing that lisp is popular. if it happends so be it. but for "some" reason it keeps on living and people keep building important things with it
- chimprich 4y ago> lisp is still a tiny niche in the programming world You could look at this the other way and be impressed how much Lisps are still used despite being many decades old and all the pressures from other languages. > Is this because programmers are just slow to catch on to superior technology or because infinite malleability is not that helpful in actually building shipping software? I think a lot of it is momentum / fashion / network effect or whatever you want to call it. I've done some work with Lisp in the past and loved it, but I struggle to justify spending time on it. From a corporate level, if you decide to go with Lisp, then you are significantly limiting the pool of available engineers and libraries etc. you can choose from. Whereas if you go with Python then you get a language that is a bit less elegant but close enough in flexibility most of the time, plus a vast ecosystem of resources and expertise to draw from. On a personal level it's similar; Lisp isn't exactly a drawback on your CV, but there's an opportunity cost. There's usually something else to prioritise that will make you more attractive.
- dj_mc_merlin 4y ago
- pjmlp 4y agoWhile .NET and Java are the platforms that come closest to the dynamism of Lisp based environments, their code reloading is still not as flexible as on Lisp environments, specially Common Lisp. Also they are still catching up on the expressiveness of CLOS. Or the ability to code like in StarLisp, where the same Lisp code could run locally in a compute node, being distributed across the network, or some kind of compute accelarator (we are still dealing with plain old C and C++ alongside language extensions). Chapel and Julia are probably the closest to this experience currently. Finally very few tools combine the workflow of having a JIT based REPL, with the dynamism of Lisp for interactive development, while being able to AOT compile everything for a release delivery.
- dj_mc_merlin 4y agoThere are no other homoiconic languages with amazing REPL support. After writing Lisp there is just something wrong about how most languages have an additional step in order to generate the AST. Why? A tree is a simple structure and describes the shape of code well. I can just write it myself. There is no reason to add weird arbitrary requirements on how you have to present your source code text to the compiler -- just feed it the data structure representing it instead. Since your code is just a tree now you can also write macros that are just functions. No text substitution or preprocessor jank. This is an amazing simplification and just feels as if it is the way it should be.
- vegai_ 4y ago>After writing Lisp there is just something wrong about how most languages have an additional step in order to generate the AST. Why? Because it's possible to have a lot better representations of computer code for humans than AST.
- medo-bear 4y agosome people really do find lisp to be the optimum and i say this as someone who works a lot in python i see lisp as similar to (all?) slavic languages, in which spelling is a trivial affair
- eimrine 4y agoAs someone who learns Common Lisp and speaks 2 slavic languages, I consider your statement as surprisingly legit.
- deleted 4y ago[deleted]
- drewr 4y agoYou underestimate the cognitive burden of resolving syntactic ambiguity with non-lisp languages. So many problems disappear with s-expressions that when I return to a language with a "human" syntax I feel bad that I have to work harder.
- mordae 4y agoDomain specific languages. They always end up being hacks in Python and are almost impossible everywhere else. Numpy, various ORMs and so on. Since you get a built-in de-facto compiler (macro expander), implementation of such DSLs is pretty easy. Racket, for example, has pretty good support for pattern matching and error reporting during macro expansion, which makes the DSLs debuggable. Typed Racket has implemented a type-checked layer on top of the regular Racket with automatic unboxing of numeric types whenever they provably don't have to be boxed. You can mix typed and untyped code freely with contracts being inserted at the boundary. That means you can implement a busy loop in typed code with unboxed integers and only guard the inputs and outputs. The potential clearly is there.
- eimrine 4y ago> Why use Lisp in production? If you want functional programming there's ML(...) Maybe this language has a bad name but I can not find anything about it on HN. > what are the cases for which is it best suited in production. I'm not a professional programmer, but one of the best things about Common Lisp is that you can find code that was written decades ago and it still works without any changes. You may say that longevity is just a coincidence, but I believe that this is one of the proofs of the enormous power of this way of writing code. I would like to have a PC/Smartphone without having to change devices for the rest of my life (not expected to see that much progress in hardware anyway) and be able to install any old or new app. What a pity that the industry has chosen the method of planned obsolescence in both hardware and software.
- narimiran 4y ago> Maybe this language has a bad name but I can not find anything about it on HN. Try searching for Ocaml :)