4 ms·
"Lisp is a syntactically extensible language, meaning that it is quite easy, using macros, to create arbitrary language extensions, so long as they obey two bas
by JohnDeHope 4y ago
"Lisp is a syntactically extensible language, meaning that it is quite easy, using macros, to create arbitrary language extensions, so long as they obey two basic rules: (1) A new statement must look like (op ...), where "..." has balanced parentheses; (2) the lexical conventions inside the new statement must be Lisp's (e.g., more characters (including '*', '+', and such) are ordinary symbol constituents, in contrast to their role in other languages, so adjacent symbols must be separated by whitespace; double quote starts a string; single quote, sharpsign, and a few other characters have special meanings). If you're used to Lisp, these rules are barely noticeable, so that Lisp hackers come to think of it as having the most flexible syntax in the world."
I'm tired of reading about lisp, but I always do it. This gem is the sort of thing I'm after: an explanation of why (specifically) some folks just can't seem to give it up. I admit I still find the language incomprehensible. But at least I understand why others don't. It's a start.
- d3ckard 4y agoI would kill for the opportunity to work on Lisp full time (well, maybe not kill, but you get the level of motivation). The reason for it is in your quote - extremely regular syntax. No operators, no precedence, no special syntax forms - just a bunch of lists with symbols. I didn't realise how important it is until I started writing macros in Elixir and realised they are not quite "native", even if really powerful. Lisp will be back, I feel certain of it.
- ludston 4y agoYou can use reader macros to add any operators or special forms you want to Common Lisp. Things can get especially crazy if you use a reader-macro to override '(
- agumonkey 4y agoWhat surprises me is how lisp is such an obvious delight for some at first sight, while it's pure hell for most. There was no need for an explanation about beneficial syntactic reduction, extension and reuse it just massages a part of the brain that screams "Yes please".
- kazinator 4y agoI have a new unconfirmed hypothesis about this, which revolves around the darn parentheses. The specific shape of the parentheses matters. Say we have: (let ((s nil)) (dotimes (i 16) (setq s (rbt-insert (1+ i) s))) (pp s)) But say we replace the ( and ) glyphs with the ^ and $ shapes: ^let ^^s nil$$ ^dotimes ^i 16$ ^setq s ^rbt-insert ^1+ i$ s$$$ ^pp s$$ There is a night-and-day difference between those two, for you and me. Now imagine you have the hypothetical cognitive disorder which I have christened "dyslispia". Maybe to someone with dyslispia, there isn't much difference between these two; their brain doesn't process and "auto-complete" the enclosure hint of the shape of the parentheses. All they see is noise. Those people are helped by dimming the color or using some indentation-only notation. I also observe the curious effect that if we swap the shapes of the parentheses, I can still train myself to see the closure by rewiring my cognition to see the parentheses as pointing toward an interior in the convex direction: )let ))s nil(( )dotimes )i 16( )setq s )rbt-insert )1+ i( s((( )pp s(( Whatever the reason, this is not as bad as ^ and $. It helps if I imagine this in 3D, and pretend that the ))s nil(( is pushed into a pillow, sorta thing. If dyslispia is real, it's basically a form of dyslexias; it's fundamental brain wiring problem for which there is no cure. No amount of explanations about Lisp will fix it. In general, to enjoy working with Lisp, the raw experience as such, it probably helps to be well-sighted (no visual impairment), and no dyslispia-like cognitive impairment. My remarks here are mainly about those who report persistent difficulties with Lisp, but who do not mention any visual impairment.
- agumonkey 4y agoI've read that recently (maybe it was a previous comment of yours) and it's interesting that the geometry of a glyph matters. That said, a ( ... ) has a circularity that meshes well with the brain's notion of 'defined' 'finite' 'circled' 'closed' 'wrapped'. Which is often a desirable property. Any entity in lisp is simply enclosed. Any sequence is simply separated by space. Having syntactic genericity for generic trees is quite a free meal IMO.
- deleted 4y ago[deleted]