Earlier quoted context omitted.
I don't know what you're trying to get at, you seem to be agreeing with me. Function calls (present in C and other structured, procedural, and OO paradigm languages which are also imperative) do not make a language declarative. That they're also present in the functional and logic paradigms doesn't change that. It's a feature common to both, so not a feature that can be used to distinguish the categories from each ot…
> Function calls (present in C and other structured, procedural, and OO paradigm languages which are also imperative) do not make a language declarative. “Declarative” and “imperative” are not really features of languages in the first place. They are features of code (and coding paradigms), and you can write code of either style (and usually most paradigms) in almost any real-world, Turing-complete, higher-level-than…
Why does nobody seem to know what imperative and declarative mean?
61–70 of 77 posts
Re: Why does nobody seem to know what imperative and declarative mean?
#62I think it's just a weakness of the terms. Kind of like "interpreted vs compiled" at this point very little is strictly interpreted, almost everything goes through a bytecode compilation step. In this case, you're using imperative languages to generate declarative policies. Things just aren't black and white. Importantly, it doesn't really matter. We say "Python is interpreted" because the it gives you the UX of an i…
> We say "Pulumi is imperative" because it gives you the UX of an imperative language. Under the hood they do their own thing, but unless you're trying to have a really precise conversation it's usually easiest to stick to those terms. I'd still take issue with that description. There is a massive UX distinction here that isn't under the hood. Your imperative Pulumi code is at a meta/macro/preprocessor level. That's…
I think it was Plato who asked this question - if I take two pieces of clay and smash them together, which piece grew? You can argue all day about it, and it has some fun implications about identity, but that's philosophy.
Re: Why does nobody seem to know what imperative and declarative mean?
#63Puppet started popularizing declarative configuration management almost a full decade earlier.
Re: Why does nobody seem to know what imperative and declarative mean?
#64Randy's law of config files: In the limit, all config files become a language. So if you have a so-called "declarative" config file, it eventually becomes a ... ? Language - that's imperative. Every time. Yes, really. What is the only time this doesn't happen? If the config system ceases to exist.
Re: Why does nobody seem to know what imperative and declarative mean?
#65>Unless I’m mistaken, Terraform was the first tool to drive home the importance of defining infrastructure declaratively. Puppet started popularizing declarative configuration management almost a full decade earlier.
Idea is, you run Terraform to create/modify the infrastructure, and Puppet to configure the software running on that infrastructure.
Re: Why does nobody seem to know what imperative and declarative mean?
#66The imperative vs declarative argument has been used to keep Pulumi out of several infra repos I have been responsible for. A ball of horrible Terraform is much better than a ball of terrible Node.js Pulumi.
https://twitter.com/dave_universetf/status/14864638523131330...
Re: Why does nobody seem to know what imperative and declarative mean?
#67Earlier quoted context omitted.
But each layer’s what is the layer above its how. My C code is just declaring the program I want to run. How it is run is determined by a compiler, assembler, linker, operating system, and CPU. There’s a sort of useless sense in which everything is declarative if you are allowed to shift around what the relevant “thing to be done” is, and it seems like many people are complaining that the article does this exact thin…
Sure it's a spectrum and the exact edges can be blurry. But no-one's going to argue that there isn't a qualitative difference between a sql query and the same logic written out in c
Re: Why does nobody seem to know what imperative and declarative mean?
#68The author is making a pedantic point. While I agree with the main thesis that Pulumi *as a tool* is declarative, one of the main selling features (and the first thing I think of with Pulumi) is how languages like Python can be used to write it. Hence, the association of everyone besides the the author with Pulumi == imperative code. The imperative vs declarative argument has been used to keep Pulumi out of several i…
Also that rant is just a woeful misunderstanding of well everything, but in particular AWS and k8s. If you do it in Terraform you couldn’t specify the AZs either and instead have to define a VPC config with two subnets. That’s an AWSism not Pulimi.
“I will learn nothing and complain the whole time!” isn’t as damning of a criticism as they think.
Re: Why does nobody seem to know what imperative and declarative mean?
#69Earlier quoted context omitted.
> We say "Pulumi is imperative" because it gives you the UX of an imperative language. Under the hood they do their own thing, but unless you're trying to have a really precise conversation it's usually easiest to stick to those terms. I'd still take issue with that description. There is a massive UX distinction here that isn't under the hood. Your imperative Pulumi code is at a meta/macro/preprocessor level. That's…
I think ultimately you're just demonstrating the larger point. There is no value trying to label it as imperative or declarative except in the niche situation where one is debating whether it is imperative or declarative, which at some point is just a philosophical question. I think it was Plato who asked this question - if I take two pieces of clay and smash them together, which piece grew? You can argue all day abo…
The thing about writing "code that outputs a data structure" is that you can voluntarily choose to use no control flow.
The tool takes declarative input, and optionally you can use imperative code to make the job of writing that input easier.
That's very different from a tool that gives you helper functions for writing an imperative core. In that case you're always writing something that's full of control flow, and it's up to you to make sure you get all the state transitions to be consistent with each other.
Re: Why does nobody seem to know what imperative and declarative mean?
#70Earlier quoted context omitted.
The declarative banana should be in my stomach.
After the 20 or so comments that responded I'm still no closer to understanding. The SQL guy sort of made sense I guess maybe.
When you write an SQL query, you're not describing steps to take, you're describing the outcome you want (what rows and fields from which tables and how those tables relate to each other). The query engine then takes that description and figures out how to actually do the query (what indices to use, in what order, how to actually loop/hash/map/scan the tables and indices, etc). This is what EXPLAIN shows you, the actual imperative plan the query engine came up with given the declarative query you gave it.
Another common example would be CSS: It's all about describing the desired result and spatial relationships between elements, then the CSS engine takes those rules and figures out how to actually get those elements to do what you want. Like something as seemingly simple as "float: left" - for the text to wrap around it, the engine has to deal with the image size, position, font and font size, figuring out when to wrap the text, height of the font, which line of text is greater than the image height, etc. The engine does a lot of work figuring out the steps to take to get the result you've described.