7 ms·
Lisp as the Maxwell’s Equations of Software (2012)
- dang 6y agoIf curious see also 2015 https://news.ycombinator.com/item?id=9038505 https://news.ycombinator.com/item?id=9038505 Discussed at the time: https://news.ycombinator.com/item?id=3830867 https://news.ycombinator.com/item?id=3830867
- magicmouse 6y agoLISP has an insidious parenthetical notation, and is well known to be a "write only" language, where nobody but the author can understand large programs written in LISP. It is avoided commercially for this reason.
- juskrey 6y agoOr embraced by those who know how to cook this: it is very easy to spot adequate LISP coder and filter self-serving equilibrists. (I am full Clojure for many years)
- ramraj07 6y agoWhat about stuff like clojure?
- _bxg1 6y agoThose are pretty strong words. I wouldn't use Lisp for a project I expect to scale, but I can still appreciate it for its merits, including what it represents.
- zelly 6y agoAnd That's A Good Thing If Lisp were mainstream I'd probably see that as a red flag
- vincent-manis 6y agoThat's why GNU Emacs is written in C and Cobol. More seriously, I have seen a lot of badly written Lisp/Scheme, as much as in any other language. Lisp DOES scale quite well, if the code is well-designed.
- vincent-manis 6y agoBy the way, I'm well aware that there are pieces of GNU Emacs that are mazes of twisty passages, understood by very few people. That's to be expected of a decades-old program that has perhaps not experienced enough refactoring.
- lmm 6y agoEvery language scales well if the code is well-designed, almost by definition. The more salient question is how well large codebases written by mediocre programmers can be maintained by other mediocre programmers, because that's what any long-lived codebase will have to deal with.
- mmphosis 6y agoI agree, however, Greenspun's tenth rule: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. What are these amazing 'commercial' programs? And why are they so large? And, do they need to be so large? Does the entire team understand all the inner workings of the commercial program? The Lisp eval function is easier to read, understand, and modify than to start over and rewrite it from scratch. ( As for those brackets, well ... https://xkcd.com/859/ https://xkcd.com/859/ https://xkcd.com/541/ https://xkcd.com/541/ https://xkcd.com/297/ https://xkcd.com/297/
- lmm 6y ago> Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. Sure, because C and Fortran are extremely limited languages - no first-class functions, no sum types, pitiful error handling. In a world where language design was extremely-primitive, user-defined macros made sense. Once languages that offered standard ways of doing the constructs that most programs need were invented (i.e. ML in 1973), there were better alternatives. > The Lisp eval function is easier to read, understand, and modify than to start over and rewrite it from scratch. That's not actually true though. The definition in the link uses a bunch of obscure lisp-specific terminology and doesn't really gain anything from doing so. It genuinely is easier to reimplement it from scratch (perhaps with the help of a more neutral reference) than to understand the Lisp version.
- phoe-krk 6y agoSorry, but I strongly disagree. It's possible to write unreadable code in any language, and Lisp is readable once you've spent a basic amount of time with the language to get to know the forms and when your code is indented properly - see my blogpost at https://nl.movim.eu/?blog/phoe%40movim.eu/cd3577f6-fb1d-45f5-b881-7b9a68ee822e https://nl.movim.eu/?blog/phoe%40movim.eu/cd3577f6-fb1d-45f5... for that last one. Also, LISP is a language that's been dead since 1970s. Did you perhaps mean Lisp?
- iLemming 6y agoPeople who cannot read Lisp or find it difficult to scan Lisp code with their eyes, or those who try Lisp for the first time, usually approach it the same way as they've probably done many times with other programming languages. They stare at it and try to make sense of the code. However, that's not how Lispers usually read Lisp code. Lispers would connect to a REPL and start "dissecting" the code evaluating it piece by piece. Lisp is unlike many other PLs where you usually have to follow "write -> save -> lint|compile -> run -> check the results" routine, boils down to "write -> eval -> check the results". You can even say that coding in Lisp is dealing with a "living," "breathing" program, whereas in other PLs - your program is "dead" and comes to life only after it's compiled and ran. > It is avoided commercially for this reason. Lisp is being used today by Apple, Walmart, Cisco, Amazon, Netflix, and even NASA and many other companies. Huge banks and FinTech startups around the world actively using it. Clojure is the most popular programming language in its category of PLs with strong FP emphasis. It is more popular than Haskell, OCaml, Elm, Elixir, Purescript, and recently surpassed Scala. Not a single guru, CS veteran or renowned programmer ever complained about Lisp being hard to read, because they understand - if they know anything about programming at all, publicly saying shit like that would raise many eyebrows. But every single time someone mentions Lisp on HN, there will be at least one dyslisplexic, who has never developed enough patience or inner curiosity to learn it.
- Beldin 6y agoInterestingly, the 4 equations shown in the article are due to Oliver Heaviside [1]. Maxwell came up with 20 equations, which captured electromagnetism. But it was... rather unwieldy. Heaviside reformulated that into 4 equations. Basically, Maxwell managed the breakthrough and Heaviside cleaned up after him and made it palatable. Why is that interesting? Because it raises the question: is the analogy made in the article more akin to Maxwell (breakthrough, brilliant but close to unusable), or is it more akin to Heaviside (taking known concepts and making them usable in practice)? [1] https://en.m.wikipedia.org/wiki/Oliver_Heaviside https://en.m.wikipedia.org/wiki/Oliver_Heaviside
- nmyk 6y agoA somewhat related idea: the discovery that light is an electromagnetic wave falls right out of Maxwell's equations in a vacuum. Simply rearranging terms yields two wave equations in 3D - one for the electric field, and one for magnetic. The term in both wave equations representing the speed of propagation (i.e. the speed of light) is a constant. It depends only on the physical properties of the vacuum, which never change as far as we know. That means an observer traveling at any constant velocity with respect to light will always measure the speed of light to be the same. Maxwell died in 1879 at the age of 48. It is not only plausible but likely that he would have come up with special relativity had he lived a bit longer, and also likely that it would have been years before Einstein published his 1905 paper on the subject. So in addition to the Stigler's law [1] situation with Heaviside, the formulation of special relativity may have been more or less inevitable after all of Maxwell's laws were put in the same room together. Not that Einstein wasn't a once-in-a-generation talent, but the reality of how progress is made in science is often glossed over in favor of assigning glory to particular individuals. Even Maxwell's laws taken individually are named after different people, but together they all belong to Maxwell. I get that this practice is intended to be a convenient way to put a label on an abstract concept rather than a way to write history, but I still think it has an effect on how we think and talk about the history of science. https://en.wikipedia.org/wiki/Stigler%27s_law_of_eponymy https://en.wikipedia.org/wiki/Stigler%27s_law_of_eponymy
- ncmncm 6y agoThis keeps popping up, and it is no more persuasive the tenth time than the first. Universal Computation was demonstrated a long time before Lisp. Any Turing-complete language is universal, Lisp included. Church's lambda calculus is included, and Lisp is a notation for lambda calculus. So, you can write a Lisp interpreter in Lisp, and it's pretty compact because (surprise!) a Lisp Interpreter has a lot of support for the stuff you need to do to Interpret Lisp. There's nothing deeply meaningful about it beyond what you start out with from Church. It is much more impressive, and subtly meaningful, that a NAND gate is universal. You can build a machine that runs Lisp from nothing but NAND gates, and people have. There have even been commercially successful discrete-transistor mainframes made of practically nothing but NOR gates (plus core memory), which are identically universal. Transistors are therefore universal. But because their operation is described in analog terms, they don't quite fit the mathematical formalism. The universe doesn't care about that, so it allows us to build up Universal Computation out of analog transistors. The more transistors you put in, the more computation you can do in a second.
- UK-Al05 6y agoI think transistors are great for electrical side of computing. Lambda calculus and lisp for the abstract model.
- tr352 6y agoYou're speaking of functional completeness of boolean operators which I think is quite unrelated to theories of computation. For computation you need some notion of state, and while a circuit made of logic gates may possess some notion of state, a logic gate in itself does not. As for transistors being universal (whatever that means) if this is true then vacuum tubes, relays, pneumatic valves, etcetera are also universal.
- minerjoe 6y agoYay! A bunch of people that haven't programmed (much?) in Lisp t-ing off with a few that have, dragging out all the old tired arguments (LISP?!)!
- pjc50 6y agoI've said this before, but I've come to think of Lisp and Forth as the left-handed scissors of software: for 10% of the population they're significantly easier to use, to such an extent that it can feel like a revelation. The remaining 90% of the population tries it, finds it harder to use, and doesn't get why others are raving about it. This would be down to very fundamental differences in thinking and conceptualisation that are difficult or impossible to "just" teach over. It requires those arguing over "ease of use" to recognise that it's not a property of the tool itself, but a function of both the tool and the user and how well the tool fits the particular, individual, user.
- evdubs 6y agoWhat are the fundamental differences that are "difficult or impossible to 'just' teach over"? Looking at a language like Racket, you have classes and objects, (first class) functions, recursion, "for" iteration, threads, mutability, etc. Aren't these features found in plenty of languages? Anecdotally, there seems to be a dislike of Lisp just because of the parens-based syntax. Do you think the different syntax counts as being such a fundamental difference for 90% of developers? Is it really so bad to have to write: (define x 1) instead of let x = 1; That difference makes it "left-handed scissors"?
- afiori 6y agoThe syntax criticism is a red herring in my opinion. At least speaking personally from my opinion I see a lot of people claiming that lisp simple syntax and homoiconicity make it a simple language and in my opinion this misses completely the point of simplicity in a language. I am not claiming that lisp is complex, just that that argument is faulty.
- tromp 6y agoMost recently discussed about a month ago in the thread “Maxwell's equations of software” examined (2008) https://news.ycombinator.com/item?id=23321955 https://news.ycombinator.com/item?id=23321955
- amelius 6y agoMaybe it's just me but it seems silly to compare equations to Maxwell's equations just because Maxwell (or his peers) originally used the same number of equations. In the modern mathematical framework of differential geometry and tensor calculus, Maxwell's equations can be reduced to only a single equation. See e.g. [1]. Also, Maxwell's equations have the important property that they are linear. How would that work in the Lisp analogy? https://en.wikipedia.org/wiki/Maxwell%27s_equations#Alternative_formulations https://en.wikipedia.org/wiki/Maxwell%27s_equations#Alternat...
- vindarel 6y agoFYI CL might have more libraries than you think: https://github.com/CodyReichert/awesome-cl https://github.com/CodyReichert/awesome-cl just saying.