3 ms·
"GraalVM runs Ruby about 10x faster than standard Ruby, for example." Which puts it roughly up against the plateau I observe for dynamically-typed languages ac
by jerf 8y ago
"GraalVM runs Ruby about 10x faster than standard Ruby, for example."
Which puts it roughly up against the plateau I observe for dynamically-typed languages across the board, except LuaJIT (which AIUI compromises the dynamicness a bit to get there). Ruby is a great deal more than 10x slower than optimal (which is still roughly C, though keep an eye out on that as languages continue to challenge it).
Based on the way Erlang works, I wouldn't expect it to get much past two times faster than it already is no matter how much money is poured into it.
I remember hearing the line about how there are no slow languages, only slow implementations, back in the early 2000s, when we didn't have any implementations of dynamic scripting languages that had really had a lot of effort poured into them, by modern standards. In 2018, we have numerous such implementations with vast, vast amounts of work poured into them. They are faster than they used to be... and they are still meaningfully slower than optimal. (And eat about 10-20x times the RAM in the process.) Erlang doesn't do all the bad things that Python or Ruby do to make them slow, but it does add a lot of memory copying that Python and Ruby don't do, and which is probably not as reducible as you'd like no matter how you optimized it (the low-hanging fruit, after all, is already in current Erlang).
To be honest, if you like Erlang but you need the next step up in performance and are willing to lose a few guarantees to get there (a very common tradeoff in optimization, after all), the answer is Go, not waiting for a much faster Erlang. Go is significantly faster than Erlang, Go does not have Erlang's memory isolation, and these statements are deeply connected together, not just coincidence.
- pjmlp 8y agoNone of them had the research money that JavaScript has enjoyed though. Also lets not forget C was quite slow in 8 and 16 bit systems, and it only became as fast thanks to the joy of UB and -O3.
- igouy 8y ago>> … no slow languages, only slow implementations … dynamic scripting languages… "Scripting languages are designed for gluing." https://ieeexplore.ieee.org/document/660187/ https://ieeexplore.ieee.org/document/660187/ "Programming languages are compared against each other as though their designers intended them to be used for the exact same purpose - that just isn't so." https://benchmarksgame-team.pages.debian.net/benchmarksgame/dont-jump-to-conclusions.html#apples-and-oranges https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- jashmatthews 8y agoWhat about Common Lisp using SBLC? That's dynamically typed and amazingly fast. LuaJIT is simply a very good optimizing JIT compiler. It's just as dynamic as Lua. BEAM is a register-based bytecode VM, which is dramatically slower than native code. The fast JS implementations either don't bother with a bytecode VM (V8) or baseline compile to native after only a few iterations (WebKit) because bytecode VMs simply can't compete with a chunk of native code. 2018 MRI Ruby is ~14x faster than 2006 Ruby depending on how you measure. Neither Python nor Ruby have seen anywhere near the resources put into JS engines over the past 10 years. Oracle dumped a ton of money into making the JVM support dynamic languages and now Graal is bringing full Java performance to both Ruby and Python. It's not really inherent language design flaws that make it difficult to optimize Ruby and Python (they don't do anything "bad") but the community dependence on compatability, particular with C extensions. PyPy does a ton of crazy stuff to maintain compatability that then hurts performance, like faking reference counts etc.
- igouy 8y ago>> SBCL Was `jerf` opining about "dynamically-typed languages" or just about "dynamic scripting languages"? It matters. >> inherent language design flaws Not "design flaws" but design goals -- Scripting languages are designed for gluing.