5 ms·
LISP is weird - I used it a lot in the late 80s and enjoyed it a lot but then moved on and, looking back, never missed it. I think it has a hypnotizing effect o
by zwieback 7y ago
LISP is weird - I used it a lot in the late 80s and enjoyed it a lot but then moved on and, looking back, never missed it. I think it has a hypnotizing effect on programmers brains, feeding the endorphin feedback cycle, but ultimately there are just too many damn parens.
- svnpenn 7y agoI think it depends on the style. For example, I find this pretty readable: https://fodor.org/blog/webassembly-hello-world https://fodor.org/blog/webassembly-hello-world but for some reason the typical Lisp style looks like Python where someone vomited parentheses on it. Not sure why people choose to style it like that.
- earenndil 7y agoThat's not actually lisp. It's just s-expression notation for webassembly.
- porknubbins 7y agoI always got a rush from solving problems in LISP but then realized I could much more easily solve the problem in an imperative language without the baggage of thinking through multiple levels of recursion wrapped into a function. If that feeling of accomplishment is because you’re succeeding at doing something clever I question the utility of the language. Maybe just down to what I’m used to.
- leetrout 7y agoI don’t hear a lot of fans of FP and friends admit this very often. I think there are a lot of great uses of the patterns that come out of s-expressions, for example, but I would still choose Go, Python or JS / TypeScript as my daily driver.
- flavio81 7y ago>I think there are a lot of great uses of the patterns that come out of s-expressions, for example, but I would still choose Go, Python or JS / TypeScript as my daily driver. There's no God.
- dustingetz 7y agoClojurist here I rarely write explicit recursion it’s almost always encapsulated in reduce which is also idiomatic these years in javascript... but the big win with Clojure is first class immutability without category theory
- flavio81 7y ago>I always got a rush from solving problems in LISP but then realized I could much more easily solve the problem in an imperative language I've good news for you: Lisp is an imperative language. http://www.gigamonkeys.com/book/loop-for-black-belts.html http://www.gigamonkeys.com/book/loop-for-black-belts.html
- justinmk 7y agoJava, C++, etc. has the same number of parens, they are just placed differently.
- edflsafoiewq 7y agoNot really. It's true if you compare, like f(x) to (f x), but in general Lisp really does have more. // 3 brackets float diff(vec3 v1, vec3 v2) { float dx = v1.x - v2.x; float dy = v1.y - v2.y; float dz = v1.z - v2.z; return sqrt(dx*dx + dy*dy + dz*dz); } ;; 18 brackets (def (diff v1 v2) (let (dx (- (x v1) (x v2)) dy (- (y v1) (y v2)) dz (- (z v1) (z v2))) (sqrt (+ (* dx dx) (* dy dy) (* dz dz)))))
- schpaencoder 7y agoWhat about operator precedence?
- memling 7y ago> Not really. It's true if you compare, like f(x) to (f x), but in general Lisp really does have more. In general I think this is true, but an important caveat that your post brings up is that sometimes it also has to do with how we translate one language to another. Consider treating a 3-tuple as a list, and assume you have the primitive functions zip, square, sum, and sub (inverse of summing a list). Then the idea of the distance between two points reduces to: (defun dist (v1 v2) (sqrt (sum (map sq (map sub (zip v1 v2)))))) Of course there really are more parentheses here than in the C snippet you wrote, and it's arguably harder to understand, especially if you're unfamiliar with functional programming; it could be slower, too, and careless use of the zip function truncates at the shortest array. (I'm sure there are other objections I haven't anticipated.) At the same time, if you want to generalize the C function to arbitrary vectors, you'll have to do a little more work with passing arrays, checking bounds, adding a loop. The Lisp function, by contrast, requires no such effort, and once the concept is understood requires little further explanation. Even so, the point is that line-for-line translations may not always capture idiomatic usage of the language, which may in turn make it look or feel worse than it really is.
- billsix 7y agoThe density of parentheses is high, but the number of parentheses is small, relatively.
- thom 7y agoIn exchange for parens, you never ever have to worry about any _other_ syntax though. I always find this argument baffling. Every new version of most languages, there's new syntax to learn. New arrangements of keywords and glyphs to do stuff that is always and forever going to be (new-thing ...) in a lisp.
- smabie 7y agoThe loop CL macro would like to have a word with you. Moreover, there’s also reader macros that you have to worry about. Macros in general can have whatever syntax the author chooses. No one actually writes lisp code that is truly homoiconic for one simple reason: being constrained to a completely regular syntax is kind of annoying.