Live data from Hacker News

Consfigurator 1.0: Common Lisp based declarative configuration management system

spwhitton.name

1–10 of 23 posts

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#3
Can someone help me understand the benefits of a Lisp or Lisp-like language? To me they feel overly verbose and make it more difficult to read code. What is the point of all the parentheses? I get that other languages have some weird syntax, but Lisp seems masochistic. Is there some actual advantage or purpose to it?

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#4
I found their raison d'etre very interesting.

"Declarative configuration management systems like Consfigurator and Propellor share a number of goals with projects like the GNU Guix System and NixOS. However, tools like Consfigurator and Propellor try to layer the power of declarative and reproducible configuration semantics on top of traditional, battle-tested UNIX system administration infrastructure like distro package managers, package archives and daemon configuration mechanisms, rather than seeking to replace any of those. Let’s get as much as we can out of all that existing distro policy-compliant work!"

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#5

Can someone help me understand the benefits of a Lisp or Lisp-like language? To me they feel overly verbose and make it more difficult to read code. What is the point of all the parentheses? I get that other languages have some weird syntax, but Lisp seems masochistic. Is there some actual advantage or purpose to it?

Lisp code is written in those parenthesis because in lisp, that is how you write a list. This means that your code is data that you can easily compute. It's trivial in lisp to quote some code and operate on it, also it means the macro system looks a lot like writing "regular" code. This opens up programming paradigms such as language extending, DSLs and meta programming (writing programs that write programs) that are clumsy, difficult or impossible in other languages.

When someone says "In Lisp, everything is a list" ... They really mean everything

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#6
post #5

Can someone help me understand the benefits of a Lisp or Lisp-like language? To me they feel overly verbose and make it more difficult to read code. What is the point of all the parentheses? I get that other languages have some weird syntax, but Lisp seems masochistic. Is there some actual advantage or purpose to it?

Lisp code is written in those parenthesis because in lisp, that is how you write a list. This means that your code is data that you can easily compute. It's trivial in lisp to quote some code and operate on it, also it means the macro system looks a lot like writing "regular" code. This opens up programming paradigms such as language extending, DSLs and meta programming (writing programs that write programs) that are…

[deleted]

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#7

Can someone help me understand the benefits of a Lisp or Lisp-like language? To me they feel overly verbose and make it more difficult to read code. What is the point of all the parentheses? I get that other languages have some weird syntax, but Lisp seems masochistic. Is there some actual advantage or purpose to it?

I really don't see the advantage of C++. To me it feels verbose and the code is difficult to read, especially templates! What is the point of all that syntax? Is there some actual advantage or purpose to it? :) (Types, yes I know...)

More seriously. :)

The parens are definitely necessary. Think of it as sort of indentation too? Taking a typical factorial and just making up some kind of language which just uses indentation and infix notation, I mean, they're pretty similar? But the nice thing about lisp is that zerop, -, factorial are all equivalent and in the same place in the expressions. You could remove all the parenthesis and just use indentation. If you want to introduce strong typing, you can do that too.

    (defun factorial (x)
      (if (zerop x)
          1
          (* x (factorial (- x 1)))))

    def factorial (x)
      if zero? x
         then 1
         else x * factorial(x - 1)

Mentally, the parenthesis go away when you get used to them, and that happens pretty quick because there isn't any syntax to worry about. In many ways, Lisp is the simplest possible language that can do useful things. It's a thin layer on top of lambda calculus, and the early versions of lisp were more like machine language (CAR, CDR are left over from this history) but it's survived so long with almost no changes because it's pretty much the ur-language, spanning high level and low level abstractions. I expect almost any useful feature from another language could be implemented in lisp.

One benefit is that code == data. It lends itself to all kinds of meta-programming fun, the REPL, etc. The parenthesis become invisible to the reader after a while and for me, the difficulty in understanding lisp code is not the parenthesis at all, but knowing the behavior of the different special forms and macros and functions available in common-lisp (read the documentation for LOOP sometime for a good time).

Oh, here's a good example of the complexities of LOOP from "Practical Common Lisp" https://gigamonkeys.com/book/loop-for-black-belts.html

As that chapter describes, LOOP is a DSL just for doing "looping things", of which there are a lot! But it's implemented as a macro, not a special keyword that can only do one boring thing.

   (loop for i in *random*
   counting (evenp i) into evens
   counting (oddp i) into odds
   summing i into total
   maximizing i into max
   minimizing i into min
   finally (return (list min max total evens odds)))

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#8
I'd like to see a system like Qubes but defined declaratively rather than in a GUI. The Qubes templates are sorta declarative through a system called Salt but the OS as a whole (as far as I can tell) is not. I tried getting a NixOS VM running in a NixOS host, all declaratively described and pushed to a machine, but I never could get it working with that extra layer. I'll have to try it with Consfigurator.

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#9

I found their raison d'etre very interesting. "Declarative configuration management systems like Consfigurator and Propellor share a number of goals with projects like the GNU Guix System and NixOS. However, tools like Consfigurator and Propellor try to layer the power of declarative and reproducible configuration semantics on top of traditional, battle-tested UNIX system administration infrastructure like distro pac…

Puppet has been doing this for over 15 years. Declarative config management is great and I love it. Unfortunately, it doesn't solve all administration problems as some software assumes an imperative installation or upgrade process.

Re: Consfigurator 1.0: Common Lisp based declarative configuration management system

#10

I found their raison d'etre very interesting. "Declarative configuration management systems like Consfigurator and Propellor share a number of goals with projects like the GNU Guix System and NixOS. However, tools like Consfigurator and Propellor try to layer the power of declarative and reproducible configuration semantics on top of traditional, battle-tested UNIX system administration infrastructure like distro pac…

Puppet has been doing this for over 15 years. Declarative config management is great and I love it. Unfortunately, it doesn't solve all administration problems as some software assumes an imperative installation or upgrade process.

What’s an example of something you couldn’t upgrade declaratively, by having those imperative steps in a script?
Post reply on HN