11 ms·
Something they don't tell you when you start learning lisp is the sense of calm it brings It's such a elegant thing, it ruins me for doing "professional" progr
by slifin 7y ago
Something they don't tell you when you start learning lisp is the sense of calm it brings
It's such a elegant thing, it ruins me for doing "professional" programming
- agumonkey 7y agofew other good languages have had that said about them: ml prolog apl forth they all 'ruin' your life by showing you everything's wrong about daily realities. oh, and smalltalk PS: if I missed some, tell me
- SaxonRobber 7y agoc
- pjmlp 7y agoHardly, "Allen: Oh, it was quite a while ago. I kind of stopped when C came out. That was a big blow. We were making so much good progress on optimizations and transformations. We were getting rid of just one nice problem after another. When C came out, at one of the SIGPLAN compiler conferences, there was a debate between Steve Johnson from Bell Labs, who was supporting C, and one of our people, Bill Harrison, who was working on a project that I had at that time supporting automatic optimization...The nubbin of the debate was Steve's defense of not having to build optimizers anymore because the programmer would take care of it. That it was really a programmer's issue.... Seibel: Do you think C is a reasonable language if they had restricted its use to operating-system kernels? Allen: Oh, yeah. That would have been fine. And, in fact, you need to have something like that, something where experts can really fine-tune without big bottlenecks because those are key problems to solve. By 1960, we had a long list of amazing languages: Lisp, APL, Fortran, COBOL, Algol 60. These are higher-level than C. We have seriously regressed, since C developed. C has destroyed our ability to advance the state of the art in automatic optimization, automatic parallelization, automatic mapping of a high-level language to the machine. This is one of the reasons compilers are ... basically not taught much anymore in the colleges and universities." -- Excerpted from: Peter Seibel. Coders at Work: Reflections on the Craft of Programming "A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to--they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980 language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law." -- C. A. R. Hoare, Turing award lecture in 1981,
- SaxonRobber 7y agoThere are only two kinds of languages: the ones people complain about and the ones nobody uses.
- hugi 7y agoThis sentence has been used to justify so much evil in the world.
- SaxonRobber 7y agoI know C++ is a vile, but Bjarne only had the best intentions. Cut him some slack!
- pjmlp 7y agoThere is a third one, the ones that cause billions of monetary losses in fixing security exploits. It was a big mistake from US government to have forbidden Bell Labs to be able to sell UNIX on its early days. C only got widespread because it had a free beer compiler and OS to back on.
- SaxonRobber 7y agoToo bad the other dinosaurs didn’t catch on until it was too late and they died. (Or became zombies)
- pjmlp 7y agoYou mean like all modern C compilers are actually written in C++? Or that C hardly has a place on Windows, ChromeOS, iOS, macOS, Fuschia, Android, beyond legacy Win32/POSIX APIs?
- AnimalMuppet 7y ago> C has destroyed our ability to advance the state of the art in automatic optimization, automatic parallelization, automatic mapping of a high-level language to the machine. So C caused everybody to get a lobotomy? C caused all the existing literature to disappear? How did C do any such thing as this quote is saying? The only way the quote makes any sense is if C made people to decide that automatic optimization, automatic parallelization, and automatic mapping of a high-level language to the machine were not actually the direction that we should be going in. I deeply suspect the "We're on the right path; all those others are fools who have been led into temptation" view of the history of computing. Just because of how comforting it is to those on the minority path, it is suspect.
- hhas01 7y agoC is not good. At least, not in the way parent means “good”. C is this brilliant awful crazy-successful hack, yak-shaved into existence just to bootstrap an entire brand new OS (UNIX) in record time; subsequently Peter-Principled into domains it really has no business being in (basically anything userland). This is why, fifty years on, we’re still fighting memory corruption and security holes and generally doing an awful job of parallel computation and everything else C is not very good at. Everyone should learn C, if only to understand where we’ve come from, where we are now, and where we should be trying to go in future. Languages like Lisp and Forth and Smalltalk are fundamentally different beasts to Algol’s descendents. Most developers, having being raised in a pure C/Algol culture, give no thought to the base complexity and limitations inherent in those languages; they just assume that is how computation is. What the Lisps do is reveal all that complexity and limitations to be artificial constructs, imposed by the designers of those languages, whether as convenience to implementation (as in C, where features like flow control statements map closely to underlying machine instructions) or simply because that’s what they’re already used to (c.f. 90s scripting languages like Python and JavaScript, born on the back of mature, ingrained C culture). .. Here’s a question to get you thinking: Why do Algol family languages have hardwired flow control statements? Not because that’s how programming needs to be, but because that’s how they’ve always done it. Often there’s some special-case behavior involved, e.g. deferred evaluation of operands, as in the case of conditional (`if`) statement bodies, and hard-wiring that particular special-case into the language guts is a quick way of addressing that need. Heck, even traditional Lisps (1 & 2) are guilty of hardwiring hackery (don’t let its uniform syntax fool you: Lisp is ridden with special forms, including conditionals). You have to go to something like John Schutt’s Kernel language to see that problem solved correctly, by extracting the special-case behavior (lazy evaluation) into a general, reusable feature. Schutt calls it “vau”, but it’s just a way to dictate how and when arguments should be evaluated at the language level, instead of baking that behavior into the language implementation where it can be neither modified nor reused. What’s the upshot? Well, first, you realize that 90% of what Algol languages treat as core features aren’t “core” at all. They can be pulled out, generalized, and expressed as plain old composable functions. Suddenly your “core language” collapses from something big and complicated, with dozens of special-case features baked in, each with its own special syntax and behavioral rules, down to something ridiculously simple: an evaluator, a mechanism for composing behaviors (functions with vau support), and maybe some primitive datatypes to get you started (although even those can be pushed out into libraries if you want), … and that’t it. It is the mother of all refactorings, and it reveals the simple truth. All those features and complexity the Algols had us believe were essential prerequisites to computation and programming… all gone, pushed out to external libraries which the user can freely import, modify, replace, or ignore as they need. Once you realize how small, simple, and elegant computation can (and should) be, you’ll wonder what the hell all that vast intricate pomp and ceremony is really for, and who it really serves. Programming languages are big and complicated not because that’s how they need to be but because nobody tries to make them small and simple. But as Tony Hoare said: “There are two methods in software design. One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.” So if a language already falls in the latter camp, then Dog only imagine all the software subsequently written in it! This is where C falls outwith its original purpose, and it’s telling that subsequent popular attempts to fix it have done so by adding even more complexity on top, e.g. C++, Java, Swift. (It’s only recently with the likes of Rust that trend has started to reverse, but Rust is still a Complex language compared to a Forth or a Smalltalk.) .. Now, there is a tendency in Lisp circles to rave about macros as if they’re the True Revelation, but they’re not. The revelation is when you realize you have the ability to reshape a language you are given into the language that you need; a language that precisely and concisely expresses the concepts and behaviors that are of interest and relevance to you in your particular problem space. Lispers describe this as “bottom-up programming”, but the term hardly does it justice. Find yourself writing “if not TEST do ACTION” a lot? Extract that out into your own first-class “unless TEST do ACTION” command and use that going forward. Want to evaluate commands non-sequentially according to your own [e.g. priority-based] rules? Done. Don’t want loops? Leave them out. When you write an “Algol” program, the language always controls how your program is evaluated. If you don’t like the way it does it, tough. When you write a “Lisp 3” program, you get to control how your program is evaluated. You aren’t stuck with a fixed language-level set of first-class flow control statements that may or may not meet your needs, plus a weak second-class user-level mechanism for kind of creating your own (C-style functions, with their inherent limitations). There’s only one level: everything is a first-class feature, whether it’s provided by the language or added by you. .. We often think of C as a “general-purpose language”, but I think this is wrong and unhelpful. We should really think of C as a DSL, one created specifically for bit-twiddling and crude algorithmic number crunching (which is what it’s good at). The true general-purpose languages are the meta-languages, because they have the power to be whatever we want them to be. Working in C, you always speak in C. In a “Lisp 3”, you can speak in any language you like; you just have to grow that initial minimalist foundation of key building blocks into the language you want, and then off you go. It is the difference between Algorithmic Thinking and Compositional Thinking. Yes, algorithmic thinking has achieved a lot in the last 50 years, but the software we’ve built that way has a lot of problems—safety, reliability, scalability, learnability, verifiability—that I strongly suspect are inherent to that approach. We really need to try compositional thinking to escape that trap, but we can’t even start to do that while the languages we commonly use (Algol family) are themselves fundamentally crap at compositionality. -- Lastly, I think Nile (https://news.ycombinator.com/item?id=19844088 https://news.ycombinator.com/item?id=19844088) requires an honorary mention in parent’s list; not because of the language itself but because of how it’s constructed: not only is it a composed language, but the language it’s written in is a composed language too. If that doesn’t melt your mind at the possibilities, nothing will!
- pjmlp 7y agoIf you want to see your life ruined, watch this deep dive into Mesa/Cedar environment. :) https://www.youtube.com/watch?v=z_dt7NG38V4 https://www.youtube.com/watch?v=z_dt7NG38V4 One of the first workstation OSes written in a memory safe systems programming languages, early 80's at Xerox PARC.
- TurboHaskal 7y agoCan we go back in time and kill UNIX?
- pjmlp 7y agoNo need to kill it per se, it would have been enough to allow Bell Labs to sell it at the same price as VMS, OS/360 and other competing mainframe OSes, instead of distributing its source code for symbolic price.
- maire 7y agoThe most that would have happened is Bell Labs would have shut down the clones. There were already Unix clones in 1979. I worked on Cromix at Cromemco before I worked on Mesa/XDE at Xerox. If I remember correctly nobody outside Xerox used Mesa or Cedar or any of the other amazing things at Xerox because Xerox never sold them. You must have worked at Xerox. I went to Apple after Xerox and programmed in C++ using a pretty bad development environment. I certainly missed Mesa's exception handling and development environment. Mesa was missing garbage collection as did C++ at the time.
- pjmlp 7y agoYeah, garbage collection came into Mesa via Cedar, with reference counting alongside a cycle collector, hence Mesa/Cedar, the replacement for XDE. Had UNIX been a commercial product from day one, there wouldn't be any clones to start with, as they were mostly bootstrapped by the free beer source code that was taken via backup tapes from Bell Labs into a couple of collaborating universities.
- goto11 7y agoI have seen this said about almost any non-mainstream language from Haskell to Perl. I think it comes down to these languages are mostly used by enthusiasts on their own projects, without the daily realities of evolving business requirements and a legacy code base built by mediocre developers.
- _bxg1 7y agoI think there's a lot of truth to this bias
- deckard1 7y agoPerl has never been non-mainstream. It's possible the average age of HN is too young to be aware of this today, but Perl powered the web during the 1990s and early 2000s. There are plenty of legacy Perl code bases out there, even ones that have nothing to do with the web (think data munging and ETL).
- pjmlp 7y agoI met some of a couple of times, rewriting production Perl and bash scripts into Groovy and Java, shortly after being assigned maintenance roles for them, because "it is better" (aka "I have no idea and only know Java").
- draegtun 7y agoI would add Rebol & Erlang.
- namelosw 7y agoThis effect is real for some people, despite a lot of people don't like it. It's like some post-war syndromes where people feel the hollowness and pointlessness when seeing other people living a normal, meaningful life, or have to go back to the village from large cities. It's like a red pill, it always bugs me like "I wish I have macros here", or "type classes here", "Erlang process here", "Hindley-Millner or structural typing here"... Actually those languages are not that outstanding, however, it defeats the motivations to make small in-box-improvements like "I'm going to use some OO pattern to make this more SOLID". You can also try hard to slowly push the industry forward but it's still tens of years to be "professional" based on the history you have read, which sound very defeating for mortals, too. Imagine yourself has been throwback to an early 90s project where the mantra is still "if it ain't broke, don't fix it", and everyone endlessly patches everything while rejects new technologies because no one else is using them.
- krapp 7y agoSome people have a psychological or emotional reaction to code, similar to the way others do to poetry or prose, and sometimes the shape and structure of code gives people a sense of order and centeredness, in a similar way to OCD. The relative simplicity of Lisp compared to other languages probably makes these effects more acute. I don't know if that's necessarily a trait of the paradigm or of some of its adherents. I've felt that same calming effect but with other languages - and honestly I've found lisp code to be masochistically terse and opaque a lot of the time, although I've only messed with Arc and dabbled with Clojure and Racket. I guess that just means I haven't found enlightenment yet.
- deleted 7y ago[deleted]
- 3fe9a03ccd14ca5 7y ago> Some people have a psychological or emotional reaction to code, similar to the way others do to poetry or prose, and sometimes the shape and structure of code gives people a sense of order and centeredness, in a similar way to OCD. The relative simplicity of Lisp compared to other languages probably makes these effects more acute. I would really dislike to work with such people in a professional setting. Can you imagine having PR with someone who thinks code should inspire an emotional response? You know what’s beautiful? Simple and effective things, even if you can’t fall in love with the way they look.
- oldlispfan 7y agoI fear this good feeling may be misleading Lisp fans into liking the language more than it deserves. Personally, I find that the more feverish I am, the more attractive I find Lisp. It’s one of the first signs that I am coming down with a cold.
- zackmorris 7y agoThis happened to me too. The more I learn about alternative programming methods, the more my brain constructs elegant solutions that completely go around the problem at hand, or even the conditions which led to the context of the problem. I've reached the point where I mainly do data-driven and declarative programming with low-code or no-code in spreadsheets or GUIs. I feel almost physical pain now when I have to write traditional imperative or object-oriented code, because 95% of it feels like a waste of time to me. As in, most of the effort expended by a programmer is in initial setup, remembering mutable state, poorly-architected class hierarchies/interfaces, and rapidly breaking dependencies that only last a few months at most now. Less than 5% of what I do is the "real work" of solving the actual problem. Not really sure where to go with this, but I found that getting away from programming for 6 months or so this last year has really helped my psyche.
- MrLeap 7y agoI remember in college, there was a point while learning scheme where I felt like a cracked through to another reality. I went from feeling like "eh I can finish this assignment" to "holy shit, I can build _anything_". I've never written lisp professionally, but every few years I try to get back to it to see if the feeling is still there -- only to get pulled away from the endeavor by life stuff before I can dig the same depth.