frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
494•klaussilveira•8h ago•135 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
835•xnx•13h ago•500 comments

How we made geo joins 400× faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
52•matheusalmeida•1d ago•10 comments

A century of hair samples proves leaded gas ban worked

https://arstechnica.com/science/2026/02/a-century-of-hair-samples-proves-leaded-gas-ban-worked/
108•jnord•4d ago•17 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
162•dmpetrov•8h ago•75 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
166•isitcontent•8h ago•18 comments

Dark Alley Mathematics

https://blog.szczepan.org/blog/three-points/
59•quibono•4d ago•10 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
274•vecti•10h ago•127 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
221•eljojo•11h ago•138 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
337•aktau•14h ago•163 comments

Show HN: ARM64 Android Dev Kit

https://github.com/denuoweb/ARM64-ADK
11•denuoweb•1d ago•0 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
332•ostacke•14h ago•89 comments

PC Floppy Copy Protection: Vault Prolok

https://martypc.blogspot.com/2024/09/pc-floppy-copy-protection-vault-prolok.html
34•kmm•4d ago•2 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
420•todsacerdoti•16h ago•221 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
355•lstoll•14h ago•246 comments

Female Asian Elephant Calf Born at the Smithsonian National Zoo

https://www.si.edu/newsdesk/releases/female-asian-elephant-calf-born-smithsonians-national-zoo-an...
15•gmays•3h ago•2 comments

Delimited Continuations vs. Lwt for Threads

https://mirageos.org/blog/delimcc-vs-lwt
9•romes•4d ago•1 comments

Show HN: R3forth, a ColorForth-inspired language with a tiny VM

https://github.com/phreda4/r3
56•phreda4•7h ago•9 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
209•i5heu•11h ago•153 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
121•vmatsiiako•13h ago•49 comments

Introducing the Developer Knowledge API and MCP Server

https://developers.googleblog.com/introducing-the-developer-knowledge-api-and-mcp-server/
32•gfortaine•5h ago•6 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
157•limoce•3d ago•79 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
257•surprisetalk•3d ago•33 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
1011•cdrnsf•17h ago•421 comments

FORTH? Really!?

https://rescrv.net/w/2026/02/06/associative
51•rescrv•16h ago•17 comments

I'm going to cure my girlfriend's brain tumor

https://andrewjrod.substack.com/p/im-going-to-cure-my-girlfriends-brain
91•ray__•4h ago•41 comments

Evaluating and mitigating the growing risk of LLM-discovered 0-days

https://red.anthropic.com/2026/zero-days/
43•lebovic•1d ago•12 comments

How virtual textures work

https://www.shlom.dev/articles/how-virtual-textures-really-work/
34•betamark•15h ago•29 comments

Show HN: Smooth CLI – Token-efficient browser for AI agents

https://docs.smooth.sh/cli/overview
78•antves•1d ago•59 comments

Show HN: Slack CLI for Agents

https://github.com/stablyai/agent-slack
43•nwparker•1d ago•11 comments
Open in hackernews

CSS now has an if() conditional function

https://caniuse.com/?search=if
272•aanthonymax•2mo ago

Comments

aanthonymax•2mo ago
This support has appeared in the new W3C specification.
tantalor•2mo ago
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...
themafia•2mo ago
It's a great way to make conditional styles without having to use JavaScript; however, having used JS for years to make theme color and icon sets that rely on CSS properties, I'm not sure I particularly like this method. I feel like you have to smear a lot of logic across your CSS whereas with JS you can reduce your theme to a data structure and just have a simple function to setup all the CSS variables based on that.

Am I just an old man?

kevin_thibedeau•2mo ago
Just use SCSS to smear the logic across CSS automatically.
functionmouse•2mo ago
I like making static informational pages and don't know the first thing about JavaScript, so this could be handy for me.
mmis1000•2mo ago
Javascript always suffer from FOUC problem though (Unless it's server side). Although the if() css function seems to just be syntax suger of standard @media query. So it doesn't really add anything to solve existing problems.

Edited: It seems it can also be toggled from css variable? So it might actually fix some existing problems.

mikestorrent•2mo ago
How hard would it be to have a response header that tells the browser "don't display anything at all until we ask you to from JS when we're ready"?

Considering the kinds of crap that have been done with headers...

coke12•2mo ago
Many sites do something like that in practice. The problem is the extra 500ms of parse+eval time for your JS bundle influences user behavior a lot on the margin, so it’s better to not force the user to wait.
mmis1000•2mo ago
Practically only cordova does these for now. But it's a native app so of course it can do whatever it want.
Tajnymag•2mo ago
Would it be enough to have <body> hidden using an inline style in the initial html response and when everything is loaded, one would remove the style using javascript?
account42•2mo ago
How hard would it be to use JS for progressive enhancement instead making your website depend on it to display simple text and images.
bawolff•2mo ago
The primary goal is to just have a more concise way to do @media queries. Its not intended as a replacement for most uses of JS
6031769•2mo ago
If we've learned anything from the history of CSS, JS and the semantic web it is that 99% of the time a feature will be used in ways that were not intended. There is no reason to suppose that this will be any different.
sublinear•2mo ago
You have to consider why, and the answer was often "there's no other way".

The paths of least resistance on the web are now very different. These features were not delayed due to implementation details, but a deliberate shepherding of the standards. The most powerful features were saved for later and even still this is scoped to media queries, etc. only.

Denote6737•2mo ago
God forbid we use html5
assimpleaspossi•2mo ago
There is no HTML5 other than a buzzword: https://html.spec.whatwg.org/dev/introduction.html#is-this-h...?
pie_flavor•2mo ago
You're pulling the old man card on CSS-in-JS? Putting your style logic in CSS is what CSS is for, CSS-in-JS is an annoying hack to make React work. What this is replacing is SCSS.
masswerk•2mo ago
Well, historically, styles were first in JS (JS StyleSheets in Netscape 4.0) and were pulled out into CSS. – This is an old man card! ;-)
stevefan1999•2mo ago
With the inclusion of branches, is it possible to say that CSS is now even more Turing-Complete? Now we just need to find ways to do recursion/targeted jumps so that it is finally recursive-enumerable
ImHereToVote•2mo ago
Doom on CSS when?
anthk•2mo ago
You can maybe run ZMachine games (not just Zork, there are several better games there) under zmachine.ps, written in PostScript.

And, maybe, in a TTF font.

cluckindan•2mo ago
Don’t apply programming language mental models onto CSS features.

CSS if() probably just merges one of two single-property RuleSets onto the parent RuleSet depending on the condition, which has nothing to do with branching, as there is no execution flow to branch.

culi•2mo ago
Far from being ready when only one major browser supports it. If you want this, you should vote for it to be focused on for interop-2026

https://github.com/web-platform-tests/interop/issues

Right now, the leading CSS proposals are `@container style()`, `corner-shape` and `break-after`

https://foolip.github.io/interop-reactions/

hdjrudni•2mo ago
Yeesh.. I've definitely tried using break-after and being disappointed it didn't work properly. The amount of hoops I had to jump through to get things to print properly on paper...
fuzzfactor•2mo ago
>The amount of hoops I had to jump through to get things to print properly on paper...

Anybody know how that compares to Report Definition Language?

https://learn.microsoft.com/en-us/sql/reporting-services/rep...

Seems like an awfully scattered shitshow just to arrive at a typical "What You See Is Not What You Get" result.

And this one is made for printouts.

culi•2mo ago
Agreed. This has come up multiple times during my job. It's gotten to the point where we had a microservice running that spun up selenium and printed the dom and then sent that pdf back to the front-end all just to make consistent print outputs. I've read tech blogs of others doing just that too so it's not uncommon.

Unfortunately the test set of wpt does not have the capability to cover printed matter so relief isn't coming any time soon

StoneAndSky•2mo ago
The People have spoken, and they want squircles.
zb3•2mo ago
Not supported in Firefox and Safari. Also it seems most people forget that the more bloated the web platform is, the more resources are needed to develop and maintain a web browser engine.. Chromium is open-source, but it's already expensive to maintain a fork or even rebuild it..
lenkite•2mo ago
They just need to start deprecating and removing old features. They had no issues with XSLT removal even when some major sites like the library of congress used it. So the excuse of backward compatability has already proven to be a lie.
tgv•2mo ago
Yeah. Font-size and width, be gone!
lenkite•2mo ago
I think you mean "be gone" to only px based font-size right ? And instead of "width", use "inline-size". Instead of "height", use "block-size".
alwillis•2mo ago
> They just need to start deprecating and removing old features.

That's not going to happen.

They can't break millions of websites by removing old features. Besides, for the most part, current developers can ignore most of the old stuff.

But a site made in 1997 has to render on current browsers.

xnx•2mo ago
If we could do it over, knowing that we'd eventually get to this point, would https://en.wikipedia.org/wiki/JavaScript_Style_Sheets have been the better path?
runarberg•2mo ago
Probably not. There is a lot of optimizations browsers do to make the stylesheets super fast[1], and I think quite a few of those rely on CSS not being Turing complete.

1: https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-en...

Sesse__•2mo ago
CSS is Turing complete :-) You can find pure-CSS implementations of Game of Life, for instance.
cluckindan•2mo ago
I don’t think that’s true, unless you count hardcoding the state evolution into CSS variables, one var per cell per step.
runarberg•2mo ago
The implementations I have seen rely on the inclusion of HTML form elements, and a manual step to update the state.

So in that sense CSS + HTML + User Interaction is Turing complete. But that is a different language then CSS, even if a part of that language happens to be written in CSS.

Sesse__•2mo ago
https://propjockey.github.io/css-conways-game-of-life/infini... as an example. No user interaction except to start.
runarberg•2mo ago
This is impressive. 43000 lines of CSS. Do you know how this works?

EDIT: For the record, while I am very impressed, and this is a wonderful work of art we can all enjoy, I am not convinced this is proof of the Turing completeness of CSS. At most this would prove that CSS + HTML is Turing complete (which still better then CSS + HTML + User instructions in natural language). But I wonder if in these 43000 lines of CSS the entire state space was encoded (with some clever compression obviously), and I am not sure if that would count as proof of Turing completeness.

Sesse__•2mo ago
I haven't looked into it, but most of these tend to do clever tricks with CSS animations. https://dev.to/janeori/expert-css-the-cpu-hack-4ddj is by the same author, IIRC, and explains some of it.

CSS alone is not Turing-complete (AFAIK), because you don't have anywhere to attach state (the computed style) if you don't have a DOM and loops are generally prohibited. But CSS exists literally only to style a DOM, so I don't consider that all that much of a concession.

inopinatus•2mo ago
If I had a time machine I would go back and ensure that DSSSL (https://en.wikipedia.org/wiki/Document_Style_Semantics_and_S...) was the standard that got up.
runarberg•2mo ago
You write your markup in an xml syntax, your scripts in a C syntax, and your styles in a lisp syntax... a perfect trio.
watersb•2mo ago
All hail the embedded Scheme interpreter to apply Style transformations!

Although I feel like we've already explored this with XSL. The XML syntax was perhaps too much to swallow.

bawolff•2mo ago
I would say no. I think CSS is a good language and made good choices.

And honestly we already essentially have this with CSS related apis in js. The examples in that article are basically identical to how you set css in js on modern web browsers with slightly different naming conventions.

shiomiru•2mo ago
I actually wonder if transpiling calc/min/max/etc. expressions to JS is a viable path to implementation, considering that you already need a fast interpreter for these.
rcarmo•2mo ago
Knowing what we know, we would probably have stepped out of our time machine to make sure that Brendan Eich kept the Scheme-based syntax and added semantic HTML enrichment for styling, sparing untold grief over the last generation...
BrendanEich•1mo ago
I don't know what "semantic HTML enrichment" means, but there wasn't time. The alternative was VBScript and DHTML. DHTML and Netscape's DOM forked Web content based on `if (document.all) /* IE code here */; else /* netscape code here */`, and only with Firefox, Opera, and Safari founding whatwg.org and start HTML5 did we unify everything.
cestith•2mo ago
If we could do over, web browsers should have supported two document formats from the beginning - HTML for plain text markup and the preexisting Turing-complete formatting language of either PostScript or encapsulated PostScript.
mr_windfrog•2mo ago
I'm not really sure I understand this. How is the new if() conditional function different from using @media (width ...) when adapting layouts to browser width?
bawolff•2mo ago
Its basically the same, just more convinent syntax.

I think if can also do string equality on variable values, which is a bit new but also niche. The main point is just to do @media but inside a property decleration.

michaelcampbell•2mo ago
If I'm reading it right, the if condition/predicate can check more things than @media() can.
bingemaker•2mo ago
I'm not sure turning CSS into a full blown language is a good idea. With all the cascading in place, it is already a bit hard to determine why certain styles are applied. Now with this, we will be spending more brain cells debugging CSS issues.
lmm•2mo ago
On the contrary, a lot of the reason CSS is confusing is because it's full of insane hacks people have to do to get the behaviour they want. A straight-up if statement is much simpler than many of the horrors I've seen.
alwillis•2mo ago
>On the contrary, a lot of the reason CSS is confusing is because it's full of insane hacks people have to do to get the behaviour they want.

CSS is confusing because the vast majority of web developers never learned it properly. Many developers won't learn any "new" CSS (like CSS Grid which shipped in all browsers in 2017) beyond the hacks they learned in the '90s and early 2000's.

That's not the fault of CSS.

lmm•2mo ago
> CSS is confusing because the vast majority of web developers never learned it properly. Many developers won't learn any "new" CSS (like CSS Grid which shipped in all browsers in 2017) beyond the hacks they learned in the '90s and early 2000's.

Disagree. The newer stuff is, if anything, more confusing. The old stuff, awful as it was, at least had a consistent model.

alwillis•2mo ago
> Disagree. The newer stuff is, if anything, more confusing. The old stuff, awful as it was, at least had a consistent model.

With the "old stuff", we didn't a layout model or an alignment model. Everything required float and positioning hacks to do things they weren't designed to do. There's no logical way that was "better."

There were several different grid systems, all mostly incompatible with each other, which were required to do anything interesting.

Many layouts that are common today were impossible to do with just HTML & CSS back in '90s and 2000's.

Capabilities that almost all developers had to reach for a framework Bootstrap or Foundation for are built-in to CSS today. Or lots of JavaScript.

adgjlsfhk1•2mo ago
css definitely shouldn't have backwards branches (loops/recursive functions), but adding a little more power can clean up expression a ton and make reading/applying that much faster
lenkite•2mo ago
I wish the "little more power" would add CSS modules. It would also be great if web components didn't require Javascript and could be configured with pure HTML and CSS.

I will kiss the feet of the whatwg groups if they do this.

PS: Would also love to have declarative template inclusion now that removal of XSLT has also removed this facility from the browser.

silverwind•2mo ago
This is missing a "if variable equals" imho. Right now it seems like pure syntactic sugar for a media query.
ramesh31•2mo ago
>This is missing a "if variable equals" imho.

This is exactly what it does not need. SASS style conditional CSS is a complete nightmare to maintain. The declarative nature is one of its greatest strengths.

bawolff•2mo ago
Did you guys read the docs? It literally does have this albeit the syntax is a bit odd:

if(style(--foo: bar): baz)

Is how you test if variable --foo is equal to "bar"

See https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...

foreigner•2mo ago
Can these be used inside inline style attributes?
zuhsetaqi•2mo ago
It's a working draft and only available in Chromium ...
zkmon•2mo 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•2mo ago
We can blame von Neumann (et al) and his infernal architecture, where memory stores both instructions and data.
account42•2mo ago
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.
josefx•2mo ago
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.
amelius•2mo ago
You need more than if for Turing completeness though.
alexdns•2mo ago
Correct. You need at least 2 ifs.
spooky_deep•2mo ago
You need unbounded recursion no?
dotancohen•2mo ago
That's actually what two ifs could be.
knollimar•2mo ago
Was the case against the goto statement so good we can't mention it?
dotancohen•2mo ago
More or less, I meant how this would be inlined in assembly with a goto that could goto back where the branching originated from.
thwarted•2mo ago
You need conditionals and loops. Recursion counts as looping.
anthk•2mo ago
Or lambda. Or Forth commands. You can create an 'if' with few atoms.
tovej•2mo ago
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.

pragma_x•2mo ago
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.

holri•2mo ago
> The distinction between code, config and data is being erased.

This distinction never existed in LISP. Greenspun's tenth rule in action.

Galanwe•2mo ago
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.

Derbasti•2mo 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•2mo ago
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.

spooky_deep•2mo ago
Horrible. Would’ve been much nicer if they’d reached for Scheme.
debugnik•2mo ago
You 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•2mo ago
They don’t know how good they really have it :)
jimbokun•2mo ago
Why doesn't the OCaml build system use OCaml?
spooky_deep•2mo ago
You don’t want a language with non-determinism, arbitrary IO, impure functions etc. for build configuration ideally.

I guess the answer to your question is OCaml has unmanaged side effects.

pjmlp•2mo ago
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.

giamma•2mo ago
Ant did not include IF THEN ELSE, unless you added the contrib package.

If you understood the paradigm, you could write branches in Ant files simply using properties and guards on properties ("unless"). Using IF in Ant was basically admission of not having understood Ant.

This said, I used Ant for a very limited amount of time.

pjmlp•2mo ago
It sure did, you use conditions, no need for contrib.

https://ant.apache.org/manual/Tasks/condition.html

The else part is easily done by repeating and negating the condition.

Two other advantages of Ant that MSBuild lacks in a sane way to this day, are macros, and proper documentation.

bokchoi•2mo ago
As of Ant 1.9.1, you can use 'if' and 'unless' attributes on any task or element in a target. I stopped using Ant a long time ago, but this was a pleasant discovery when I had to pick up an old Ant based project recently.

https://ant.apache.org/manual/ifunless.html

pjmlp•2mo ago
Nice, I was basing my answer on what was there initially.

I always liked Ant, as I don't suffer from XML allergy.

giamma•2mo ago
I agree, that is what I meant: there were people who installed Contrib to have <if> element, but in reality you did not need that you could just use Ant's built-in features like you said. In my opinion installing Contrib to use <if> was a demonstration of not having understood how Ant works.
mrsmrtss•2mo ago
The legacy version of MSBuild was really bad, but the modern MSBuild project files for .NET are actually quite concise and clean by default?
pjmlp•2mo ago
Only if you are happy with defaults and don't require any build logic.

Also you forgot MSBuild is used for everything, not only .NET.

mrsmrtss•2mo ago
For new .NET SDK style projects you hardly ever need to customize the defaults and I know it's used for more stuff than .NET, but I just wanted to give an example where it actually doesn't suck. Also, you may not need to do everything in MSBuild, for some more complex stuff, you can use something like Cake (https://cakebuild.net/) in .NET for example and skip the programming in XML.
pjmlp•2mo ago
.NET made into my toolbox before it was announced to the world, thanks to be working at a MSFT partner that was selected to be part of the Portuguese launch event for .NET with ready made products.

Never seen any big corp using alternative .NET build tools, rather wrestling MSBuild, or before it came to be, nmake.

shevy-java•2mo ago
Wesnoth the game also has that via WML. Looks very ugly and obfuscated.
spooky_deep•2mo ago
CMake was never declarative AFAIK?

CMake today is effectively an eso-lang / Turing tarpit with some “modern” declarative conventions that people try to push.

ahartmetz•2mo ago
"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.
embedding-shape•2mo ago
> 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"?

zaphar•2mo ago
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.

embedding-shape•2mo ago
> Terraform has modules which are an elaborate method of doing function calls

... What? How is modules a function call? It's just a hierarchy, everything about/with modules is still declarative.

> HCL 2 has loops and conditionals. It is most definitely imperative.

So what? Just because there is loops and conditionals doesn't mean it's suddenly imperative.

How exactly you do loops in HCL? Last time I used it, you still used declarative configuration for that, and use `for_each` as an declared option, you don't "call for_each which returns config", all that happens inside of HCL/TF, because it is declarative.

Did something change like yesterday or are people even here on HN so ignorant about what declarative vs imperative actually means?

zaphar•2mo ago
You "call" a module with arguments. You can call them multiple times. In every way that matters they are just like a function call.

I don't understand why there is a distinction between for each in a standard language vs for_each in HCL2. They are both do something by iterating over something else at runtime. The syntax isn't what matters here.

I think maybe you are mistaken in your own distinction between declarative and imperative.

embedding-shape•2mo ago
Imperative: Tell the computer how to do something, by instructing it what to do.

Declarative: Tell the computer what you want the result to be like, and the computer figures out how to do it.

for_each in Terraform is very much declarative, just like modules. Compare how you'd do the same thing with JS or any other (imperative) language you know, and I think it must be clear what the difference between the two is.

zaphar•2mo ago
Those boundaries are pretty fuzzy. The complexity of the logic with conditionals and loops in a module means that you have pretty much stopped describing what it should like and instead described how to make it look the way you want it.

I have read terraform modules where I had to execute the logic to know what got produced which moves it from your imperative description to the declarative description as far as I'm concerned.

shevy-java•2mo ago
I think cmake kind of needs conditional checks though.
speed_spread•2mo ago
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
butlike•2mo ago
What's the old adage? Software expands until it can send email?
psychoslave•2mo ago
One reason I still love Ruby so much. It gives ability to easily define a DSL within a larger robust fully fledged language, and you can always tap on the larger ecosystem if needs evolve. This is a sharp contrast with starting something small from scratch (which might seems fine at the start), and later be on your own to scale things up as needs grow.
mseepgood•2mo ago
So why do people still design declarative languages?
lionkor•2mo ago
Wishful thinking? Maybe they are tired of all this and want to make something good again, and so the cycle continues.
noelwelsh•2mo ago
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.
xienze•2mo ago
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.

ahartmetz•2mo ago
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).
halfcat•2mo 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•2mo ago
You have to give it to CSS, it's held out for a lot longer than most.
rebane2001•2mo ago
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
shevy-java•2mo ago
But then why was it added?
magicalist•2mo ago
Because it's silly to rely on hard to read hacks when you could just add an if() function.
culi•2mo ago
Yup. 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•2mo ago
Those who don't use lisp are destined to re-invent it - poorly.
skywhopper•2mo ago
“Now”? This has always been the case.
qouteall•2mo ago
Configuration complexity clock

https://mikehadlow.blogspot.com/2012/05/configuration-comple...

zarzavat•2mo ago
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.

Starman_Jones•2mo ago
There is no recursive program that can't also be created by adding in more conditionals. It's turtles the whole way down.
jact•2mo ago
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.
goatlover•2mo ago
You can't add all possible conditionals for every kind of loop/iteration, such as dynamic and infinite.
cestith•2mo ago
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.
pjmlp•2mo ago
Unfortunely too many people are afraid of opening parentheses being posited on the far left instead of the middle of the text.
embedding-shape•2mo ago
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...
embedding-shape•2mo 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•2mo 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•2mo ago
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.
bmn__•2mo 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>

embedding-shape•2mo ago
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.
bmn__•2mo ago
The disadvantages are in the post I linked to.
embedding-shape•2mo ago
Alright, I guess I'll reply to that with another comment you can go and read then: https://news.ycombinator.com/item?id=38373081

Fun way of having a conversation.

shevy-java•2mo ago
> 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?

tr45872267•2mo ago
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.
ffsm8•2mo ago
Considering how this is seems to be designed... I don't think that's the reason?

I mean looking at the mdn docs it's just a replacement for regular other syntax https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...

So instead of having a css for x which defines e.g. dark mode and light mode separately, you can now define it via a single css rule.

Where previously the "tree" forked at the beginning and attributes were set multiple times, depending on various criteria - now you set it once, and evaluate it's value depending on criteria

    div {
      background-image: if(
        style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
        style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971);
        else: none;
      );
    }

It looks like simple syntactic sugar to me
tr45872267•2mo ago
I should have read the docs for it then. Thanks.
tambourine_man•2mo ago
Please provide evidence for that proof.
TheOtherHobbes•2mo ago
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.

cma•2mo ago
> with all the usual constructs available in both the display and markup layers.

I'm glad the transition to mobile web accelerated on more battery efficient GPUs was possible due to the model instead of Alan Kay's idea that websites should render themselves, where each website would have needed to be upgraded for GPU support for compositing.

butlike•2mo ago
As always, hindsight is 20/20, but when you're living it, the half-baked decisions and add-ons are a product of you figuring it out on the fly. You don't have the knowledge of which proposal will solidify into an industry standard, and you don't know which vestigial implementations will be a nightmare for backwards compatibility down the line.

The context is also lost. Javascript was famously coded in a day or whatever and called 'javascript' not ecmascript as marketing to compete with Java. Besides that well known case there's presumably thousands of esoteric business decisions made back then which shaped the "sprawling, ludicrous" landscape, and which are now lost to time.

Yes, the web should have always been a programming language. And the flying cars of 23xx should have never used a z-debuffer doodad.

niutech•2mo ago
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.

smsm42•2mo ago
Or they are performant now. But once people start writing CSS code the same way the write JS code, they stop to be. You can still write super-tight code in ASM (or eve C) and it will be blazing fast. Almost nobody does it, because it's too hard. Once people start writing CSS the same way, it'll become slow and bloated too.
zarzavat•2mo ago
The big performance sink in CSS is rule matching, or layout if you consider that to be part of CSS.

Efficient evaluation of expressions is a solved problem.

Having conditionals would actually improve performance because you can use fewer rules.

runarberg•2mo ago
I am not a CS expert, but this does not look like a full implementation of rule 110, nor is it even pure CSS (there is HTML involved).

What I see in the SO answer is an interface for Rule 110 with an additional set of instruction (written in a natural language) for the user to execute manually. So you can use CSS + HTML to create an interface for a Rule 110, which is then written in a natural language around that interface. The answer even states that (very relevant) caveat.

> [...] so long as you consider an appropriate accompanying HTML file and user interactions to be part of the “execution” of CSS.

niutech•2mo ago
SO comment:

> The formal definition (simplest) of Turing Machine is simply a tuple of states set, symbol set, initial state, accepting states set and a transition function. There is no crank in it. By computation we mean somebody needs to apply the transition function faithfully on the tape which is exactly like the clicking in this case. More formally, a model of computation can be viewed as a set of rules somebody needs to follow to do the computation. In that sense, I think CSS is Turing-Complete.

There is even a "CPU emulation" in pure CSS: https://dev.to/janeori/expert-css-the-cpu-hack-4ddj and pure CSS fetch: https://dev.to/janeori/100-css-fetch-and-exfiltrate-512-bits...

enbugger•2mo ago
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
embedding-shape•2mo ago
> 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.

psychoslave•2mo ago
Symbolic expression is one thing, I would personally find it rather cool to have more first class expression as building block everywhere. However I'm not found of using explicit parentheses all around. Even mandatory curly/square brackets are superfluous with a properly defined syntax ruleset.
azinman2•2mo ago
I find lisp to be a very non ergonomic language and am happy that python is the default.
jimbokun•2mo ago
Can you quantify that?
speed_spread•2mo ago
Let's just say that the weights of opening and closing parentheses do not cancel out.
SoftTalker•2mo ago
I've had way more issues with proper indentation in Python and YAML than I have with parenthesis in lisp. Meaningful whitespace is about the worst idea I've seen in a programming language.
jimbokun•2mo ago
You would need to show that, including the parens, the average Lisp program requires more tokens than Python.

I'm not sure that's true. Because Lisp has a lot of facilities for writing more concise code that are difficult to achieve without the parens.

velox_neb•2mo ago
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!
embedding-shape•2mo ago
> If mainstream lisp dialects used square brackets instead, we'd all be programming in it!

You've almost convinced/nerd-sniped me to write a(nother) new lisp where we'll be using brackets for forms and lists and no parenthesis in sight. It's a wild theory.

oifjoijoifj•2mo ago
It's just a reader macro, parse out quotes, other reader macros, then replace [ -> (, ] -> ) in the rest and throw into (read).
alwillis•2mo ago
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...

saghm•2mo ago
> 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.

oifjoijoifj•2mo ago
Regardless of should's or should not's, data is always code.
drcxd•2mo ago
Yeah, code is data, data is code. Every Lisp programmer knows that.
marcelr•2mo ago
can someone interpret this as not a skill issue?

i want better, declarative, interactive, fast UIs

CSS is the best answer we have

IngoBlechschmid•2mo ago
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".

pragma_x•2mo ago
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?
niutech•2mo ago
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
anon115•2mo ago
dont be such a doomer
kazinator•2mo ago
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.

paulddraper•2mo ago
Von Neumann devastated
ASalazarMX•2mo ago
I 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.

EmilStenstrom•2mo ago
Here is a much better link to how it works: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...
cubefox•2mo ago

  padding: 1em;
  padding: if(style(--size: "2xl"): 1em; else: 0.25em);
> Note: Remember to include the else condition. In if()-supporting browsers, if no else value were included and --size was not equal to "2xl", the padding would be set to initial.

This is counterintuitive. You would expect the above falls back to "1em" (from "padding: 1em;") when "else" is not specified. Instead, omitting "else" apparently means "else: initial".

kaelwd•2mo ago
That's the same as regular css variables unfortunately

    padding: 1em;
    padding: var(--padding);
With no fallback value that resolves to padding: unset if the variable is not defined. The only ways I know of to work around this are style queries:

    padding: 1em;
    @container style(--padding) {
      padding: var(--padding);
    }
Or cascade layers:

    @layer base {
      padding: 1em;
    }
    @layer override {
      padding: var(--padding, revert-layer);
    }
nottorp•2mo ago
So we were looking in the wrong direction for AGI!
nottorp•2mo ago
Replying to myself (hey, I like myself and I'd like to have a conversation with me):

CSS doesn't have it right? Just Chrome.

Considering how all kinds of "experts" have started to make web sites that only work fine in Chrome [1], this is not exactly a useful new feature, more like embrace and extend...

[1] Orange Romania, when will I be able to download my invoices again in Firefox?

jeroenhd•2mo ago
It's in the draft spec for the CSS Values and Units Module Level 5 (https://drafts.csswg.org/css-values-5/#if-notation)

I don't see Mozilla's or WebKit's positions anywhere, so this is a Chromium-only feature for now.

JimDabell•2mo ago
Curiously, Can I Use says:

> All major browser engines are working on implementing this spec.

However their official positions are absent:

https://github.com/mozilla/standards-positions/issues/1167

https://github.com/WebKit/standards-positions/issues/453

And Firefox’s bug for implementing it has no activity:

https://bugzilla.mozilla.org/show_bug.cgi?id=1981485

And Can I Use’s underlying data doesn’t have this note:

https://github.com/Fyrd/caniuse/blob/fedfb067aceccb2a5edadcc...

So it’s unclear why the Can I Use website is saying that everybody is working on it.

nottorp•2mo ago
Maybe the site is "AI" generated now.
Incipient•2mo ago
As long as css remains "so fast it's free" then I'm mostly happy with that - I use css without thinking about optimisations, and I like it like that!
Sesse__•2mo ago
You can certainly write slow CSS, and people do :-) JavaScript typically takes up more of the CPU time overall, though.
cryptonym•2mo ago
It's not free at all. You can profile it with debug tools and find the most expensive selectors to refactor them. You can also write CSS animations that impacts performance/user experience, this can also be profiled.

Sorry but if you use advanced feature and especially on a big DOM, you have to think about optimisations.

mmis1000•2mo ago
Well, you can actually write slow css if you make real deep nested flex container. And it's not even too rare. You can actually find such example in yhe wild.

The spec of flex layout requires it to layout its child elements several times to compute actual layout. Make it deep and nested without proper constrains will results in n*n*n*n… layout computations and bring down the browser on resize.

cluckindan•2mo ago
It’s not even that hard. Use flex for layout and you can instantly see how slow reflow becomes when resizing the window.
jsmailes•2mo ago
If I'm reading this correctly, Opera added support in an earlier version then took it away again. Any idea why they might have done it? Maybe a browser engine change under the hood?
tanin•2mo ago
Nice. I've built desktop apps in a few other frameworks e.g. Java Swing, JavaFX, JetBrains Compose, SwiftUI, QT. Nothing is as easy as JS/HTML/CSS. I've realized that the main reason is its robust capabilities e.g rich auto-layouting/positioning capabilities.

Meanwhile in other UI frameworks, you either don't do it or you draw the damn things yourself lol. So, most of the times I'd just not do it.

Adding if is great. It would reduce the need for JS a bit more, which would make the code more maintainable.

Aardwolf•2mo ago
Can it already vertically and horizontally center unknown-beforehand-length multi-line text in a single html element, just like non-CSS table cells could already in 1995?
_jzlw•2mo ago
align-content: center;

(supported on block elements since sometime last year)

Aardwolf•2mo ago
Thanks, seems to work at first sight in combination with text-align for the horizontal alignment!

That means I may finally not need line-height or multi-element tricks for this anymore

Interesting that this is finally there since a year!

I wonder what made them decide to support it finally, since CSS's creation in 1996.

A button never looks professional if the text in it isn't centered, this was a really needed feature and I still can't understand why it took that long

Edit: it does seem worrying that for me this property vertically centers but not horizontally while the description of it doesn't say vertical but is: "The items are packed flush to each other in the center of the alignment container along the cross axis."

_jzlw•2mo ago
> The items are packed flush to each other in the center of the alignment container along the cross axis

You're right, the entire Values section seems to still be worded exclusively for flexboxes. The description at the top adds "or a grid or block-level element's block axis".

JimDabell•2mo ago
> Can it already vertically and horizontally center unknown-beforehand-length multi-line text in a single html element, just like non-CSS table cells could already in 1995?

Non-CSS table cells have never been able to do that – you need a wrapping <table> at minimum for browsers to render it how you want, a <tr> for it to be valid HTML, and <tbody> comes along for the ride as well as an implied element. So that’s four elements if you want to centre vertically with <td> or <th>. If you wait until the year 2000, then you can get that down to three elements by switching from HTML to XHTML because <tbody> is no longer implied in XHTML.

CSS, on the other hand, has been able to do what you want since 1998 (CSS 2) with only two elements:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
    <title>.</title>
    <style type="text/css">

        html,
        body {
            height: 100%;
        }

        .outer {
            display: table;
            width: 100%;
            height: 100%;
        }

        .inner {
            display: table-cell;
            vertical-align: middle;
            text-align: center;
        }

    </style>
    <div class="outer">
        <div class="inner">
            Test<br>
            Test<br>
            Test<br>
            Test<br>
            Test<br>
            Test
        </div>
    </div>
(I’m using a <style> element here for clarity, but you can do the same thing with style attributes.)

https://www.w3.org/TR/1998/REC-CSS2-19980512/

1718627440•2mo ago
width: fit-content; margin: auto;
Aardwolf•2mo ago
That changes the width, I guess I should have specified fixed width
1718627440•2mo ago
What is a fixed with, that is not a has not a fix value?
Aardwolf•2mo ago
I mean elements with a width set in pixels, ems or some other unit. Setting width to 'fit-content' would override the width you set and then the element may overlap others to the right of it
1718627440•2mo ago
Then you just do width: <width in ems> em; ? I thought you didn't want to specify a width.
chipx86•2mo ago
I'm pretty happy to see this, as conditionals can really help keep code manageable when trying to define CSS variables or other properties based on combinations of light mode, dark mode, high-contrast, contextual state in a document or component, etc.

if() isn't the only way to do this, though. We've been using a technique in Review Board that's roughly equivalent to if(), but compatible with any browser supporting CSS variables. It involves:

1. Defining your conditions based on selectors/media queries (say, a dark mode media selector, light mode, some data attribute on a component, etc.).

2. Defining a set of related CSS variables within those to mark which are TRUE (using an empty value) and which are FALSE (`initial`).

3. Using those CSS variables with fallback syntax to choose a value based on which is TRUE (using `var(--my-state, fallback)` syntax).

I wrote about it all here, with a handful of working examples: https://chipx86.blog/2025/08/08/what-if-using-conditional-cs...

Also includes a comparison between if() and this approach, so you can more easily get a sense of how they both work.

bradly•2mo ago
I recently implemented dark/light mode for the first time and was really surprised to find that in order to add a toggle I had to duplicate a both of vars/styles and use JavaScript. I'm looking forward to not having to deal with that cruft in the future.
hebelehubele•2mo ago
You can do without javascript. Checkbox `:checked` + `label` trick for toggling states still works.

See: https://codepen.io/abdus/pen/bNpQqXv

bradly•2mo ago
Thanks, I’ll check this out!
hebelehubele•2mo ago
Here's a version with a 3-way theme selector (light / system / dark) using radio inputs.

https://codepen.io/abdus/pen/yyOQpvE

manucardoen•2mo ago
Somewhere, someone has just started porting Doom to CSS.
layer8•2mo ago
I guess we can now write Excel in CSS.
fuzzfactor•2mo ago
Interesting, a few organizations can (very) carefully craft their own LOB software over the number of years it can take to fully free themselves from Excel. And then realize the intended advantage for years to come.

At the same time over a period of years the web approach is to make the whole thing more like a bunch of interlocked Excels, more so than it already was before.

Does that mean any resulting disadvantage during following years is intentional? Any more than huge orgs grew to depend on Excel, one physical desktop at a time since that was the only thing in common among all those diverse desk owners that would do the job, plus it was the first thing to come along to fill that niche.

marcinignac•2mo ago
Proposed title change "Chrome now has an if() conditional function in CSS"
phplovesong•2mo ago
Now we just need a while loop to make it turing complete.
nake89•2mo ago
Loops would be nice. To make cool fireworks animations with CSS, you basically need to use SCSS to CSS compiler: https://codepen.io/hmaw/pen/qBEMLxV
qwertytyyuu•2mo ago
oh no, this is going to cause abomninations,
neuralkoi•2mo ago
Quick, someone get DOOM running on CSS!
James_K•2mo ago
How about giving me the option to use variables in media queries?
sethops1•2mo ago
Yeah this one seems like such low hanging fruit and would be a great convenience.
dsnr•2mo ago
Next I want to run WASM inside CSS. W3C, please don’t disappoint.
markaroo•2mo ago
if (it's fast) { i'm excited }
rcarmo•2mo ago
Is it Turing-complete yet? Seems close, but I've lost track.
bmn__•2mo ago
https://gwern.net/turing-complete#:~:text=CSS
hasbot•2mo ago
Huh. 35 year ago I was the sole maintainer of an in-house SQL-like database query language. The application was transforming relational data into a more concise and efficient format for use in an embedded application (AT&T 5ESS digital switch). All the mapping was done in this SQL-like language. One of my power users mentioned the difficulty they had in actually changing logic based on the values in the database. For example, to perform different logic based on whether a column was a 1 or a 2, they'd have to write two querys: one for 1 and another for 2. Possible, sure, but not very clean or efficient. To address this, I implemented an if() function.
shevy-java•2mo ago
They want to turn it into a programming language ... :/
zombot•2mo ago
How long before CSS can run Doom?
anthk•2mo ago
Nice, does it make turing complete? If so, another crap to block under Dillo.

That's what happens when you design a language by comitee (C++, JS) and try to do stuff in the web for a platform made to share static documents.

Just look at what kind of disasters the users faced with Office macros.

trollbridge•2mo ago
One of the nice things working in vite is realising, “hey, this config file is just {Java,Type}Script”.
vaylian•2mo ago
Not supported in Firefox
Pwntastic•2mo ago
just a meta note that the submitter, aanthonymax, likely only posted this to launder karma to avoid being shadowed for spamming their github project. a quick look at their post history shows that they only post links to their github project and then occasionally extremely low effort random mdn or other useless links to try to balance our their account. their previous account was shadowed for basically the same thing
matheusmoreira•2mo ago
This stuff makes me paranoid about posting my projects here and everywhere. Don't want to be seen as advertising my code...
Pwntastic•2mo ago
it's one thing to openly self-promote your project, and another thing to have created multiple accounts that spam links to your project on a weekly basis
moritzwarhier•2mo ago
I'm kind of thankful not having to work with people trying to be clever in CSS anymore (especially "clever" backend developers).

And I used to defend and evangelize taking HTML&CSS seriously in my previous roles, which I'd still do!

But as much as I have longed for features like these in the past (also: :has(), container queries, custom properties...), I dislike this.

I found CSS grid disappointing for most use cases.

I think :has() is a terrible idea, except for quick hacks.

I still think container queries and custom properties are good.

But, oh well, old man yelling at cloud.

mxey•2mo ago
Haven’t seen this mentioned yet, but this means you can do media queries in inline styles, right?