Ansible is a Lisp?
astrid.tech
astrid.tech
I thought reading the article would make less inflammatory but it didn't.
I especially like how well suited it is to visual block based editing.
Blockly and Node Red let you put stuff anywhere in 2D space, a satisfying auto formatter isn't really possible, and traditional flow charts can easily get big and messy.
But if you look at DRAKON, their charts pretty much always look nice. And looking at ladder logic, It's almost but not quite a set of 1D flow charts.
If you strip it down more, events that trigger a list of commands until a command returns False is a really simple model without much learning time, and it's very easy to create a visual editor
Giving people the full power of LISP would probably result in people writing imperative programs rather than building up an ecosystem of declarative plugins though.
And it seems that the consensus is it doesn't become a LISP just because you can implement it in nested lists....
in this case, the very rigid structure of playbooks and tasks, etc. within YAML is also part of the syntax. just the fact that you can generate arbitrary YAML (or json or etc.) from within a copy utility does not come close to homoiconicity of a LISP. can you effortlessly move back/forth from data to code? is everything both code and data at the same time? what's the Ansible equivalent to quasi-quote, for instance? is a bash script that sources (or creates or evals) a list of variable assignments in bash syntax homoiconic? due to eval, bash would seem a hell of a lot closer.
and those really aren't "syntactic macros" either, unless you'd be happy to define an MS-DOS .bat file that generates and calls a .bat file fragment "syntactic macros". it's using an external file ffs.
Ansible is good for what it does, but it has an extremely limited and rigid "flow-control" (if we can even call it that) and is more of a declarative language/config file than a general language.
this represents a pretty naive superficial understanding of these LISP features.
points for making us think though.
(html
(body
(h1 "Hello, World!")))
This does not mean that HTML is a lisp.This webserver in Maclisp http://up.dfupdate.se/httpd%20html
gave birth to this: http://up.dfupdate.se/ulml.html
<b>Hello <i>World!</b> Greetings</i> Earthlings!It might work because the HTML5 parsing algorithm produces well-defined results for broken HTML, but I'm not sure that's the same as "perfectly valid" – the spec calls such markup "misnested" and "erroneous" [0].
[0] https://html.spec.whatwg.org/#an-introduction-to-error-handl...
<b>Hello <i>World!</></b><i> Greetings</i> Earthlings!
You can see this by looking at the innerHTML, which is really just a serialized form of the DOM tree.One could make clever quips that this isn't enough, you need quote/unquote as well to make it practical, and is that really implied by homoiconicity? Should we really use this word? Maybe we should pay someone to make up a new one?
Why must we do these things to ourselves?
* [Consfigurator](https://spwhitton.name/tech/code/consfigurator/) - Lisp declarative configuration management system. You can use it to configure hosts as root, deploy services as unprivileged users, build and deploy containers, and produce disc images. [GPL3][2].
* [cl-unix-cybernetics](https://github.com/cl-unix-cybernetics/cl-unix-cybernetics) (previously Adams) - UNIX system administration in Common Lisp. Not unlike Ansible, Chef or Puppet. [ISC][22]. - You describe your systems (hosts) using resources having properties. The properties are then probed and synchronized using only /bin/sh on the remote host, and /usr/bin/ssh on the control host.
(awesome-cl)
https://blog.danieljanus.pl/2014/05/20/you-already-use-lisp-...
Is there a way to quote data in Bash to safely insert it into a piece of code, the way you can in Lisp?
The printf built-in command has a %q conversion specifier which quotes the argument such that the result can be used as input into the shell.
Such a thing cannot be inserted into a quote without affecting its meaning, but what you can do is terminate the quote before and after it.
'stuff before'$(printf "%q" "$value")'stuff after'
In this case, because it's a single quote, we need to terminate it anyway, order to activate the command substitution syntax."Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."
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.
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.
But Clojure is all stainless steel and engineered stone.
So maybe if philg updated his aphorism to mention Clojure it would still fly.
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.