I wonder how much compiler optimization we could do under the hood. It could also increase performance in cross-platform environments. For example all Melon.js API calls are an abstraction over the native APIs, so we could write our library for melon.js, and then at compile time we could remove the melon.js library all together from their code and replace their function calls with native API functions for better performance.
This would also be cool because we could compile for other targets more easily like console or mobile without any performance penalties besides the JS runtime itself (meaning no melon library to load and no bridge needed at runtime between the melon JS internals and the native APIs)
This does sound like it could be a lot of work but I think it would be a super nifty feature if anyone feels like figuring out how to do this. I'm currently doing research on doing this on one of my libraries so I might write an update on what I've learned.
I wonder how much compiler optimization we could do under the hood. It could also increase performance in cross-platform environments. For example all Melon.js API calls are an abstraction over the native APIs, so we could write our library for melon.js, and then at compile time we could remove the melon.js library all together from their code and replace their function calls with native API functions for better performance.
This would also be cool because we could compile for other targets more easily like console or mobile without any performance penalties besides the JS runtime itself (meaning no melon library to load and no bridge needed at runtime between the melon JS internals and the native APIs)
This does sound like it could be a lot of work but I think it would be a super nifty feature if anyone feels like figuring out how to do this. I'm currently doing research on doing this on one of my libraries so I might write an update on what I've learned.