Ben Booth:
> There was an interesting language that made the rounds on reddit 
> /r/programming a few days ago:
> Reddit discussion page:
> It's an indentation-based lisp-like language, although the indentation rules 
> differ somewhat from sweet-expressions. It also features a macro system that 
> actually parses its own input and outputs a string that gets re-parsed. The 
> language uses Haskell/Parsec for parsing and evaluation, so it might be 
> interesting to compare that approach with the ANTLR-based grammar.

Thanks so much for the pointer!  I'll add a note about it in the draft SRFI.

Focusing on the Z syntax, its syntax is simple:
1. A whitespace-separated sequence of terms applies to the next, so:
       foo bar mu zot
   would parse (in s-expression form) as:
       (foo (bar (mu zot)))
2. "To pass additional arguments to a function, the arguments are put on the 
next line and indented to the column of the first argument"

I agree with 1337hephaestus_sc2: "The main idea seems clever, but also too 
clever."  A few issues:
1. When you have multi-parameter functions, this syntax quickly forces you to 
grow vertically.  This is exactly the opposite of the actual real estate 
available.  Screens are wide and short, and even if you use traditional paper 
sizes it's wider than tall (typically 80 characters across, ~66 lines down).
2. Edits in one line could quietly change the meaning of other lines, in 
non-obvious ways.  If you edit a line with children, you have to make sure that 
the lines that follow are moved as well.  An IDE can do this, of course, but 
it's concerning if an IDE is a practical necessity. E.G., if you started with:
   fee fie foe fum
                   foo bar
and changed "fie" to "faction",
   fee fie faction fum
                  foo bar
which changes the meaning.
3. I suspect is that it's *especially* easy to make a mistake with this 
notation in a lisp.  Writing "cons a b" would seem reasonable enough, but would 
be interpreted as (cons (a b)).  Languages 

--- David A. Wheeler

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
Readable-discuss mailing list

Reply via email to