Comment by zkmon
12 hours ago
Give it enough time, every declarative language becomes a programming language. This is happening with all config files, markup languages, data formats.
The distinction between code, config and data is being erased. Everything is a soup now. Data is application, configuration is code. Code is an intermediate, volatile thing that is generated on the fly and executed in the temporary lambda containers.
> every declarative language becomes a programming language.
Overly pessimistic, lots of non-programming languages remain non-programming languages. Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down...
> The distinction between code, config and data is being erased.
As as lisp programmer, I love it. Get rid of treating things differently, make everything the same and make everything work with everything, code should just be data.
> Get rid of treating things differently, make everything the same and make everything work with everything, code should just be data.
"Code should just be data" doesn't imply the converse, though; there's arguably utility in having data that isn't code, even with the premise that code should be data.
> Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down.
The question still is: why is CSS becoming a programming language? And who decides on this, anyway?
Becoming? CSS is already Turing-complete (https://stackoverflow.com/a/5239256), even without if() function.
Why? Because of enormous JS bloat. Pure CSS solutions are more performant and backwards-compatible (don't raise exceptions which abort the code).
Who decides? CSS Working Group.
2 replies →
The web should always have been a programming language, with all the usual constructs available in both the display and markup layers.
But instead of a single unified standard library for the industry we got a sprawling, ludicrous mess of multiple poorly thought-out semi-compatible technologies, with an associated sub-industry of half-baked fixes and add-ons.
2 replies →
Because modern UI toolkits like Flutter proved that UI should just be code, not separated into three different languages. In this case, adding conditionals can remove the need for js in some cases, which is good.
3 replies →
A gentle reminder: conditionals aren't new to CSS; @supports and @media are conditionals; so are style queries.
if() just codifies behaviors and hacks [1] developers were already doing.
[1]: https://lea.verou.me/blog/2020/10/the-var-space-hack-to-togg...
If only Lisp had better presense in modern code editors. Emacs is not enough, especially on Windows where it is super slow. I think this is what actually stops newcomers to start with Lisp and not Python
My crackpot theory is that what stops newcomers is how unergonomic "(" and ")" are to type on typical keyboards. If mainstream lisp dialects used square brackets instead, we'd all be programming in it!
> I think this is what actually stops newcomers to start with Lisp and not Python
What stops newcomers is knee-jerk reactions about the (lack of) syntax, it's scary to see something that doesn't look like Algol, because everyone who does mainstream programming uses Algol-like languages.
Introduce lisp to anyone who knows programming since earlier, and 99% of them will have a adverse reaction to s-expressions, before they understand what's going on. Once they understand, it makes a lot of sense obviously, but not everyone even has that kind of open mindset where they could understand if they wanted to.
I find lisp to be a very non ergonomic language and am happy that python is the default.
3 replies →
>> Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down.
You need to look at a large terraform project.
I spent more time than I'm willing to on large Terraform projects. How exactly is this relevant to declarative vs imperative or even my comment at all? I don't see what the "gotcha" is supposed to be here.
> > The distinction between code, config and data is being erased.
> As as lisp programmer, I love it.
You make bad engineering decisions because you consider the advantages, but not the disadvantages. <https://news.ycombinator.com/item?id=29231493>
You make bad comments because I can't understand the point you're trying to make. I'm am engineer, I make choices based on informed tradeoffs, anything else would be sub-standard. Not sure why you think I only consider advantages, but I'm afraid asking you for clarification will just lead to more ramblings.
2 replies →
An if conditional doesn't make a programming language. You need recursion to have Turing completeness.
CSS already has all sorts of conditionals that are if() in disguise!
For instance a selector like .foo means "if the class is foo then select this style block'.
CSS is thoroughly condition-driven already.
This is so true, I have seen it happen with so many projects. It always starts with a cute declarative DSL, and inevitably imperative / flow control structures emerge, at which point you wonder why they didn't use a real programming language in the first place and save you the hassle or learning a half baked imperative DSL.
- Puppet
- CMake
- Terraform
- ...
All these started with pure declarative DSL then incrementally created a nightmarish imperative monstrosity.
- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.
They are badly copied Ant build files.
Ant came first, then when Microsoft redid the VS project format, they created MSBuild.
As incredible as it may sound, Ant is still easier to deal with than MSBuild.
8 replies →
Horrible. Would’ve been much nicer if they’d reached for Scheme.
4 replies →
what's even worse that schema uses extremely generic types with attributes denoting actual type.
Makes reading it even harder, and any possible constraints due to type safety go out of the window, so we get worst of both worlds.
Wesnoth the game also has that via WML. Looks very ugly and obfuscated.
CMake was never declarative AFAIK?
CMake today is effectively an eso-lang / Turing tarpit with some “modern” declarative conventions that people try to push.
"Modern CMake" is more about scoping all properties to the targets that they belong to (including stuff like what you also need to link against if you link against target foo) than about language features. The CMake language hasn't changed much except correcting some early weirdness about "if" and the addition of generator expressions, which are fortunately not often needed.
What's the old adage? Software expands until it can send email?
> All these started with pure declarative DSL then incrementally created a nightmarish imperative monstrosity.
"Huh?" I asked myself when you mentioned that Terraform is now imperative somehow. Took a look at the website again, and seems to still be HCL, and still be declarative. Am I missing something? How exactly is Terraform today a "imperative monstrosity"?
Terraform has modules which are an elaborate method of doing function calls. HCL 2 has loops and conditionals. It is most definitely imperative.
This is not necessarily a problem except that they had to live in the original HCL v1 landscape which makes them awkward syntactically.
4 replies →
I think cmake kind of needs conditional checks though.
People love to hate on Maven's XML but at least it's been mostly the same since 2006. There are conditionals in profile activation expressions but they are very limited by design. Declarative done right, IMO
Conditional expressions are declarative. For example, every template language worth its salt has conditionals.
A programming (i.e Turing complete) language requires recursion or a construct of equal power.
There is no recursive program that can't also be created by adding in more conditionals. It's turtles the whole way down.
You can emulate recursion with iteration and a push-down stack. If it doesn’t either recurse or offer both iterations (loops) and something that can act as a stack (at least an array or so) then it’s not Turing complete though. I have yet to see a stack or user-manipulable arrays in CSS.
You need unbounded recursion. Conditionals alone can’t do that. If you have some kind of conditional go to/jump if expression that’s a different matter.
You can't add all possible conditionals for every kind of loop/iteration, such as dynamic and infinite.
You have to give it to CSS, it's held out for a lot longer than most.
not as much as you would think, the if statements don't really affect the css crimes scene because pretty much everything was already possible before
But then why was it added?
> The distinction between code, config and data is being erased.
This distinction never existed in LISP. Greenspun's tenth rule in action.
An interesting example is the Dhall language: https://dhall-lang.org/
It is a configuration language with general programming features, but it is decidedly _not_ Turing complete. It seems to sit at a sweet spot between "just JSON, no programming convenience at all" and "full-blown programming language with nontrivial toolchain".
We can blame von Neumann (et al) and his infernal architecture, where memory stores both instructions and data.
You can blame whoever invented the word "if", as soon as you can branch based on data you can just write an interpreter that turns data into instructions, no matter the architecture.
You need more than if for Turing completeness though.
5 replies →
Or lambda. Or Forth commands. You can create an 'if' with few atoms.
FWIW, you can make software that runs on Harvard architecture chips. They feature distinct address spaces for ROM and RAM. It's been a while, but it's how Atmel/Microchip AVR micros work.
https://en.wikipedia.org/wiki/Harvard_architecture
That said, I'm unaware of any programming language (outside assembler) that takes that split to heart in a higher-level way.
Not really, most of these configuration as code systems are not executed directly on the CPU but rather interpreted in which case a separate data-only memory would not stop anyone.
von Neumann did not invent the von Neumann architecture. Not even a little bit.
If you want to reason that the hardware is at fault, you should be blaming the Eckert-Mauchley architecture.
Those who don't use lisp are destined to re-invent it - poorly.
CSS is already a programming language long before if() function. You can even emulate CPU in it: https://dev.to/janeori/expert-css-the-cpu-hack-4ddj
Configuration complexity clock
https://mikehadlow.blogspot.com/2012/05/configuration-comple...
Unfortunely too many people are afraid of opening parentheses being posited on the far left instead of the middle of the text.
It was shocking the first time I showed a lisp program to a (particularly "annoyed by everything") non-lisp developer who never apparently saw s-expressions before. Lots of knee-jerk reactions of "Oh my god so many parenthesis" and "How could anyone program like this?" while they sat there smug with their TypeScript codebase having more special characters, syntax and the same amount of parenthesizes, only because the opening parenthesis is one symbol to the left, instead of in the middle of the calls...
So why do people still design declarative languages?
OP is not being very precise (and in a way that I don't think is helpful). There is nothing imperative in an if expression. Declarative languages can be Turing complete. Declarative languages are a subset of programming languages.
If you can mostly stick to the declarative way, it's still a benefit. No Turing-complete language completely prevents you from writing "bad" code. "You are not completely prevented from doing things that are hard to understand" is a bad argument. "You are encouraged to do things that are hard to understand" is a good one (looking at you, Perl).
Wishful thinking? Maybe they are tired of all this and want to make something good again, and so the cycle continues.
It’s the cycle of newcomers to <field> looking at the existing solutions and declaring “this shit is too complicated, why did these morons design it this way? Check out my DSL that does everything and is super simple!”
Then time passes, edge cases start cropping up and hacks are bolted on to accommodate them. Eventually everything struggles under the weight of not having loops, conditionals, etc. and those are added.
After some time, the cycle begins anew.
can someone interpret this as not a skill issue?
i want better, declarative, interactive, fast UIs
CSS is the best answer we have
dont be such a doomer
“Now”? This has always been the case.
I've been observing this, off and on, for decades now. Is there an actual formal proof or law named after someone at this point?