4 ms·
I would like to understand why JavaScript semantics have allowed for a lot of performance, but Python semantics hasn't.
by gugagore 3y ago
I would like to understand why JavaScript semantics have allowed for a lot of performance, but Python semantics hasn't.
- eigenspace 3y agoI'm actually not very experienced with JavaScript, but my understanding is that it comes down to that Python's foreign function interface is tightly bound up with the implementation details of CPython. This means that unless you want to lose access to the whole Python ecosystem, your JIT compiler needs to jump through an impossible series of hoops to support existing libraries As far as I understand, in practice, JavaScript code relies less on foreign function interfaces to code that's written in other languages (because you can't reliably do that in a browser). This point makes it so that important JavaScript packages tend to be written in JavaScript, whereas important Python packages tend to be written in C or Fortran or Rust or whatever. If a JIT compiler for Javascript changes how FFI works, then that's less big of a deal. Again though, not very knowledgable about JavaScript, so if someone wants to come and correct me, or offer additional context, I'd be very appreciative.