LWN.net Logo

Topaz: a new Ruby implementation

The Topaz project, which is creating a new Ruby implementation done in RPython, has announced its existence. "Because Topaz builds on RPython, and thus much of the fantastic work of the PyPy developers, it comes out of the box with a high performance garbage collector, and a state of the art JIT (just-in-time) compiler. What does this mean? Out of the box Topaz is extremely fast."
(Log in to post comments)

Topaz: a new Ruby implementation

Posted Feb 6, 2013 19:00 UTC (Wed) by yokem_55 (subscriber, #10498) [Link]

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?

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)

Topaz: a new Ruby implementation

Posted Feb 6, 2013 20:17 UTC (Wed) by dmitrij.ledkov (subscriber, #63320) [Link]

Since it's based on PyPy, it cannot load any compiled extensions or bindings to compiled libraries, can it?

Topaz: a new Ruby implementation

Posted Feb 6, 2013 21:20 UTC (Wed) by luto (subscriber, #39314) [Link]

PyPy has full support for ctypes and supports other approaches as well [1].

[1] http://doc.pypy.org/en/latest/extending.html

Topaz: a new Ruby implementation

Posted Feb 7, 2013 3:55 UTC (Thu) by cibyr (subscriber, #87609) [Link]

They claim to be "extremely fast", but don't provide any benchmarks...

Name

Posted Feb 7, 2013 9:39 UTC (Thu) by epa (subscriber, #39769) [Link]

The name 'Topaz' was already used by a project to reimplement Perl in C++: http://topaz.sourceforge.net/

Name

Posted Feb 7, 2013 14:45 UTC (Thu) by whitemice (guest, #3748) [Link]

What?! An Open Source project that made no effort to select an effectively distinct names?!?!?!? The world just ended.

Name

Posted Feb 7, 2013 15:58 UTC (Thu) by gedeon (guest, #21965) [Link]

To their defense, from my quick glance at it, the project you point to has not seen any activity for the past 12 years...

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