Re: sweet-expressions instead of s-expressions?



Not to throw cold water on this impressive series of demos, these
aren't excellent but somewhat tangential to what I had in mind. Mark my
words: "Remember in thinking through this: Don't fight the syntax! If
you try to have both python dicts AND python syntax, you'll lose, and
you'll lose macros and you might as well go back to Python."

What you (both) have demonstrated is the power or reader macros in
defining new syntax, but I don't think that new syntax (in the sense of
reader macros) is either necessary nor particularly appropriate in the
context of the present discussion. I had mind mind something at the
same time hack-wise simpler, yet coneptually more complex: Not just
letter one type: {for bar baz frob} -- forget the braces etc. Rather,
what I had in mind (Neil puzzling through himself) was what the central
concept(s) is(are) of dictionaries and how, using standard Lisp macros,
one could get the >concepts<, not just the baces and brackets. Of
course, the concepts are almost already there (as I pointed out) in
Lisp (in the guise of hash tables, mostly), and I don't think that he
wants -- or shouldn't want -- what you have offered, which is the
syntax. Rather, he wants (or should want) hash-tables to be as
convenient as dictionaries. The only things really limiting this in
Lisp are the need to declare them, and the ability to use
comprehensions (i.e., slicing expressions aka comprehensions aka
generators) as the targets of setting operations. (Some would say that
generators are themselves a conceptual advantage of Python, but these
are trivally obtainable using, or if you like, macofying in of Lisp
generators, and there are already lisp packages that do this!)

Neither of these is a huge stumbling block (although the former:
declaration) may cause efficiency problems -- which may be why Lisp
requires this; I'm not sure). And the examples hereabove by Ari and
Pascal contain part of the story, but in reading their code, I would
say to ignore their syntactic offerings and focus on their semantic
offerings, and expand from there. Adding syntax is usually simple (as
demonstrated) but generally a bad idea (as I have previously argued)
because it breaks the model of code as data and v.v.

.



Relevant Pages

  • Re: ANN: TwinLisp - a new way of programming in Common Lisp
    ... Python people why they should look into Lisp. ... Main objection - syntax - ... Initially I wanted to have a white-space based syntax like in Python. ... Also for intoxicated pythoneers I wouldn't mind slightly restricting the set of allowed forms for the sake of readability. ...
    (comp.lang.lisp)
  • Re: ANN: TwinLisp - a new way of programming in Common Lisp
    ... Python people why they should look into Lisp. ... Main objection - syntax - ... After all, they won't mind if ...
    (comp.lang.lisp)
  • Re: Cons cell archaic!?
    ... How would the implementation of a Lisp without a using cons look like? ... the irregularity in its often cited regular syntax. ... Lisp at core is based on functional programing on lists. ...
    (comp.lang.lisp)
  • Re: Parsing s-expression trees
    ... expressions --> lisp. ... the irregularity in its often cited regular syntax. ... programers can pretty much tell what piece of source code ... Lisp relies on a regular nested syntax. ...
    (comp.lang.lisp)
  • Re: Xah on Lisp
    ... Lisp relies on a regular nested syntax. ... Whether the syntax "irregularities" due to the five mentioned characters ... You want me to define the power of a computer language? ...
    (comp.lang.lisp)