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
Jan Stępień
June 12, 2013
Programming
1
540
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
200
That Looks Oddly Familiar
jan
0
390
Native Clojure
jan
0
220
Native Clojure with GraalVM
jan
0
740
Compiling a lisp into a lisp using a lisp
jan
0
150
Mutation testing in continuous delivery pipelines
jan
0
170
Self-contained systems: an introduction
jan
0
180
Let's just test that real quick
jan
1
400
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
280
Other Decks in Programming
See All in Programming
Do Dumb Things
mitsuhiko
0
430
ベクトル検索システムの気持ち
monochromegane
31
9.9k
趣味全開のAITuber開発
kokushin
0
200
Java 24まとめ / Java 24 summary
kishida
3
490
gen_statem - OTP's Unsung Hero
whatyouhide
1
200
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
630
プロダクト横断分析に役立つ、事前集計しないサマリーテーブル設計
hanon52_
2
410
「影響が少ない」を自分の目でみてみる
o0h
PRO
2
1k
エンジニア未経験が最短で戦力になるためのTips
gokana
0
270
Kubernetesで実現できるPlatform Engineering の現在地
nwiizo
3
1.9k
AI時代の開発者評価について
ayumuu
0
120
The Weight of Data: Rethinking Cloud-Native Systems for the Age of AI
hollycummins
0
270
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.1k
Bash Introduction
62gerente
611
210k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
520
Practical Orchestrator
shlominoach
186
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Building Adaptive Systems
keathley
41
2.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
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