News for hackers. Stuff that matters.
Re:Beautiful JavaScript – Functional JavaScript by crooked-v on Sunday December 25, 2016 @08:46PM (#13256445)
Take a look at asm.js. It's a subset of JS that uses de facto type annotations to let the JIT compiler get tremendous performance gains compared to normal JS - benchmarks put it at something like 1/2 the speed of raw C.

The problem, of course, is that (among other complications) you need to generate it from something that's completely strictly typed in order to do that in the first place, so most asm.js-compatble code is actually just generated anyway based on C or a similar language.

Re:Beautiful JavaScript – Functional JavaScript by ced_vdb on Sunday December 25, 2016 @08:50PM (#13256456)
What about typing added on top of javascript for that purpose. Like typescript.
Re:Beautiful JavaScript – Functional JavaScript by crooked-v on Sunday December 25, 2016 @09:17PM (#13256551)
Typescript doesn't go far enough yet for asm.js code. It would need much more fine-grained types, like specific kinds of numbers instead of a single 'number' type.