Hacker News new | past | comments | ask | show | jobs | submit login

What if there was a way to replace parenthesis with syntax? For instance, if you could declare your operating system as:

  operating-system:
    ...
    packages:
      - vim
      - %base-packages
instead of:

  (operating-system
     ...
     (packages (cons* vim %base-packages)))
would that help you? No more parenthesis, the complexity of cons* is hidden behind the "-" and it's pretty trivial to convert between one syntax and the other. If it was possible, how would that affect your opinion on guix? What if the installer came with a pre-configured vim for scheme?

btw, I'm also a guix and a vim user, and I don't use anything special for parenthesis. I just close them manually like a grown-up (which is a very usefull skill to have when you want to impress an emacs user :p).




Wisp provides a Python-like syntax for Scheme that gives you something very close to the above: http://draketo.de/english/wisp . (Though me and my editor don't view parentheses as an obstacle, quite the opposite...)


There you're replacing a configuration language that is executable Scheme, with what seems to be a declarative language, and converting to indentation syntax. That's a two-variable change.

The original S-exp syntax doesn't have to be an executable program in which you use Scheme operators like cons* .

The indentation-based notation, likewise, can retain the property that it's executable Scheme and reveals operations like cons* to the user.


Yeah, this seems way more clean.


The whole problem with that notation is that it isn't declarative. It's mean to execute. So to read it you have to know Guile functions like cons* . vim and packages% are actually variable bindings; vim undoubtedly stands for some package object defined elsewhere.

A Scheme-based configuration language that is executable Scheme is going to end up using the entire language, and be daunting to some IT person who just wants to reconfigure the distro and isn't a Scheme programmer. (Counterargument: a clean, dedicated configuration template language will likely sprout a way to run arbitrary Scheme code anyway.)

It's tempting to make things like this because they are quick and dirty. For instance, we could make an assembly language which is like this. (mov eax ebx) could be a call to a function called mov, and eax and ebx could be constants in Scheme itself. The function has the side effect of emitting the assembled code into some stream. We don't have to write any code which would walk, validate and translate the syntax of a Lisp-ified assembly language; we just let the programmer write code using the API we have provided and throw it into the path of the evaluator.

And we can have fun like (dotimes 13 (roll %ecx)) to emit 13 copies of an instruction.

So it has some up-sides, and some down-sides.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: