Wow, this is really something. I never really thought about it and assumed that paredit would be as good as it gets. But, this seems to show that is not the case. I really need to check this out.
> And alternative syntaxes (Lisps without parens) have faultered since they sacrifice some of Lisp's power that seasoned users aren't willing to part with. Could Elixer be an example of one of these Lisps without parens? [1] Can anyone give an example of what kinds of Lisp powers are sacrificed in a syntax where the parens are implicit rather than explicit? I can't think of anything off the top of my head. It seems to me that Parinfer, when working as intended, almost turns a regular Lisp into one of these parenless Lisps, by performing parens manipulation for us, which in turn allows us to treat whatever Lisp we're working with as if it was a parenless Lisp. [1]: https://blog.8thlight.com/patrick-gombert/2013/11/26/lispy-e...
Using parens just makes manipulating the AST easier, but doesn't necessarily remove the homoiconocity of a language. I've barely done any lisp programming, though I have done a fair amount of work with AST's and compilers. S-exprs lend to thinking of the structure of the code as data, useful for "lisp-ing".
Personally I don't care to write in lisp since I loose track of parens way too readily. This project might be very handy! In the meantime I've come to view Julia as my goto lisp. Quite fun to be able to write hygienic macros, but still have a mostly familiar imperative syntax for common tasks. Actually, the disciplined (read limited) usage of macros in Julia is a big draw for me, since I've heard too many horror stories of macro readers and spaghetti code in large lisp projects. Interesting look at elixir, I'll have to play with it sometime.
I think the author is talking about minor variations on Lisp syntax that include indentation-sensitivity, not about different languages that are homoiconic. Such variant syntaxes include i-expressions (http://srfi.schemers.org/srfi-49/srfi-49.html) and sweet-expressions (http://readable.sourceforge.net/), which the author mentions in the Acknowledgements. For example, here are some sweet-expressions:
define factorial(n)
if {n <= 1}
1
* n factorial(- n 1)
This desugars to:
(define (factorial n)
(if (<= n 1)
1
(* n (factorial (- n 1)))))
I think the Lisp power that the author is referring to is homoiconicity, and the corresponding ease of writing macros. For example, i-expressions sacrifice homoiconicity in some contexts.
But the author seems to have overlooked that sweet-expressions, which were developed later, do not sacrifice homoiconicity. A human reader can still easily understand the AST from reading sweet-expression syntax. The real reasons that sweet-expressions have faltered relate more to the increased difficulty of collaborating with other developers, the lack of editor plugins that highlight sweet-expressions correctly, and incompatibility with Clojure syntax.
Eh, not sure I like it. For this to work, they have to make the indentation part of the syntax. Otherwise stuff is way too ambiguous to infer the correct parenthesis. A result is that the programmer has to be intimately familiar with how the inference works and what the syntax of indentation is. I feel that this just shifts cognitive load from managing parenthesis to managing indentation and inference. From the documentation:
The rules for what happens when inserting/deleting parens must be
learned. Also, the case necessitating a "Paren Mode" comes at the
cost of forcing the user to understand when and how to switch
editing modes.
Also, the preprocessor step performed when opening files will cause
more formatting-related changes in your commit history when
collaborating with others not using Parinfer.
they have to make the indentation part of the syntax
The syntax remains unchanged. Parinfer only "infers" the structure of your code based on the same indentation that you typically would do anyway as part of formatting your code to be readable.
shifts cognitive load from managing parenthesis to managing indentation
Comments (134) 36 threads
Earlier comments> And alternative syntaxes (Lisps without parens) have faultered since they sacrifice some of Lisp's power that seasoned users aren't willing to part with.
Could Elixer be an example of one of these Lisps without parens? [1] Can anyone give an example of what kinds of Lisp powers are sacrificed in a syntax where the parens are implicit rather than explicit? I can't think of anything off the top of my head.
It seems to me that Parinfer, when working as intended, almost turns a regular Lisp into one of these parenless Lisps, by performing parens manipulation for us, which in turn allows us to treat whatever Lisp we're working with as if it was a parenless Lisp.
[1]: https://blog.8thlight.com/patrick-gombert/2013/11/26/lispy-e...
Personally I don't care to write in lisp since I loose track of parens way too readily. This project might be very handy!
In the meantime I've come to view Julia as my goto lisp. Quite fun to be able to write hygienic macros, but still have a mostly familiar imperative syntax for common tasks. Actually, the disciplined (read limited) usage of macros in Julia is a big draw for me, since I've heard too many horror stories of macro readers and spaghetti code in large lisp projects. Interesting look at elixir, I'll have to play with it sometime.
But the author seems to have overlooked that sweet-expressions, which were developed later, do not sacrifice homoiconicity. A human reader can still easily understand the AST from reading sweet-expression syntax. The real reasons that sweet-expressions have faltered relate more to the increased difficulty of collaborating with other developers, the lack of editor plugins that highlight sweet-expressions correctly, and incompatibility with Clojure syntax.
All comments shown.
Couldn't load more comments. Check your connection and try again.