Live data from Hacker News

Ansible is a Lisp?

astrid.tech

21–30 of 45 posts

Re: Ansible is a Lisp?

#22
I thought this was going to be a python thing that exploited functions returning functions with their lexical scope. I find too many syntactical macros tends to encourage excessively dense code. Tho I usually use packer and terraform to configure my end VMs not ansible. A PR to either packer repo or territory repo and push the button to recreate the resources.

Re: Ansible is a Lisp?

#23

See also https://en.m.wikipedia.org/wiki/Greenspun%27s_tenth_rule "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."

Blame the poor computer science education of most people nowadays (could be self-taught or university).

Discovering that code is data and data is code is discovering the moon. And inferring that your sad configuration management system based on an ugly data language is kind of related to Lisp must be mind blowing. Also bonus fact, XML is a lisp too !

Actually maybe we could have written ansible in lisp directly to save us the trouble.

Re: Ansible is a Lisp?

#24
post #2

Not everything that can be represented with s-expressions is a lisp. For example: (html (body (h1 "Hello, World!"))) This does not mean that HTML is a lisp.

Not all of HTML can be represented with s-expressions. The following is perfectly valid.

    Hello World! Greetings Earthlings!

Re: Ansible is a Lisp?

#25

See also https://en.m.wikipedia.org/wiki/Greenspun%27s_tenth_rule "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."

This quote has always seemed very strange to me. I feel like the implicit argument (that just using lisp instead of making a program that has more limited semantics that conform directly to the intended purpose) is not a great one. Obviously informally-specified, bug-ridden, and slow are not good things, but I'd argue those are also not specific to Fortran or C but just to any "sufficiently complicated program". People make a big deal about the Church-Turing thesis, but I think it gets taken too far sometimes because the important part of a programming language isn't always what's possible to do in the language but what _isn't_, and I'd argue most of the large improvements in languages over time are about that; not having undefined behavior, null-pointer errors, and runtime type errors are all huge improvements in programming productivity that only exist because we made languages that don't allow you to do certain things.

At the end of the day, quite a lot of the work in programming boils down to ensuring that what you wrote does _exactly_ what you intend rather than behaving in some other way, and that means identifying and eliminating places where it diverges. There are a lot of common patterns for places where these issues occur, and a language that can identify those patterns and make it impossible for you to write a program that has those mistakes is saving you time up front.

Re: Ansible is a Lisp?

#26
Actually, ansible is a prolog. I played around with marelle[1] a bit for managing my Mac configuration and I realized that the core of the typical configuration management tool just is a prolog: it gathers facts from the systems you have, compares them with a desired state you’ve specified declaratively and executes a plan to get from the current state to the specified one. Prolog does the planning more or less “for free” because of its evaluation model.

[1]: https://github.com/larsyencken/marelle

Re: Ansible is a Lisp?

#27
Ansible is great, but using YAML still bugs me. Would just be a lot easier with HCL (Hashicorp) or something else.

Re: Ansible is a Lisp?

#28
post #24
post #2

Not everything that can be represented with s-expressions is a lisp. For example: (html (body (h1 "Hello, World!"))) This does not mean that HTML is a lisp.

Not all of HTML can be represented with s-expressions. The following is perfectly valid. Hello World! Greetings Earthlings!

I never noticed that, though "doesn't require a closing tag" and "requires that there is no closing tag" ought to have been hints for me.

Re: Ansible is a Lisp?

#29
post #24
post #2

Not everything that can be represented with s-expressions is a lisp. For example: (html (body (h1 "Hello, World!"))) This does not mean that HTML is a lisp.

Not all of HTML can be represented with s-expressions. The following is perfectly valid. Hello World! Greetings Earthlings!

And yet it's semantically identical to

  Hello World! Greetings Earthlings!
You can see this by looking at the innerHTML, which is really just a serialized form of the DOM tree.

Re: Ansible is a Lisp?

#30
post #27

Ansible is great, but using YAML still bugs me. Would just be a lot easier with HCL (Hashicorp) or something else.

At my first job, we had a perl script to transform json into a yaml inventory file (it then allowed us to serve a form to clients that would act as a yaml, but i left a bit before the feature was implemented). We still had to write our module in yaml though.

Still, the greybeard who come up with the initial design and architecture was the best dev i've ever worked with, to this day. I wasn't ready to learn as much as i ought to do, sadly.

Post reply on HN