4 ms·
This is quite a stretch to call Ansible, which consists of YAML files with syntactic sugar and some light Python evaluation, 'Lisp'. I thought reading the arti
by Attummm 2y ago
This is quite a stretch to call Ansible, which consists of YAML files with syntactic sugar and some light Python evaluation, 'Lisp'.
I thought reading the article would make less inflammatory but it didn't.
- baq 2y agoYeah I agree, Ansible would be so much better if it was Lisp-first with a perfectly non-scary I'm-a-devops YAML syntax instead of OMG-parens-nobody-understands-Lisp Lisp syntax.
- eternityforest 2y agoI'm guessing you'd probably break the declarativeness if you exposed the full power of LISP, but limited subsets in YAML work pretty well. 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....
- jimbokun 2y agoIt’s a homoiconic language like Lisp, just with YAML instead of s-expressions.
- fargle 2y agothat's beyond a real stretch - is XSLT a LISP then? simply using YAML (or json or any equivalent data/markup syntax as the basis for a DSL syntax does not make it homoiconic. 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.