17 ms·
Give it enough time, every declarative language becomes a programming language. This is happening with all config files, markup languages, data formats. The di
by zkmon 11mo 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.
- thwarted 11mo agoWe can blame von Neumann (et al) and his infernal architecture, where memory stores both instructions and data.
- account42 11mo agoNot 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.
- josefx 11mo agoYou 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.
- amelius 11mo agoYou need more than if for Turing completeness though.
- alexdns 11mo agoCorrect. You need at least 2 ifs.
- spooky_deep 11mo agoYou need unbounded recursion no?
- dotancohen 11mo agoThat's actually what two ifs could be.
- knollimar 11mo agoWas the case against the goto statement so good we can't mention it?
- dotancohen 11mo agoMore or less, I meant how this would be inlined in assembly with a goto that could goto back where the branching originated from.
- thwarted 11mo agoYou need conditionals and loops. Recursion counts as looping.
- anthk 11mo agoOr lambda. Or Forth commands. You can create an 'if' with few atoms.
- tovej 11mo agovon 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.
- deleted 11mo ago[deleted]
- pragma_x 11mo agoFWIW, 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 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.
- john61 11mo ago> The distinction between code, config and data is being erased. This distinction never existed in LISP. Greenspun's tenth rule in action.
- Galanwe 11mo agoThis 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.
- Derbasti 11mo ago- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.
- Xelbair 11mo agowhat'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.
- spooky_deep 11mo agoHorrible. Would’ve been much nicer if they’d reached for Scheme.
- debugnik 11mo agoYou say that, but people in OCaml keep bemoaning the use of mostly declarative s-expressions in the Dune build system. Imagine the reaction if MSBuild used an actual Scheme.
- spooky_deep 11mo agoThey don’t know how good they really have it :)
- jimbokun 11mo ago
- mseepgood 11mo agoSo why do people still design declarative languages?
- lionkor 11mo agoWishful thinking? Maybe they are tired of all this and want to make something good again, and so the cycle continues.
- noelwelsh 11mo agoOP 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.
- xienze 11mo agoIt’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.
- ahartmetz 11mo agoIf 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).
- halfcat 11mo ago> So why do people still design declarative languages? Cost. If money were no object, you would only hire people who can troubleshoot the entire stack, from React and SQL all the way down to machine code and using an oscilloscope to test network and power cabling. Or put another way, it would be nice for the employer if your data analyst who knows SQL also knew C and how to compile Postgres from scratch, so they could fully debug why their query doesn’t do what they expect. But that’s a more expensive luxury. Good software has declarative and imperative parts. It’s an eternal tradeoff whether you want the convenience of those parts being in the same codebase, which makes it easier to troubleshoot more of the stack, but that leads to hacks that break the separation. So sometimes you want a firm boundary, so people don’t do workarounds, and because then you can hire cheaper people who only need to know SQL or React or CSS or whatever, instead of all of them.
- lucideer 11mo agoYou have to give it to CSS, it's held out for a lot longer than most.
- rebane2001 11mo agonot 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
- shevy-java 11mo agoBut then why was it added?
- magicalist 11mo agoBecause it's silly to rely on hard to read hacks when you could just add an if() function.
- culi 11mo agoYup. It's the same reason nested CSS was added. It doesn't really add any new functionality. Just makes your CSS neater (or way messier when misused). it's syntactic sugar really
- noosphr 11mo agoThose who don't use lisp are destined to re-invent it - poorly.
- skywhopper 11mo ago“Now”? This has always been the case.
- qouteall 11mo agoConfiguration complexity clock https://mikehadlow.blogspot.com/2012/05/configuration-complexity-clock.html https://mikehadlow.blogspot.com/2012/05/configuration-comple...
- zarzavat 11mo agoConditional 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.
- Starman_Jones 11mo agoThere is no recursive program that can't also be created by adding in more conditionals. It's turtles the whole way down.
- jact 11mo agoYou 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.
- goatlover 11mo agoYou can't add all possible conditionals for every kind of loop/iteration, such as dynamic and infinite.
- cestith 11mo agoYou 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.
- pjmlp 11mo agoUnfortunely too many people are afraid of opening parentheses being posited on the far left instead of the middle of the text.
- embedding-shape 11mo agoIt 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...
- embedding-shape 11mo ago> 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.
- zkmon 11mo ago>> 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.
- embedding-shape 11mo agoI 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.
- bmn__ 11mo ago> > 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 https://news.ycombinator.com/item?id=29231493>
- embedding-shape 11mo agoYou 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.
- marcelr 11mo agocan someone interpret this as not a skill issue? i want better, declarative, interactive, fast UIs CSS is the best answer we have
- IngoBlechschmid 11mo agoAn interesting example is the Dhall language: https://dhall-lang.org/ 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".
- pragma_x 11mo agoI've been observing this, off and on, for decades now. Is there an actual formal proof or law named after someone at this point?
- niutech 11mo agoCSS 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 https://dev.to/janeori/expert-css-the-cpu-hack-4ddj
- anon115 11mo agodont be such a doomer
- kazinator 11mo agoAn 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.
- paulddraper 11mo agoVon Neumann devastated
- ASalazarMX 11mo agoI hope I get to see the next thing after browser applications in my lifetime. I fully understand the advantages, but it has grown so fast and so wild I think it has to eventually fall down by its own weight and complexity despite its immense success. It's not that the presentation layer need conditionals, it's that the layers under it have grown full of hacks that need more hacks to work around them, because the web was designed to grow documents, not programs. If the web had been designed for applications in the first place, the presentation layer probably wouldn't need conditionals at all.