Git Product home page Git Product logo

Comments (6)

chrisdickinson avatar chrisdickinson commented on June 12, 2024

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.

mattdesl avatar mattdesl commented on June 12, 2024

Cool idea, especially SIMD. It would be attractive as a Babel plugin even outside of this framework.

from glo.

xeolabs avatar xeolabs commented on June 12, 2024

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.

gregtatum avatar gregtatum commented on June 12, 2024

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.

reminyborg avatar reminyborg commented on June 12, 2024

+1 for arrays. I remember toji's glmatrix used arrays for speed.

from glo.

coderitual avatar coderitual commented on June 12, 2024

Don't even think about not using arrays :)

from glo.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.