3 ms·
I agree with pretty much all of what you said. One thing I might change though, is that I'd prefer a copy-on-write (COW) metaphor for WebWorker and SharedArrayB
by zackmorris 8y ago
I agree with pretty much all of what you said. One thing I might change though, is that I'd prefer a copy-on-write (COW) metaphor for WebWorker and SharedArrayBuffer, similar to how Clojure state works. So you'd pass an array by value, but there would be no performance penalty unless values are mutated. I'd also like to eliminate shared state between threads and switch to channels like how Go or Erlang work. These should also be COW.
I feel that HTML/CSS is an evolutionary dead end. People think in terms of tables when they do desktop publishing. So forcing them to translate to CSS and back is a task for compilers, not humans. Most people working in web development today are too young to remember that this was all a solved problem in the 80s with WYSIWYG. We let the asynchronous nature of the internet determine the architecture of our markup, which was a mistake in hindsight.
I'd vote to rearchitect the web to be synchronous and run under a single-threaded runtime that makes no distinction between front and back end. Then let the runtime handle representational state transfer, a bit like Rsync but for the DOM. This would work like virtual memory (so the developer wouldn't have to worry as much about where state resides) and executation would block until a remote procedure call (RPC) is lazily evaluated deterministically without timeout or having to remain always connected.
Then with that prerequisite implemented, we could revisit fluid layout in a formal way, derived from first principles. This might mean transpiling things like SCSS variables to non-turing complete grammars (context-free grammars) like CSS. I'm a little foggy on the terminology for this so someone please correct me if I have it wrong.
In other words, we should be able to derive the position of our elements from other positions. So we should have a markup language like:
elementX.center.x = body.center.x
elementX.width = body.width/2
myX = elementX.right
elementY.left = myX + 1
But this would only be processed in one-shot mode. I think a markup like this could be created on top of HTML/CSS but it could be difficult due to quirks.
Without basic metaphors like these, web development can never move from being a craft to a field. It will forever be reduced to hand waving and having to drink the kool-aid. Which is fine for now, but will add increasingly more friction as the web development market gets more saturated.