536 points · by skilled · 4y ago · 134 comments
After all, I remember what everyone said about Dropbox...
I think purist try to process the feeling by going on deflecting and denial, which is a personal reaction. A common one at that, but is not a popularity contest.
As for me, I am having a lot of fun seeing my coworkers cringe asking them the question. It is fun.
Starting, of course, with writing CSS in CSS.
(Recently saw a video with one of Thompson or Ritchie, IIRC. He described his mentor defining a language, defining that language in that language, then hand-translating that second definition into machine code. TMG -- transmogrifier.)
I thought it was banned for this very reason.
So I'd guess that your implementation could work with a few modifications on iOS, as the worklets aren't hidden behind a compile time feature flag.
Kudos to you, this is exactly why I removed the worklets from my retrokit fork :)
(Yeah, everyone doubted Dropbox, but everyone doubted every other successful and unsuccesful company out there in its early stages. People doubting a company isn't much of a signal. Even in its early stages Dropbox had a clear monetization and growth strategy.)
Dropbox was doubt. The response you're seeing isn't doubt or skepticism. The responses are proclaiming that your technical claim is factually incorrect. They're right - your premise is false. You know you can't connect using CSS, which is what the quoted text at the top regarding recruiters clearly states, and you changed the wording: "using CSS" vs "in CSS."
With enough contortions and breaking GET idempotency you could probably do a whole CRUD app with just that.
While I appreciate the "shipostedness" in fulfilling the task "connect to DB in CSS" by cramming whole SQL database into CSS custom property and working with it using paint worklet (this would probably not even remotely cross my mind ever), with more pragmatic approach I don't see requirement of having actual database in the CSS in the original tweet, so single boring URL endpoint reading the SQL query from parameter and responding with CSS à la `:root { --result: 'whatever'; }` should accomplish given task as well, without those Houdini's stunts:
@import "sql.css?query=Robert')%3B%20DROP%20TABLE%20Students%3B--"
body::before { content: var(--result); }
(I guess browsers do URI encoding anyway, so probably no need to encode it by hand).Or perhaps even more simple with render to image (like `<!..><svg ...><text>whatever</text></svg>`.
body::before { content: url(sql.svg?query=...); }
That paint worklet does something similar anyway, but instead of `background: paint(…);` this would be `… url(…)`.If JS and/or strictly static server-side is a must, the sql.css / sql.svg could be handled by a service worker with that sql-asm.js at disposal.
Or maybe it doesn't even need (a separate) one, because all a Turing machine needs is some other 'networking machine' to be looking at some designated area on tape (I'm describing DMA essentially, I suppose)? And maybe what else happens externally in response to what's on the designated tape area is uninteresting/completely arbitrary and doesn't need to/inherently can't be formally modelled?
I think of this very informally as having not only for() loops with fixed bounds on the loop index, but also while() loops where you don't know beforehand how many loops it will take to compute something. Alternatively you can express the same thing in terms of recursion. One characteristic is that it's possible to describe computations that never finish. Another is that you cannot always tell from looking at a particular program if it will ever finish.
Exactly how or if the result of a computation becomes apparent to the outside world, I think is not part of the theoretical description.
Its just a driver for CSS written in the host language (JS).
There's nothing similar in this CSS example, unless I missed it. (I do believe it can be done, the idea is "there" - you need to invent a syntax to declare connection details, error handling, etc; and then you can indeed argue that the .js part is just the "driver")
But yeah, this is probably more charitably described as “A CSS interface for SQL written in Javascript.”
"ext/mysqli is just a PHP interface for SQL written in C"
What is the difference
So, in the strictest sense, "yes really".
When CSS becomes Turing-complete it seems that even NoScript won't help me from nefarious web pages.
The linked StackOverflow answer does not preclude adding more memory cells. It was just capped at 900 for an arbitrary reason.
Brainf** is famously Turing Complete and can be executed on any desktop you can think of. That alone is enough to prove that your desktop itself is Turing Complete.
https://lemire.me/blog/2011/03/08/breaking-news-htmlcss-is-t...
It's just JavaScript that interacts with SQLite and uses CSS API's to render the results
Would love to know ahead of time if someone's just going to flee when I say something stupid. :)
If I write a React template that embeds the CSS that embeds this Javascript, whose job is it to untangle my mess when I leave the company?
Start with HTML 1.0 so you don't have to support CSS inside that HTML.
> As the name might suggest, this is how you connect to a database using CSS. It only works in Chrome, unfortunately.
Now we know why Firefox isn't widely used for more advanced websites and why tons of Chrome-based browsers exist.
Someone could use that to hook in a utility css framework.
Unless it's coming from the NSA who just wants more attack surface, I don't see the point...