News for hackers. Stuff that matters.
Re:Guix: An advanced operating system by chriswarbo on Tuesday January 15, 2019 @11:43AM (#18912442)
"Too many parentheses" isn't a valid argument IMHO. It comes up so often that I wrote a standard response http://chriswarbo.net/blog/2017-08-29-s_expressions.html

tl;dr s-expressions are (by design) trivial to both parse and generate, and there are already a bunch of tools to convert to/from a other formats (such as indented text). There's no need to create/use a whole different language+toolchain+ecosystem just to avoid parentheses.

Re:Guix: An advanced operating system by m45t3r on Wednesday January 16, 2019 @06:24PM (#18926618)
This post shows exactly what I mean: editing Lisp with a good editor is nice, however when you're bootstrapping a system sometimes the only tool available is vi (no even vim, just vi).

Try to find a close parenthesis after 8 function calls without syntax highlighting, or without your "hide parenthesis".

Nix syntax is quite simple to read even without any editor support. I did the whole bootstrapping of my current NixOS system only using vim without special support for Nix language and still got it right in my first try.

Re:Guix: An advanced operating system by chriswarbo on Tuesday January 22, 2019 @11:55AM (#18969709)
> This post shows exactly what I mean: editing Lisp with a good editor is nice, however when you're bootstrapping a system sometimes the only tool available is vi (no even vim, just vi).

Then I think you misunderstood. My point is that if you don't like parentheses, then don't use parentheses. Lisp doesn't care. Denote structure in whichever way you prefer, and convert that to/from s-expressions programatically.

Guix runs on Guile Scheme. I-expressions (which use indentation instead of parentheses, which I linked to in the post, https://srfi.schemers.org/srfi-49/srfi-49.html ) contains an implementaion for Guile right there in the spec. Likewise the code repos for Sweet expressions and Wisp (which also allow mixfix, braces, etc. and I also linked to in the post) seem to provide explicit Guile support too, alongside other systems (e.g. Racket) and standalone conversion scripts for compatability with any other s-expression system. Guile also has a built-in implementation of "curly-infix expressions" ( https://www.gnu.org/software/guile/manual/guile.html#SRFI_00... ).

That's 4 ways to use Guix without reading or writing any parentheses; one of which comes built-in. It's also pretty trivial (thanks to the simplicity of s-expressions) to make up your own alternative if you don't like any of these.

Re:Guix: An advanced operating system by kazinator on Wednesday January 16, 2019 @07:36PM (#18927223)
Vi has % to jump to a matching parenthesis as pretty ancient feature. It's in POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi...

Of course % is a movement that combines with commands like deletion: d%.

The original vi also has a Lisp mode (not described in POSIX) for indentation; that is of course in Vim also.

All the code you see here was written using little more than indentation via Lisp mode and % for paren matching:

http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib

Though I work with syntax coloring and sometimes use Vim features like visual selection.

Re:Guix: An advanced operating system by m45t3r on Thursday January 17, 2019 @10:47AM (#18931615)
> Vi has % to jump to a matching parenthesis as pretty ancient feature.

I know. It helps, but it is far from being good enough. Making things like slurp is still a pain without proper editor support, and this is very common to do in Lisp.

> All the code you see here was written using little more than indentation via Lisp mode and % for paren matching:

Yeah, and K&R written Unix with only ed. My point still is valid: Nix is more readable than Lisp without proper editor support.

Re:Guix: An advanced operating system by kazinator on Thursday January 17, 2019 @12:57PM (#18932884)
Also, any half decent Lisp dialect can tell you where an unbalanced parenthesis lies; you shouldn't have any difficulties hunting for this in a large file.

  $ txr unbal.tl 
  unbal.tl:8: syntax error
  unbal.tl:8: unterminated expression
  unbal.tl:8: while parsing form starting at line 5
  $ pr -Tn unbal.tl
      1   (defun foo()
      2   
      3     )
      4   
      5   (defun bar()
      6     (let (x)
      7       )
Re:Guix: An advanced operating system by m45t3r on Saturday January 19, 2019 @06:39AM (#18946500)
I don't think this is a great error message. I use Clojure everyday and I still had to look 2 times to find the error.

If it was something like this, this would be much better:

  Unmatched parenthesis from starting at line 5.
  Maybe you wanted to do something like this?
      1   (defun foo()
      2   
      3     )
      4   
      5   (defun bar()
      6     (let (x)
      7       )
               ^
This being a very basic code. In reality you will have multiple function calls inside more complicated functions (like a package definition in Guix), so you will end closing 10+ parenthesis and catching them can be hell.