4 ms·
A js -> c compiler would actually be much, much slower than current JITs because of the lack of type information.
by spion 11y ago
A js -> c compiler would actually be much, much slower than current JITs because of the lack of type information.
- randyrand 11y agoJust declare a C union of an int, float, string, etc. All functions take these unions as function parameters. Have one field be an enum of its actual type. Or something along these lines. I don't see why this is any more difficult than a normal jit that also doesnt have type information.
- comex 11y agoBecause JITs are able to generate code that optimistically assumes variables have certain types (with appropriate deoptimization checks), which is much less expensive than performing full dynamic lookups on every single operation.