3 ms·
And here we come. Google, in the 21st century, is trying to sell us BASIC - define: assign: - array: ["foo", "ba", "r"] - result: ""
by perfunctory 6y ago
And here we come. Google, in the 21st century, is trying to sell us BASIC
- define:
assign:
- array: ["foo", "ba", "r"]
- result: ""
- i: 0
- check_condition:
switch:
- condition: ${len(array) > i}
next: iterate
next: exit_loop
- iterate:
assign:
- result: ${result + array[i]}
- i: ${i+1}
next: check_condition
- exit_loop:
return:
concat_result: ${result}
edit: it's not April 1st yet, is it?
- recuter 6y agoCome on, this is bound to revolutionise your Kubernetes configuration.
- baq 6y agoi've seen this before, as has my father and probably my grandfather, except it was thought out better and was called lisp instead of yaml.
- mahmoudimus 6y agoI completely agree with this statement and made a similar realization as well. Basically, modern devops and application development boils down to writing Lisp in YAML. Config languages for Ansible, K8S, etc.are just basically a bad implementation of a Lisp-ish language.
- Jtsummers 6y agoIt’s not a lisp. It’s similar to s-expressions, but it is not lisp. It’s a tree based language and that’s the entire similarity. There is nothing else here that is reminiscent of lisp.
- timgilbert 6y agoYeah, among other things Lisp isn't big on labels and GOTO (but BASIC is).
- Jtsummers 6y agoWell, Common Lisp isn’t opposed to it, it does have labels and gotos. But it’s not used in your average code (at least from what I’ve seen they’re typically constrained to code needing high performance or macros). But this is missing some of the key things of lisps. It’s not homoiconic (it’s a tree-based syntax, yes, but with no tree structure unless you count nested arrays). There are no closures or lambdas. You can’t pass steps/sub-workflows around as parameters to variables (at least not what is shown) so you can’t do something like: - a_step: - assign: - some_task: a_step - b_step: - call: $some_task I mean, that’d be a basic element for passing function-like things around and getting the functional capabilities of lisp and let you have higher-order functions. This is a weird, basic, imperative language that’s aiming for deliberately limited capabilities. They seem to have chosen YAML only because it’s already used as a configuration language, but not because it actually provides any real value or novelty. We are very much approaching the 00s infatuation with XMLifying everything here.
- swiley 6y agoRemember that you need something in addition to s-expressions to represent a dictionary. (There are multiple ways to do it but at the end of the day all you have are nestable lists.)
- qppo 6y agoWell at least it's NoCode
- deleted 6y ago[deleted]
- 1337shadow 6y agoI fail to see how better it is than: array = ["foo", "ba", "r"] result = "" i = 0 while len(array) > i: result = result + array[i] i += 1 exactly 3 times less code