3 ms·
I can't seem to find references for it right now, but there are severe advantages statically typed languages have over dynamically typed in terms of performance
by gchamonlive 8y ago
I can't seem to find references for it right now, but there are severe advantages statically typed languages have over dynamically typed in terms of performance and weakly typed over strongly typed in terms of safety. The stronger the type system in a language, the greater the array of type level optimizations the compiler can do.
There is simply no way of knowing enough to optimize when compiling a python script comparing to rust for example.
Language depth has a cost though in terms of raw productivity, that is why there are languages like matlab that are there simply for prototyping and nobody in their right mind would use it for production purposes
- jashmatthews 8y ago> There is simply no way of knowing enough to optimize when compiling a python script comparing to rust for example. JIT with type specialization can do exactly that. It's all about whether the runtime cost is worth it.
- gchamonlive 8y agoComparable to rust in terms of type level optimization? I am extremely curious about this and I want to know more, can you provide me with references?
- jashmatthews 8y agoThe JS JIT in WebKit used to use the same LLVM backend as Rust: https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit/ https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit/ This is one of the classic papers on type specialization in JIT: http://www.cs.williams.edu/~freund/cs434/gal-trace.pdf http://www.cs.williams.edu/~freund/cs434/gal-trace.pdf
- gchamonlive 8y agoThat is really cool thanks! I'm going to start reading