News for hackers. Stuff that matters.
Re:Shift.js: Swift to JavaScript Transpiler by spion on Friday November 06, 2015 @07:46PM (#10523022)
A js -> c compiler would actually be much, much slower than current JITs because of the lack of type information.
Re:Shift.js: Swift to JavaScript Transpiler by randyrand on Saturday November 07, 2015 @05:31AM (#10524385)
Just 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.

Re:Shift.js: Swift to JavaScript Transpiler by comex on Saturday November 07, 2015 @06:56AM (#10524527)
Because 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.