3 ms·
How is this different to Javascript? They both get jitted to native code (v8, llvm)...what's the benefit?
by smegel 13y ago
How is this different to Javascript? They both get jitted to native code (v8, llvm)...what's the benefit?
- trentmb 13y ago> what's the benefit? I don't have to write JavaScript.
- trothamel 13y agoIt also adds the ability to have, for example, multi-threaded code. That's especially nice when it lets you avoid having to port old code from threads to an event-driven model.
- ahomescu1 13y agoPNaCl bitcode is (mostly) statically-typed and has a C-like memory model, as opposed to dynamically-typed JavaScript. Dynamic typing has a run-time performance cost, and so does garbage collection.
- eru 13y agoAre you sure that PNaCl bitcode is typed at all?
- ahomescu1 13y agoIt's kind-of typed. They kept the basic integer and floating-point types from LLVM (i8, i32, i64, double) and pointers, but removed structures and arrays. It's "more typed" than JavaScript, but less than C++. This still means that numeric code (working with integers and floats) is going to be at least an order of magnitude faster than on JS.