LWN.net Logo

Topaz: a new Ruby implementation

Topaz: a new Ruby implementation

Posted Feb 6, 2013 19:00 UTC (Wed) by yokem_55 (subscriber, #10498)
Parent article: Topaz: a new Ruby implementation

Great that it is fast. The question is (and always seems to be with new implementations of dynamic languages), will it still be fast once it more completely does everything that real programs expect the language to do?


(Log in to post comments)

Topaz: a new Ruby implementation

Posted Feb 6, 2013 20:16 UTC (Wed) by tnoo (subscriber, #20427) [Link]

For Python there ist Cython. This piece of software is simply phantastic. Develop in Python, add some static type declarations here and there, and order of magnitude speedups are easily acheivable.
For many applications this is the perfect fit: interactive development in a nice language, pure C-power for the performance-critical sections.

Maybe Pypy can acheive similar (or better?) results without mixing languages?

Topaz: a new Ruby implementation

Posted Feb 6, 2013 21:32 UTC (Wed) by davide.del.vento (guest, #59196) [Link]

Topaz: a new Ruby implementation

Posted Feb 6, 2013 21:52 UTC (Wed) by tnoo (subscriber, #20427) [Link]

CPython != Cython
The first is the standard implementation in C, the second (cython.org) is is a way to write C-extension modules almost inline (by adding static type declarations), and can easily link into C programs.

Topaz: a new Ruby implementation

Posted Feb 7, 2013 13:57 UTC (Thu) by gwolf (subscriber, #14632) [Link]

I might not be following you correctly... But what you describe sounds pretty much like Ruby's Inline gem/module/library/whatever-name-you-fashion, which allows you to mix snippets of C within the body of Ruby code.

Of course, Ruby is not prone to be a speed demon, but this also helps get the critical code done in a fast language.

Topaz: a new Ruby implementation

Posted Feb 24, 2013 11:30 UTC (Sun) by JanC_ (guest, #34940) [Link]

Cython allows you to write Python-like code that has (optional) type annotations and other ways to help the Cython compiler to create faster code than would be possible when compiling pure Python without a JIT (a JIT as used in PyPy can take advantage of knowing what type is used at runtime).

So it's not about inlining C code, but an alternative to writing C modules/gems/whatever.

Topaz: a new Ruby implementation

Posted Feb 6, 2013 21:42 UTC (Wed) by dave_malcolm (subscriber, #15013) [Link]

I would expect it to be fast on real code: PyPy is very much about optimizing real-world idiomatic code, rather than microbenchmarks.

From my reading of the sources topaz gets a tracing JIT compiler "for free" via the RPython toolchain (magically injected via
the jitdriver.jit_merge_point in the bytecode dispatch loop here:
https://github.com/topazproject/topaz/blob/master/topaz/i... )

Looking at the topaz source tree, the only benchmark (so far) looks reasonable to my (non-Ruby-expert) eyes:
https://github.com/topazproject/topaz/blob/master/bench/b...

(disclosure: I'm an occasional PyPy contributor)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds