3 ms·
You used quotes around "execution" a lot. I think a better term would be control. SQL, regex literals and so on work similarly, they are declarative while avoid
by dgb23 5y ago
You used quotes around "execution" a lot. I think a better term would be control. SQL, regex literals and so on work similarly, they are declarative while avoiding explicit control.
An opposite would be something like an FSM, or one of these DAGs that people do visual scripting with. These are declarative ways to describe very explicit control.
- dwohnitmok 5y agoI initially wrote the word "declarative" but I don't really like it. It implies an objectivity and absoluteness that doesn't align with the subjectivity inherent in trying to tie code to a programmer's intentions. That is what is declarative for one developer or one set of circumstances may smack of being overly procedural for another (see e.g. what opinions you'll get if you tell a population of programmers that regexes are declarative). To be more specific, SQL and regex literals still don't really capture the magic of Prolog which is unification. It's a heady thing to realize that telling a machine facts and asking it for information is fundamentally the same thing! Just a matter of whether you pass a constant or a variable. To compare with SQL, it would be as if you did away altogether with the notion of separate `SELECT` and `INSERT` statements and the same prepared SQL statement could be used to mutate the DB or return data just based on what you pass to the `?` parameter.