Hacker News new | ask | show | jobs
by korch 5771 days ago
I don't think it's such a great thing that the freshmen linear transforms for 3d manipulation are finding their way into the top-most level of the web stack(Javascript + CSS)

These transforms are already built into the the lowest level in the video hardware and accessed directly through specialized drivers.

While the imaginative side of me wants nothing more than to see web designers go buckwild with 3d, the engineer side of me want to congratulate everyone on slowing down the web even more.

2 comments

No, no, a thousand times no to your whole outlook here. If powerful general APIs are provided, people will build the (hopefully open source even) abstractions on top which wrap those up in cute, easy-to-read, easy-to-use bundles of functionality. JavaScript should have access to some real binary data type, should have some general APIs for doing fast math on those types, should have direct-ish access to APIs like cryptography and data compression, &c.

The reason that the web is built on a giant pile of hacky taped-together spaghetti (to mangle some metaphors) is that instead of providing access to real low-ish level features, every browser has had its own special set of half-baked high-level APIs and leaky abstractions.

So, for example, I hope that WebSocket stays as simple as possible, the way it is now (the way Ian Hickson argues for it to stay), instead of sprouting complex authentication, encryption, specialized compression, various multiplexing and tricky framing features, &c. &c. on top (as the Java community and the IETF mailing list on the subject keep bickering about).

The worst thing that can happen for the language and its community of developers is to continue to be treated as second-class novices who need our hands held and must be guided through APIs providing the precise features envisioned by some enlightened browser vendor. If instead we’re treated like adults, there are plenty of really really smart JavaScript coders who will be happy to experiment with abstractions on top of the language and give the high-level website developers awesome tools, which can evolve and grow over time. We should be making it possible in the language John Resig to build jQuery and processing.js, rather than making it easy for Joe Random Developer to access some specific high level thing in as few lines as possible.

Like you say, 3D matrix transforms are already included in the low-level graphics APIs that are increasingly being used to accelerate element compositing in modern browsers. So why not make this functionality available to web content creators through CSS?

When you're on the GPU, rendering a quad with plain old scale+translate is just as fast as rendering it with a full 3D transform (with the important twist of potentially increased texture sampling and edge antialiasing requirements, of course).