Comments (6)
Posted this on Twitter, but on second thought it'd be good to record here: I think the array format is probably the "right way" to write vectors for minimal {un,}marshalling at module boundaries, though it's somewhat uncomfortable. Given the success JSX has seen wrapping a rather unpalatable base-type in syntactic sugar, it might be good to see about writing a JS transform that makes matrix operations on arrays more natural. As a bonus, as things like SIMD land, it could automatically transpile code to use those optimizations.
from glo.
Cool idea, especially SIMD. It would be attractive as a Babel plugin even outside of this framework.
from glo.
I'm totally regretting using objects instead of arrays within SceneJS, since I always need to convert back and forth in order to use standard math functions (eg. glMatrix), which in many cases also incurs garbage collection overhead.
In my next engine I'm using arrays for everything and it's just so much cleaner!
from glo.
The transform idea sounds intriguing. I think it would need enough pay off to justify that overhead though. I'd love to see some use-cases written out. I'm still torn between objects vs. arrays myself. It's so much easier to write and read object syntax, but when I'm thinking in terms of data structures and array buffers I think in terms of arrays. When I'm moving a box around a scene I think in terms of object syntax.
from glo.
+1 for arrays. I remember toji's glmatrix used arrays for speed.
from glo.
Don't even think about not using arrays :)
from glo.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glo.