-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a page about a JIT/Optimization library idea. #265
Conversation
@@ -179,6 +179,56 @@ should support: | |||
* Code unloading capabilities, especially in the context of code garbage | |||
collection and defragmentation. | |||
|
|||
## Optimization and JIT library | |||
|
|||
WebAssembly's JIT interface will likely be fairly low-level, exposing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Just-in-Time compilation" for the first mention.
I agree with the general direction (wordsmithing separate), but I think the title isn't quite accurate, and this section should be much higher in this document, if not in another document or even self-standing. Referring to the extensible web manifesto is what I've defaulted to so far, and you somewhat echo it (add a callout!) while giving concrete examples (great, I'd keep them in). I think @titzer may disagree with the math functions though. In #264 I tried to clarify what he thought was important while making sure it reflected the entire discussion we'd had. I think #264 is a good increment (capture more background), whereas this PR will need a bit of discussion we're all on board: it's a pretty fundamental principle and I'd like to get a few more people agreeing first. |
I'm conflicted on this PR. On the one hand, defining a new higher-level Not that I disagree that a JIT library is a bad goal; I think it's On Fri, Jul 17, 2015 at 7:13 PM, JF Bastien notifications@github.com
|
As for optimizations, the specific kinds of information about operations that are useful to optimizers are:
In particular, most of the trigonometric functions under consideration have some important properties that optimizers will want to use. If we're talking about a JIT library, then one important question is whether the JIT is generating raw wasm to feed to an unmodified wasm engine or an improved "custom" wasm, or whether it internally is working on a different representation of the code than the underlying engine. I think we want to avoid a design where we have two complex JITs in operation, one in the library, and one in the engine. |
I think "custom wasm extensions" is indeed one of the places this is going. It'd be similar to a polyfill; a library optimizes and then lowers extensions into standard wasm before delivering them to the underlying implementation. Popular extensions could even be promoted into standard wasm, if appropriate. At the same time, C/C++ compilers do trigonometric optimizations before translation to wasm. I expect Java/C#/etc. will often do so too, since popular implementations optimize their own IL. So while I expect there is a need for a JIT/Optimization library, I don't think it necessarily indicates a deficiency in wasm itself. |
Would you be OK moving the discussion of a JIT library into another document? The worry here is that FutureFeatures sounds somewhat official and we might want to avoid committing to something too early. |
Ok. It's also starting to grow big enough where putting it in its own document is a good idea anyway. |
@titzer This PR has now been updated to move the discussion of a JIT library into another document. Would you mind taking another look? |
e342566
to
fc93b34
Compare
This also obviates the need for the floating point library function section.
Particularly in the area of applications dynamically generating code, experimentation will allow us to determine which features are most appropriate.
@titzer: Ok. I've now updated the opening paragraph and the third paragraph along the lines you suggested. Would you mind taking another look? Thanks! |
lgtm On Thu, Aug 20, 2015 at 12:48 AM, Dan Gohman notifications@github.com
|
Merging based on lgtm above and no other objections. |
Add a page about a JIT/Optimization library idea.
Following up on the suggestion in #264, here is my PR proposing my idea for a JIT and optimization library, which while not being part of the spec, would be important in allowing us to keep the WebAssembly spec itself simple, general-purpose, and providing primitive operations.