13 ms·
The Tragedy of the Common Lisp: Why Large Languages Explode
- dang 7y agoRelated from 2015: https://news.ycombinator.com/item?id=9738866 https://news.ycombinator.com/item?id=9738866
- nonbirithm 7y agoI kind of wish there was a lisp with the "recompile on error and continue" feature of Common Lisp but without a massive standard library. A standalone SBCL program seems to be around 40MB at minimum. It feels like it would be doable if only CL wasn't designed with the kitchen sink included. Recently I've gotten into Janet[0] and really like the language, although I do miss CL's recompilation magic at times. It feels like a Lisp dialect with similar style to Lua: tables, coroutines, small language core, embeddable as a single C file, etc. [0] https://www.janet-lang.org https://www.janet-lang.org
- kazinator 7y agoYou might like TXR Lisp. https://www.nongnu.org/txr https://www.nongnu.org/txr
- lispm 7y agoSBCL's programs are 40MB because they contain all dev tools and the code is native code, which is also large. There are a bunch of Common Lisp implementations which are smaller (CLISP), can create small applications (Lispworks), can be embedded (ECL) or can compile to smallish C code (mocl).
- sansnomme 7y agoAlso, Common Lisp's standard library cannot compare to Python, Java etc. They have a lot of language manipulation tools but not actually anything that will help you ship quickly if you are building generic CRUD style applications. CL tends to shine when it comes to extremely domain specific niche stuff where you practically have to write your own tooling from scratch.
- soiheard 7y agoRoswell comes to mind for application building and distro management. Add in ningle for web app building and woo for the server (the benchmarks are really good), and you're basically good to go. I think the main problem is there's too many implementations of the same thing in CL, so devs basically have to agree on a very specific subset of tools for every project, which adds a fair bit of overhead. https://roswell.github.io/ https://roswell.github.io/ https://github.com/fukamachi/woo https://github.com/fukamachi/woo https://github.com/fukamachi/ningle https://github.com/fukamachi/ningle p.s. Not the author, but a big fan.
- sansnomme 7y agoLast I tried it's not reliable. E.g. generating binaries through VM images is coin toss.
- xenophonf 7y agoJust clang on my system is around 80MB, so when you consider that an SBCL image includes a compiler, a linker, and a loader—and if you have Quicklisp installed, a build system and a package manager—40MB starts to look like a bargain! I personally wonder if CL's "computer program as an image" instead of the Unix process-oriented architecture will see a comeback in this modern era of virtualization and rump kernels and containers. In theory a Docker image for an SBCL program would be just the Lisp image itself plus the small handful of standard POSIX libraries on which the Linux version of SBCL depends (e.g., libc, libm, libpthread, etc.)
- FPGAhacker 7y agoYou might find Fennel interesting: https://github.com/bakpakin/Fennel https://github.com/bakpakin/Fennel It's a lua based lisp. Technomancy of clojure fame has taken a shine to it and become a large contributor.
- mindB 7y agoIf it's the same project I'm thinking of, Janet is actually by the same developer as fennel. Janet was kind of his followup project to fennel.
- FPGAhacker 7y agoThat's interesting, you are right, same person.
- klipt 7y agoWhy not just use a smarter compiler/linker that trims out unused library code?
- gmfawcett 7y agoSome CL implementations do this ("tree shaking", as it is called). But some of the more popular open-source implementations (SBCL, Clozure CL) do not.
- darkpuma 7y agoIt can also be error prone. Analysising arbitrary lisp code to see which functions could conceivably ever be called isn't as trivial as it might first seems.
- dTal 7y agoCan you elaborate? It seems trivial - just scan every function call. Surely it's not possible to call a function without typing its name somewhere? (Obviously if there's funny business with 'eval' this won't work, but then it reduces to the halting problem in the general case so that's fine. Most programs don't use eval.)
- dmos62 7y ago> recompile on error and continue I'm not familiar with this. Anyone care to explain?
- Jtsummers 7y agohttps://malisper.me/debugging-lisp-part-1-recompilation/ https://malisper.me/debugging-lisp-part-1-recompilation/ That's a good example. When an error is signaled you're able to modify the program (via recompilation of functions, changing of values) and restart at a point you select. There are other things you can do, but this is a particularly powerful option.
- aidenn0 7y agoSBCL is so large because it's not particularly optimized for size. A stripped libecl.so is a couple of megabytes.
- e40 7y agoI just tested this in Allegro CL 10.1: with and w/o the compiler: 15MB and 11MB.
- gnaritas 7y agoLisp isn't a large language, it's a small language with a large library.
- ska 7y agoCommon lisp is large-ish at least.
- pfdietz 7y agoCommon Lisp is small enough that one person could write a reasonably complete test suite for it in his spare time.
- ska 7y agomaybe medium? Compare to scheme... this is why I said large-ish, not large. There are lot's of corners to get into in CL.
- deckard1 7y agoI'm not sure too many people could write a test suite for LOOP in his spare time. Never mind the rest of the trickier parts of the language such as MOP, CLOS, packages, conditions, restarts, etc. etc.
- pfdietz 7y agohttps://github.com/pfdietz/ansi-test https://github.com/pfdietz/ansi-test >.>
- zimpenfish 7y ago> in his spare time I don't wanna be -that guy- but ... github lists 5 contributors on that repo. "his" is doing a lot of work in your claim there.
- pfdietz 7y ago
- momokoko 7y ago> The Algol, Smalltalk, Pascal, and early Scheme languages were prized for being small and beautiful. But they did not achieve widespread adoption. Widely used languages need to apply to a wide range of use cases. For example the fat arrow(=>) class syntax that binds this. class Foo { bar = (baz) => { // do something } } For entry level JavaScript developers working in React, this made one of the most common hangups go away for them due to the automatic binding of `this`. But for a some other situations, that might end up an anti-pattern. That's always the issue with small, clean implementations. They work when they only apply to one domain. Once they need to be used for different things, they then need to add new features. It is no different for software, blenders, bicycles etc. Once something is used for multiple domains, it now needs to become larger and more complex. Its basically a rule of nature.
- protomyth 7y agoPascal was pretty popular. Turbo Pascal sold a lot of copies for good reasons.
- stcredzero 7y agoBut they did not achieve widespread adoption. That's always the issue with small, clean implementations. They work when they only apply to one domain. Sorry, but this is pure BS with regards to Smalltalk. I worked for a Smalltalk vendor for 5 years, then consulted in the language for several years after that. I had a front row seat to these issues. Having a small language does not make it suitable for only one domain. The primary reason for Smalltalk not achieving widespread adoption was due to a series of decisions which, in retrospect, were highly anti-adoption. It started with no operator precedence in the language design, which acted to alienate engineers and scientists. Then the industry went through a "we're the boutique language of the Fortune 500" phase with $5000 and $10000 per-seat licenses. It is no different for software, blenders, bicycles etc. Once something is used for multiple domains, it now needs to become larger and more complex. Its basically a rule of nature. That just doesn't work for software. The reason why Python is so popular with certain scientific communities isn't at all specific language features to support them. It's general utility plus specific libraries. The reason why Smalltalk got popular at one time in finance and energy trading didn't have anything to do with specific language features or libraries. It was purely rapid development! There is something which a small language can be prone to: fragmentation. It was so easy to roll your own Smalltalk. This, combined with a toothless language standard meant that the community got balkanized into multiple communities with incompatible code.
- threatofrain 7y ago> Once a language gets beyond a certain complexity — say LaTeX, Common Lisp, C++, PL/1, modern Java — the experience of programming in it is more like carving out a subset of features for one’s personal use out of what seems like an infinite sea of features, most of which we become resigned to never learning. This is how I felt about Racket, and I felt I had to do an opinionated pruning before I could use it for teaching, but the problem is that the docs don’t have such a boundary for learners so you feel tempted to rewrite the docs.
- gmfawcett 7y agoLast I checked, Racket literally has sublanguages defined for teaching and learning: "Beginning Student", "Beginning Student with List Abbreviations", etc. https://docs.racket-lang.org/htdp-langs/index.html https://docs.racket-lang.org/htdp-langs/index.html
- deleted 7y ago[deleted]
- sigzero 7y agoIndeed. You can even MAKE your own language with Racket to suite teaching needs.
- pgtan 7y agoOr you can rediscover LOGO, which is LISP to the bones: ? show (map [[x y] [output se :x sum :y #]] [a b c] [10 20 30]) [[a 11] [b 22] [c 33]]
- deleted 7y ago[deleted]
- threatofrain 7y agoI wouldn't call those sub-languages, I think they're rightly different languages (of eerie similarity) born from specific pedagogical or academic vision. So the upkeep in dealing with the mismatch between proper Racket and these student languages wasn't something I was interested in. Students should be able to consult general Racket resources.
- deleted 7y ago[deleted]
- callinyouin 7y agoI get that the article used Common Lisp to create the punny title and much of its contents are broadly about why its important to keep languages relatively small, but I'm sort of disappointed most of the language-specific talk was about JS. I'm in the middle of learning CL at the moment (I have a mostly Java, Python, C++ background, in that order of experience) and would be interested to hear from experienced Lispers on why some other Lisp would be a better choice at a language level (so not based on convenience, tooling, popularity, etc... okay, maybe tooling).
- Mikeb85 7y agoRacket seems to be favoured individuals who are using it to create a DSL or accomplish very specific tasks, but CL is definitely the most used Lisp (well, maybe apart from Clojure) to create 'big' applications.
- amelius 7y agoWhat exactly is the link with the tragedy of the commons? https://en.wikipedia.org/wiki/Tragedy_of_the_commons https://en.wikipedia.org/wiki/Tragedy_of_the_commons
- nerdponx 7y agoI think it's just a fun name. But maybe it's allegorical in that everyone "took what they wanted from the commons" (got their preferred features implemented), leaving the whole thing a mess (bloated language).
- btilly 7y agoThe word "Common" is a reference to the language Common Lisp: https://en.wikipedia.org/wiki/Common_Lisp https://en.wikipedia.org/wiki/Common_Lisp. No explicit link with the tragedy of the commons was implied. Implicitly, of course, it applies - there are many participants, each of which is aware of their own gain and unaware of how their actions cost everyone else. The result is that when they all get their changes in, the result is terrible for everyone. For another example, C++ is a terrible language, but it contains many good ones.
- amelius 7y ago> No explicit link with the tragedy of the commons was implied. Okay, but the article says: > Adapted from a 2015 es-discuss thread. “Common Lisp” is not the topic. It serves only as one of many illustrative counter-examples. So if "Common Lisp" is not the topic, and the tragedy of the commons is not the topic, then it seems the title is not very well chosen.
- btilly 7y agoAfter programming for 20 years, I've noticed that programmers are aware of the potential benefits of any abstraction that they have internalized, and blithely unaware of the costs. Because, having climbed that learning curve, it is now free to them. The result is that programmers introduce complexity lightly, and when they walk into a new language/organization/etc are inclined to add random abstractions that they are used to from past experience. And yes, I am not immune.
- darkpuma 7y ago> "After programming for 20 years, I've noticed that programmers are aware of the potential benefits of any abstraction that they have internalized, and blithely unaware of the costs." 'Lisp programmers know the value of everything and the cost of nothing.'
- braythwayt 7y agoUnderrated comment! Here’s the footnote: “Perlisisms: EPIGRAMS IN PROGRAMMING by Alan J. Perlis” http://www.cs.yale.edu/homes/perlis-alan/quotes.html http://www.cs.yale.edu/homes/perlis-alan/quotes.html
- azeirah 7y agoI wouldn't look at it that negatively. Programming is like speaking a language, I don't mean what programming language you "speak" (ie, c++, or java, or whatever), but how you're used to speaking in it. Like real language, you probably prefer certain idioms, you have your own style and you know certain words better than others. This is similar to how we program, we know certain algorithms, yet are oblivious to others, we have our favorite abstractions and have our etc. There are downsides to these habits for both spoken language and computer programming languages, no doubt, you can get stuck in a rabbit hole without seeing you're in one. In the end, a similar approach works for both, read and write widely if you want to be great at these, meet different groups, work on uncomfortable projects, you know the drill. Just like how you expand your language and therefore your world; socially.
- tempguy9999 7y ago
- mateuszf 7y agoIsn't c++ a large language? And yet it's still used.
- cjensen 7y agoSure. But there are a lot of areas where you just shrug and say "here be dragons" and move on. For example, consider the new for loop syntax for (auto item: a().b().c()) ... Does this make you nervous? It should. In the above, suppose a(), b(), and c() are all returning objects. Which of these objects remains valid until the end of the for loop? And this is a dragon in one of the most helpful parts of new C++.
- mateuszf 7y agoYeah, I'm not a big fan of the language, I'm only saying it's used a lot. Seems that in this case there was not a lot of portable fast alternatives for system / device / high performance programming.
- bluGill 7y agoC++ is only slightly larger than any other language if you subtract the standard libraries that make a language useful. If you add standard libraries C++ is a tiny language. C++ does have a lot of weird, inconsistent warts that make it tricky to learn/use everything. Which is why most people who advocate to use C++ talk about modern C++ which is C++ where you stay away from those warts.
- the_why_of_y 7y ago"C++ a tiny language" - just in case anybody is missing the obvious sarcasm, people who have done it say that implementing a C++ front end takes a decade of effort: https://news.ycombinator.com/item?id=17130870 https://news.ycombinator.com/item?id=17130870
- bluGill 7y agoThose two statements are not incompatible. C++ has a lot of tricky areas that are hard to get right. It is still a tiny language.
- kerkeslager 7y agoI feel like this is the real success of Python: the "one and preferably only one obvious way to do it" idea means that new ways of doing something are rarely added, and when new they are added, old ones are likely deprecated. Complain all you want about the 2 to 3 transition, but it's resulted in a simpler, easier-to-use language. If the community really feels a different way is better, they add it in libraries. My only criticism of Python in this respect is that they didn't take it far enough: Do we need higher-order functions AND loops? Do we need classes AND first-class closures? Common Lisp isn't even close to the most complicated language out there. Every
- opportune 7y agoI don't think this is really true of python, often the "correct" (pythonic, theoretically best performance) way to do something involves using more complicated language constructs than most people are familiar with. For example, when to use list/dict comprehensions, when to use reduce functions, when to use generators. Most beginner programmers and people coming from C-inspired languages will do things the "obvious" yet incorrect way by doing a for-loop of appends.
- m463 7y agoI think that python is in general more cohesive than other languages. I like that perl has both "if" and "unless", which is expressive, but it give multiple ways to do the same thing. I also think pythonic and theoretically best performance might not need to correlate. I would personally stick to for-loops for general but tricky code and leave things complications like nested comprehensions to places like the guts of libraries or classes that make the tradeoff to have simplified externals. (for example argparse - very nice externals, tricky tricky guts)
- a1369209993 7y ago> Complain all you want about the 2 to 3 transition Okay. > it's resulted in a simpler, easier-to-use language. Does `print(len("ẅ"))`[0] still produce a value (2) that is neither the number of characters (1) nor the number of bytes (3)? 0: "print\x28len\x28\x22\x77\xCC\x88\x22\x29\x29"
- lacker 7y agoThe Algol, Smalltalk, Pascal, and early Scheme languages were prized for being small and beautiful. Those languages are also not very popular at all today. Perhaps "small and beautiful" are not the right metrics to optimize programming languages for. In many ways, keeping the core JavaScript language small has led to the JavaScript ecosystem being too large and sprawling. For example, look at module importing, something which is a fairly normal part of most programming languages. It still works in a completely different way in Node.js and in browsers. I think if there had been a standard way to handle JavaScript imports years ago, the practical experience of working in JavaScript would be simpler today.
- cat199 7y ago> Those languages are also not very popular at all today. But yet, C (arguably 'current algol') and Python (arguably 'current scheme') are.. yes: python is verry loosely like scheme, this is meant in the sense of a 'dynamic loosely typed language you can interact with in a repl'
- darkpuma 7y ago> "dynamic loosely typed" Both Python and Scheme are dynamic but strongly typed.
- cat199 7y agoi'm going to disagree here. yes, they have strong core types, but there is nothing preventing you calling some function with completely invalid arguments.. even within the 'interpreted fp' world, there are better examples (e.g. ML family)
- dodobirdlord 7y agoI think you may be missing some terminology here. Strong typing is about whether entities have definite types and resist type coercion. Ad-hoc typing in dynamic languages can make this hard to see, but it's still there. What would prevent you from calling a function with invalid arguments would be static typing, which Python and Scheme do not have.
- dreamcompiler 7y agoThis comparison is inappropriate. When Common Lisp was standardized, the goal was to unify several different Lisp dialects, not to make the language "small." Furthermore, there was no standard library for Common Lisp. The language itself is its standard library. If anything, the language by itself is too small for a lot of modern applications. (The situation is different now; there are hundreds of libraries to fill in the missing pieces of Common Lisp. But they're not standardized like the core language is.)
- lispm 7y ago> the goal was to unify several different Lisp dialects the goal was to unify several similar Lisp dialects as a Maclisp successor
- carapace 7y agoAwesome to see Mark S. Miller on the front page. One of my favorite computer nerd jokes: Ted Nelson points out that Mark Miller's name is his vocation. :D Get it? He's a symbol grinder, a mark miller. I love it.
- didibus 7y agoAs an aside, I recently tried Common Lisp, and it's actually pretty good, you'd be surprised.
- didibus 7y agoI think the word Large is pretty ambiguous. In my opinion, it is more about incoherent, inconsistent, complected, and with no clear way to learn more about things you do not understand. A language which has everything I would need already available and ready to use, in a simple and straightforward way is pretty great otherwise.
- lerax 7y ago[hyperbolic] Common Lisp deserves more love. People are just too much jealous to admit that CL is one of the best language of the world. How someone can think that JavaScript, PHP, Java and other stuff alike are at least non-miserable in comparison with something so powerful as Common Lisp? [/hyperbolic] Keeping the humor-ish stuff aside, actually taking CL here as example it's someway ignorant. That's doesn't make any sense to me. Seems that all that opinion are based in nothing more that nothing when it concerns about Common Lisp literature experience and personal experience with the language. Some languages are popular, but they being popular doesn't proofs that they are good languages. This is a fact based on the type of problems most of the people are trying to solve. CL being big it's some way comparable to C++, but for big problems, sometimes we need complex tools. CL is not for kids, neither C++. Common Lisp it's a language for hackers.
- nydel 7y agomy neck aches from nods in agreement. i know i’ve written at leeaasst one #’TRAMADOL-SIMULATOR but i’ll likely just lambda the notion, slightly faster &or funner than grepping my filesystem for “\.l*sp$”.
- deleted 7y ago[deleted]
- qwerty456127 7y agoThe same happens to CPU instruction sets. Old stuff should get deprecated once better features are added (letting you write more concise and efficient code) but you can't deprecate that as it would break too much legacy code people rely on.