3 ms·
I think the point was that many people talk breathlessly about Lisp but are often quite hand-wavey about specifics. When this concern has come up before I've se
by smcl 6y ago
I think the point was that many people talk breathlessly about Lisp but are often quite hand-wavey about specifics. When this concern has come up before I've seen them dismissed with comments along the lines of "if you have to ask you won't get it" or "just read SICP".
I've written and read a bunch of lisp and I'm slowly working my way through SICP at a leisurely pace, but I totally understand what these OP means. Some talk about lisp as something magical (it appears on xkcd as a sort of "god's programming language" - https://xkcd.com/224 https://xkcd.com/224) yet often seem cagey about actually sharing exactly why they think so. A great example of what I mean is this pretty famous essay by pg: http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html.
In fact he says "Lisp is so great not because of some magic quality visible only to devotees, but because it is simply the most powerful language available" - which seems to dispel the "magic" bit ... but then throws out the tantalising "most powerful language" without (in my opinion) giving a compelling argument. He mentions how lisp macros are more powerful than those in C and does say "Lisp code is made out of Lisp data objects" and a few other bits and pieces about how it was higher-level than other popular languages at the time (the mid-1990s). It certainly made me curious to explore the language, but definitely left me with unanswered questions.
My opinion is that this phenomenon is a result of a number of things, including:
1. some people went through a transformative experience through learning lisp, and are deliberately vague to entice others into exploring it without ruining some of the fun of self-discovery
2. some people had the same, but think that it's enough to declare these things and don't care if you believe them or not
3. some people parrot what they have read some smart folks say and simply can't formulate a good explanation even if they wanted to
- sjamaan 6y agoI suppose it's a bit of 1 or 2 or 3. But there's also the issue that emergent properties which fall out of the overall design are quite hard to explain, and even advanced students of the subject don't fully grok yet. For example, "code is data" is true in the most trivial sense for machine code, yet having code as structured data makes it much easier to manipulate. Having easy to manipulate code gives you the power to manipulate code at compile-time. Having code run at compile time inside the compiler, which is also an interpreter running the same language that you are compiling is kind of magical and mind-bending. In fact, more recent research into this has gone down the rabbit hole even deeper, and it turns out you can have an entire tower of meta-levels (see for example http://www.phyast.pitt.edu/~micheles/scheme/scheme22.html http://www.phyast.pitt.edu/~micheles/scheme/scheme22.html). This is all continuing on the same basic ideas which were present in early Lisps, just crystallized and refined further and further. Also, as research into macros has gone on over the years, hygienic macros were discovered, which Rust has adopted as well (and there are other languages which have them as an add-on, like Sweet.js). Deeply understanding how this stuff works gives you a better grip on the issues with macros in older languages (notably C). And that's just macros (and homoiconicity). There's also lexical versus dynamic scoping. This is a lot less "magical" now than it was 10 years ago, when almost no mainstream language even had closures.
- sjamaan 6y agoAnd, oh yeah, grokking continuations makes it a lot clearer how generators, iterators, exceptions and coroutines work. One concept which subsumes all the others. And if you want to get into compiler construction, understanding CPS conversion makes it much easier to do code transformations. There's just tons of research which went into Lisps, because it's such a nice vehicle for language experimentation. There's half a century of research going into Lisps. Other languages haven't been around for that long, so I suppose there's something to find in Lisp history for everyone, but it might not be the same thing for everyone!
- AnimalMuppet 6y agoAre Rust macros at all comparable to Lisp macros? Can you re-write the syntax of Rust with Rust macros? Or are they more like C/C++ macros?
- steveklabnik 6y ago> Are Rust macros at all comparable to Lisp macros? There are two major kinds of macros in Rust. One of them, macro_rules, is vaguely similar to Lisp macros. It was partially designed and implemented by some big Racket fans, in my understanding. > Can you re-write the syntax of Rust with Rust macros? Within limits. > Or are they more like C/C++ macros? Neither kind of Rust macros are like C or C++'s macros.
- yomly 6y agoSICP is hard but remarkably complete. If you are vaguely familiar with the maths that is chosen as the domain then you can mostly begin the course from scratch. It starts with some really simple stuff like (+ 2 2) Then introduces some concepts like recursion along the way. Next you get data structures and recursive data structures before they pull off the greatest recursive magic trick to show that your code is data itself. Along the way you get a pretty accessible intro to functional programming without having to get bogged down in types, proofs and monads because Scheme is actually imperative. With my teacher hat on, this is a masterwork for pulling together so many concepts into one (relatively) tiny standalone course. With my student hat on it is profound on so many levels. I learn something new each time, even if only to appreciate names like Church and Curry being namedropped as bits of history because I'm not thinking a million miles an hour to process all the new information. The passion Sussman and Abelson bring the the course is authentic, endearing and unfakeable - you know they really felt it. In terms of what you do day in day out, SICP would be my go to for covering most the fundamentals of "computational thinking". You learn how basic algorithms and space/time complexity, recursion and iteration, functions and objects, data structures and finally program language construction (with some teeny peaks at the machine itself). And I was able to learn all this without a computer - using just pen and paper because Scheme is so simple. This freed me up from the distraction of trying to make a computer do something and actually using my mind to reason. As someone who did not do a CS degree there are not many other resources that are that high up for grounding you in all those subjects to get you ready for the job or put you on the path for further reading. Homoiconicity itself is such a mind bendingly pleasing thing to encounter the first time round, the only thing that came close was the stack machine - presumably because the list and the stack encapsulate something primitive to computation and language. I remember the first time the penny dropped when I realized that the cons operator for a list was also the spread operator for arguments in a function signature and thinking whoaaaaa
- smcl 6y agoI’m not having trouble with SICP and do not doubt it’s efficacy as a teaching tool. Take another look at my comment - I’m saying people are often very vague when describing why they find Lisp so mind expanding, and this can be a real puzzler for the “uninitiated”