logoalt Hacker News

skybriantoday at 2:33 PM2 repliesview on HN

As a programmer I’m wondering how you get a decent graphics library out of it. If it’s conceptually better, shouldn’t it make writing code to do calculations easier?


Replies

itishappytoday at 3:33 PM

It can write some fascinating stuff, but you have to learn to think in it:

https://enkimute.github.io/ganja.js/examples/coffeeshop.html

A major problem is that its a very general theory. Most calculations turn into very large but very sparse matrix multiplications. To make them work fast requires code generation and an optimization pass.

These types of optimization problems show up all over graphics programming though:

* Representing rotations with matrices takes more space than quaternions.

* Sacrificing a dimension to projective geometry actually makes representing things like projections (duh) but also translations more efficient.

sreantoday at 2:51 PM

> shouldn’t it make writing code to do calculations easier?

You need an optimizing compiler that would take the high level description and compile it to add subtract multiply divide of reals. I don't think we have that yet.

Till we have such a compiler it will be tempting to drop down to assembly. Assembly being a metaphor.