Lisp without parentheses: Lisp INdented
genyris.com
genyris.com
Humans don't think in syntax trees.
In languages with syntax, I have to add syntactic fluff to satisfy the compiler, which is mostly an extra annoyance.
I don't say my way of thinking is the correct one. Some great programmers I respect have said they don't think in DAG (and naturally they choose languages other than Lisp as a primary tool).
The claim that somehow this retains all qualities of Lisp is absolutely ridiculous. The single most important property of Lisp is that programs are lists, i.e., code==data. "Indented" lisp breaks this.
I'm not intending to troll when I say that people who don't like the parens just don't "get it."
I suspect the reason that alternative syntax for Lisp doesn't fly is that, once you use Lisp enough, you start feeling too comfortable with S-expr and the editor's support on it to switch to alternative syntax. It only appeals to those who are new to the language. And the downside is that the editor support can't be as good as S-expr (I suppose; is python-mode capable of various C-M-something tricks?).
http://www.genyris.com/wiki?page=default/eightqueenssource
A lot more readable than the 'regular' lisp version:
http://obereed.net/queens/algorithm.html
By automating the process of converting between 'indented' lisp and 'regular' lisp those that want it can have it and those that do not can simply ignore it.
It also can make debugging such a problem hell because you have to completely grok the code in order to spot the fact that the last line of a code block has somehow mysteriously jumped left 4 spaces.
And it makes refactoring code a major pain.
Braces rule compared to spaces.
I think that might have made it much better!
def foo(): if something: do_something_else print "bar"
What went wrong?
Having to re-type a bunch of stuff that is already in a computer makes me feel like it is 1978 again.
Personally, I've only ever had a problem copy-pasting from the web. Even then, it is rare; a mild occasional annoyance well worth the price of the clutter free syntax.
They strike me as line noise and make it harder to read many things, so I lightened up the color in my vim syntax files to give the appearance of more white space.
I had mixed results. Yes, it was far more readable to me, but there were times when a paren was missing or mistakenly added, or the spacing was off (another coding standard violation), and so on.
Now that I code on my own, the new coding standards say no parens unless required by the language. I also changed my syntax coloring back to more clearly show parens.
Were that always an option. :)
Srsly, looking past the brackets is the least problem in reading lisp. The harder part is dealing with the lack of syntax, so you have to remember place structures instead of picking up hints from the punctuation. And in that regard, Pythonic indenting makes it harder.
Nearly every Lisp development environment does that. SLIME, the poster child of excess does this as well. I don't think I matched parenthesis, indented or looked up a documentation since 2005.
P.S. Not keyboard mapping please.
(defun square-bracket-reader (stream char)
(declare (ignore char))
(read-delimited-list #\] stream t))
(defun use-square-bracket-readtable ()
(set-macro-character #\[ #'square-bracket-reader)
(set-macro-character #\] (get-macro-character #\) nil)))http://users.rcn.com/david-moon/PLOT/
See how he does macros for a syntax-full language :-)