Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Topaz is Ruby in Python
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jan Stępień
June 12, 2013
Programming
1
570
Topaz is Ruby in Python
Slides from a talk about Topaz I delivered on 12.06.2013 at Munich Ruby Users Group meetup.
Jan Stępień
June 12, 2013
Tweet
Share
More Decks by Jan Stępień
See All by Jan Stępień
graalvm-jug-bb
jan
1
230
That Looks Oddly Familiar
jan
0
450
Native Clojure
jan
0
260
Native Clojure with GraalVM
jan
0
790
Compiling a lisp into a lisp using a lisp
jan
0
180
Mutation testing in continuous delivery pipelines
jan
0
210
Self-contained systems: an introduction
jan
0
230
Let's just test that real quick
jan
1
440
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
310
Other Decks in Programming
See All in Programming
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
3
300
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
CSC307 Lecture 07
javiergs
PRO
0
550
今から始めるClaude Code超入門
448jp
7
8.4k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
CSC307 Lecture 09
javiergs
PRO
1
830
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
130
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Agile that works and the tools we love
rasmusluckow
331
21k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
56
50k
The Limits of Empathy - UXLibs8
cassininazir
1
210
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
エンジニアに許された特別な時間の終わり
watany
106
230k
Design in an AI World
tapps
0
140
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
47
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Are puppies a ranking factor?
jonoalderson
1
2.7k
Transcript
Topaz is in Ruby Python
Hi, my name is Jan Stępień
Topaz is a Ruby implementation written in Python
Topaz is a Ruby implementation which is faster
Ruby Topaz is a bird from South America
cc-by-sa-3.0 geimfyglið
Topaz is in Ruby Python
cc-by-sa-3.0 geimfyglið
cc-by-nc-sa-2.0 marie
Why? would you implement Ruby in Python?
Python CPython PyPy
Ruby MRI JRuby Rubinius
PyPy is a Python implementation
PyPy is amazingly fast See http://speed.pypy.org
PyPy is written in RPython
RPython is a subset of Python
RPython can be statically compiled to C
RPython is optimised for implementing VMs
PyPy is an impl. of Python PyPy is written in
RPython RPython is compiled to C
Topaz is an impl. of Ruby Topaz is written in
RPython RPython is compiled to C
git clone http://github.com/topazproject/topaz
$ cd topaz && cloc . Language files code Python
132 22934 Ruby 35 5058
$ time ./bin/topaz_untranslated.py 3.times { puts :hello } ˆD hello
hello hello real 0m3.539s
$ cd topaz $ python \ .../pypy/rpython/bin/rpython \ -Ojit targettopaz.py
RPython → C
None
$ time ./bin/topaz 3.times { puts :hello } ˆD hello
hello hello real 0m0.050s
freqs = [0] * 256 while buf = $stdin.read(8192) buf.bytes.each
do |b| freqs[b] += 1 end end p freqs
MRI 2.0 36,1 s 5,0 MB/s JRuby 1.7.2 24,8 s
7,3 MB/s Topaz 3,3 s 55,3 MB/s 180MB of data served from caches
50 100 150 Input size [MB] 10 30 20 0
Time [s] M RI JRuby Topaz
Topaz redefines what fast means in the Ruby world
Why is it so fast? PyPy!
Meta-tracing just-in-time compilation
None
Get the source and try for yourself
Is Topaz a Ruby-Python interoperability bridge? No, unfortunately it’s not.
Topaz is still very young
Contributing is easy
See also 096 RR Topaz with Alex Gaynor Introducing Topaz
– Tim Felgentreff topazruby.com
dankeschön dziękuję ślicznie