5 ms·
Programming languages are user interfaces. The syntax of a programming language is part of that user interface. Some choices are poor by virtually any measure (
by RodgerTheGreat 3y ago
Programming languages are user interfaces. The syntax of a programming language is part of that user interface. Some choices are poor by virtually any measure (stropped keywords come to mind; as visually hideous as they are unpleasant to type), but most choices represent tradeoffs that favor certain usage patterns over others.
Lisp de-prioritizes legibility at a glance and concision in order to give maximum priority to simplicity in metaprogramming. I'm not convinced this is a good tradeoff; I would no sooner choose to drive to work in an amphibious tank that got 0.2 miles per gallon to be able to cut across a single river along the way.
Lispers say that I could use specialized tooling to compensate for poor ergonomics, but in many contexts- someone else's computer, a text box or static text on a website, a general-purpose textual diff or search tool, print in a book, a whiteboard- these affordances are not available, and I would still have to contend with the inconvenient reality of Lisp's very real design choices.
- thaumasiotes 3y ago> stropped keywords come to mind; as visually hideous as they are unpleasant to type It's pretty common today for people to voluntarily put SQL keywords in all caps. > Lisp de-prioritizes [...] concision Really?
- RodgerTheGreat 3y agoBy the standards of a K programmer, Lisp is quite verbose and excessively nested.
- trealira 3y ago> Really? Yeah, Lisp can be verbose due to the lack of built-in syntax for things other than lists. Take the Common Lisp syntax/library functions (there's not really built-in syntax) for hash tables: https://cl-cookbook.sourceforge.net/hashes.html https://cl-cookbook.sourceforge.net/hashes.html Compare it with Python dictionary syntax: https://developers.google.com/edu/python/dict-files https://developers.google.com/edu/python/dict-files Almost everything that's built-in to other languages has to be given a name that makes sense in Lisp. It makes it more readable in some ways, but also more verbose.
- NikkiA 3y agoalists and plists are a much closer lisp analog to python's dicts though
- deleted 3y ago[deleted]
- trealira 3y agoThat's fair. Dictionary literals aren't really any more concise than a-lists. A-list: (("the" . 50) ("be" . 25)) Dictionary literal: {"the": 50, "be": 25 }
- RodgerTheGreat 3y agoUsing both a-lists and p-lists as mere structural conventions- and thus needing to convert back and forth or write multiple versions of routines to handle each- is a good example of how sexprs provide a superficial veneer of simplicity while inviting cancerous complexity in practice. The Clojure approach of recognizing associative structures as a fundamental building-block and giving them specialized syntax: {:the 50 :be 25} Is a clear-cut improvement.
- NikkiA 3y agoAt the risk of waking Naggum's ghost, plists are performant enough to use everywhere, and an alist can be converted to a plist merely by flattening it. I do covet the way clojure's associations are callable as a lookup method, though.
- vindarel 3y agoPlease use the newer Cookbook! https://lispcookbook.github.io/cl-cookbook/data-structures.html#hash-table https://lispcookbook.github.io/cl-cookbook/data-structures.h... For a short hash-table notation, I now use Serapeum's dict: (dict :a 1 :b 2) and that's it, you now have a hash-table (with a representation than can also be read back in by the lisp reader).
- 3y ago
- kqr 3y ago> Lispers say that I could use specialized tooling to compensate for poor ergonomics Well, in input- and tooling constrained environments I have preferred Lisp for its syntactic simplicity. I wouldn't call it poor ergonomics.
- whartung 3y agoI find coding in Lisp to be very comfortable. If I ever decided to pull the trigger and swap [] for (), it would remove a large portion of the "chording" that happens with coding. And I by "chording" I refer to the shift key. I love kebab-case-its-so-easy-to-type. May as well be spaces. You can pretty much do everything with 26 lower case characters, the -, space bar, and (). What's that, 30 characters? I have 46 unshifted keys I can use, plus the spacebar. So thats 16 more keys for the more common symbols. Just gotta remap the keyboard a bit. Recall early Lisp actually used things like (plus ...) and (minus ...). Not have to chord is a real benefit, to me, when it comes to typing. Lisp just flows that way. For me my-class I find a lot easier than either MyClass, or my_class.
- KingMob 3y ago> Lisp de-prioritizes legibility at a glance and concision in order to give maximum priority to simplicity in metaprogramming. I'd need to see a source for this claim to believe that S-exprs are primarily for the benefit of metaprogramming. They have a lot of ancillary benefits in terms of uniformity, simplicity, and scope. Plus, learning paredit gives a lot of power at the keyboard, and you can't build an editing setup without something like S-exprs (or angle bracket equivalents like XML/HTML).
- lispm 3y ago> Programming languages are user interfaces. Lisp is optimized for interactive programming user interfaces. There is a lot of tooling around that.