4 ms·
They just moved a computationally intensive task to a much faster language. Not as large scale as moving everything from Rails to Scala in the case of Twitter f
by aboutruby 8y ago
They just moved a computationally intensive task to a much faster language. Not as large scale as moving everything from Rails to Scala in the case of Twitter for instance, but pretty standard is any large Rails application to use faster languages for performance sensitive tasks.
- outworlder 8y agoThere are no 'fast languages'. Just fast implementations. This distinction is important.
- marcosdumay 8y agoYou won't get anything near the performance of a usual Rust code by optimizing some CPython code. It doesn't matter how much you try.
- icebraining 8y agoWho said anything about CPython? Pypy can get close to C speed, so I doubt it can't get anywhere near Rust.
- marcosdumay 8y agoWell, Pypy doesn't allow the same language as CPython. It has a lot of similarity, but it's not the same.
- dagw 8y agoPyPy will get you a 10-time speed up over pure Python in real-world code on a good day. While that is nice, it's not close to C.
- jhayward 8y agoCPython being an implementation of the Python encironment.
- goatlover 8y agoYeah, but some languages are designed with performance in mind and others are not. So while people have made faster implementations of JS, Python, Ruby, etc over time, they're at a disadvantage compared to languages like C/C++, Fortran and Rust. You can't really compete with a good compiler for those languages, which is why WebAssembly, Julia and Crystal exist.
- recursive 8y agoThere are languages which don't permit fast implementations. You might consider a "fast language" to be one for which it's possible to write a fast implementation.
- firethief 8y agoNow you have me thinking about whether it would be possible to design a non-fast language--that is, a language resistant even to tracing JIT. Programs in this language would have to defy the usual pattern of having hot loops that can be compiled once and run repeatedly. That seems to imply that operators must change behavior as they're repeated. In the typical machine model that's only suitable for a toy language, but it might make sense for a language the somehow compiles to neural net logic...
- gchamonlive 8y agoI 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