toji / gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps
glmatrix.net
MIT License
5.37k stars 721 forks source link

[AssemblyScript] gl-matrix port to WebAssembly #420

Open StEvUgnIn opened 3 years ago

StEvUgnIn commented 3 years ago

Hi everyone, I am working since yesterday on the port of gl-matrix to WebAssembly.

Define objectives are:

I will publish as soon as I have a solid draft to present :) But the code of gl-matrix is concise, not too shaby for JavaScript code, easily portable to TS/AS environments.

StEvUgnIn commented 3 years ago

Don't hesitate to share your feedback on my ongoing work here

stefnotch commented 3 years ago

Out of curiosity, how will garbage collection be handled?

StEvUgnIn commented 3 years ago

Garbage collection makes more sense in bigger projects. Memory is handled manually on Webassembly by the programmer. You have a ton of projects porting C/C++, JavaScript, Rust to Webassembly.

Webassembly is designed to work alongside JavaScript. That means that the binary needs glue code to be able to run in an application (client or server).

After research, the AssemblyScript team is bringing some experimental support for GC. Here is a link https://www.assemblyscript.org/runtime.html

trusktr commented 3 years ago

AssemblyScript has automatic GC currently.

StEvUgnIn commented 3 years ago

Thanks for your explanation @trusktr 🙂

StEvUgnIn commented 3 years ago

https://travis-ci.org/github/toji/gl-matrix/builds/764734352 😎

StEvUgnIn commented 3 years ago

@stefnotch @trusktr @pyrotechnick @AlexMax https://github.com/toji/gl-matrix/pull/421#pullrequestreview-626668492