Starting learning scheme and that led me down a Lisp rabbit hole. This thing seems way more interesting than I’d thought
There’s some stuff that I’d definitely grasp faster if I could ask questions though.
Any lisp experts out there mind answering some?
-
Show this thread
-
-
Replying to @paulg
-It's been a while since most of your writing on Lisp. What do you think has changed? -at the end of http://www.paulgraham.com/avg.html , you had an interesting heuristic for determining the hacker culture of a company. Does it still hold? Any similar ones today?
2 replies 0 retweets 0 likes -
Replying to @SarvasvKulpati @paulg
Maybe this is blub paradox speaking, but lisp almost seems less surprising today than it would have 20 years ago- are languages catching up? As for the second question, I wonder if there's even a simple technical heuristic anymore, w.r.t. 'enterprise' v. startup languages
2 replies 0 retweets 0 likes -
Replying to @SarvasvKulpati @paulg
Nope. No other language has macros. They can’t.
2 replies 0 retweets 0 likes -
Replying to @theshawwn @paulg
woah, so since this-http://www.paulgraham.com/diff.html was written, 8. and 9. still are uniquely Lisp? Does that mean almost all the advantage of lisps today lies in macros? Interesting because it'll change how I think about code, but then no other language will compare, even 20 yrs later
2 replies 0 retweets 0 likes -
also assuming it will make a lot more sense when macros *really* click- I'm less than a few hours into lisp!
1 reply 0 retweets 0 likes -
Replying to @SarvasvKulpati @theshawwn
Think of macros as code generators. Generating code lets you do things you couldn't do with a function, because you have access to the arguments unevaluated. E.g. you can't write this as a function: (defmacro setnil (v) `(setf ,v nil))
1 reply 0 retweets 1 like -
Replying to @paulg @theshawwn
Hmm, wrapping my head around this. Could you achieve a lot of what macros could do with higher order functions? Macros would more efficient/clean though I suppose I'll work through ANSI common lisp tomorrow and hopefully get a better grasp, thank you for answering these Qs!
2 replies 0 retweets 1 like -
Replying to @SarvasvKulpati @theshawwn
You can't do anything that requires access to the unevaluated arguments with higher-order functions, and if you use a macro for something that doesn't require the unevaluated arguments, you're probably misusing macros, so basically no.
1 reply 0 retweets 4 likes
That is, however, a deliberately narrow interpretation of your question. You can use higher order functions to do kinds of things people do with macros, e.g. iterate. But the code would not be expressed in the same way, or do quite the same things.
-
-
Replying to @paulg @theshawwn
Skipped forward and this is *exactly* the thought I had I think I was expecting a big epiphany, when in fact their utility will probably slowly reveal itself through repeated implementationpic.twitter.com/hNCOO5adtZ
1 reply 0 retweets 0 likes -
Two essays you may like: https://stopa.io/post/229 ^ shows you macros with js examples https://stopa.io/post/265 ^ goes into the “code is data” nature, also with js examples
0 replies 0 retweets 1 like
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.