3 ms·
It's about specialization. In JSON brackets have dedicated meaning. In scheme it's () galore. And () doesn't give me any meaning of what's actually there. Not t
by rowanG077 3y ago
It's about specialization. In JSON brackets have dedicated meaning. In scheme it's () galore. And () doesn't give me any meaning of what's actually there. Not that JSON or the Nix language is perfect, or even good, but this point makes it a lot better then a Lisp for me.
Essentially quickly scanning over lisp code doesn't give me any inclination about the structure at all, which I think is very important. I admit I haven't written a ton of lisp so maybe that's the problem.
- gglitch 3y agoI read you. I think Guile's native syntax for keywords, though more explicit, probably makes it worse. I imagine this would be clearer for a non-Lisper? Valid CL, but not Guile without a configuration change. '(:firstName "John" :lastName "Smith" :isAlive t :age 27 :address (:streetAdddress "21 2nd Street" :city "New York" :state "NY" :postalCode "10021-3100") :phoneNumbers ((:type "home" :number "212 555-1234") (:type "office" :number "646 555 4597")) :children ("Catherine" "Thomas" "Trevor") :spouse nil) ...or, indented more like Wiki's JSON example: '( :firstName "John" :lastName "Smith" :isAlive t :age 27 :address ( :streetAdddress "21 2nd Street" :city "New York" :state "NY" :postalCode "10021-3100" ) :phoneNumbers ( ( :type "home" :number "212 555-1234" ) ( :type "office" :number "646 555 4597" ) ) :children ( "Catherine" "Thomas" "Trevor" ) :spouse nil )
- grumbel 3y agoThe core issue that you can't escape is that Scheme creates a lot of ambiguity between data and code, since both use the same syntax. There is nothing wrong with using plain s-expressions for data, quite the opposite, I find them quite nice to look at, no need for keywords here: (person (firstName "John") (lastName "Smith") (isAlive t) (age 27) (address (streetAdddress "21 2nd Street") (city "New York") (state "NY") (postalCode "10021-3100") ) ) But that's not something you can put in a Scheme file directly, you have to quote it and then you have to use quasiquotes, macros or other hacks to get parts of that data structure executable. It's also not even the proper way to do a name/value pairs in Scheme, which would be the alist of the form ((name . value) ...). In Nix you do not have any of those ambiguities {} is a set, [] is a list, 5+5 is an expression, a = 5; is an assignment. And you can freely mix them without all that quoting, so it's { a = 5 + 5; }, not `((a . ,(+ 5 5))) or (list (cons 'a (+ 5 5)))