Comments (3)
At the moment the first goals were to port Three.js to AS, and get it to run the demo that is detailed here:
https://docs.google.com/document/d/1CojZ_Rry3a1rQnXf8KJcSiOGodTP905CVRsU-uiWQjo/edit?usp=sharing
As a first pass, we're just copying both source and test files, and not modifying logic or making performance improvements.
This i our first time using AS, so it is a learning experience.
We would love to have performance improvements, but it will be nice to do this after the initial porting, so we can weigh the difference (not only in performance, but in type safety and maintainability).
For instance, Matrix4 would be much better off as a single heap allocation, so that copying can just be a single memory.copy() function call
We hadn't thought about any of that. We're literally just porting the code as verbatim as we can, but inevitably a few things had to be changed to make it compile in AS (f.e. convert object literals to class instances).
there are runtime checks for each set and get to validate the indexes don't go out of bounds
This seems like a good feature. I value performance, but at the same time I'd like for people to be able to easily understand the code and not make mistakes.
Many of the changes that you describe probably won't impact end-users, but they might make the code more difficult understand (further away from) JavaScript. I'd like for people to open any file, and propose changes using basic JavaScript knowledge (with only few tweaks needed like classes instead of object literals).
If we, for example, store matrix values as properties, how would code that needs to iterate on the values look like? Will it still be a regular for loop? Can someone make a mistake and go out of bounds?
How does it affect intellisense?
from glas.
Closing, but we can keep discussing here.
from glas.
Make it work first with a fully functional test suite, then refactor to make faster
from glas.
Related Issues (20)
- mention how to import spec files in CONTRIBUTING.md HOT 2
- ESLint HOT 9
- Incomplete Build Process
- wire up AS-to-JS function passing, write a unit test for it. HOT 2
- Should Use `asconfig.js` file instead of cli within `package.json` HOT 1
- transferring objects from thread to thread, and/or modifying across threads
- Eventually switch from Matrix4 to the web-standard DOMMatrix.
- CubeCamera HOT 1
- WebGLRenderTarget
- WebGLRenderTargetCube
- OrthographicCamera
- Webassembly in nodejs HOT 2
- WebGLShadowMap
- WebGLProgram
- WebGLAnimation HOT 1
- WebGLPrograms
- WebGLObjects
- WebGLGeometries
- WebGLInfo
- WebGLShader HOT 2
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 glas.