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
560
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
210
That Looks Oddly Familiar
jan
0
410
Native Clojure
jan
0
240
Native Clojure with GraalVM
jan
0
750
Compiling a lisp into a lisp using a lisp
jan
0
160
Mutation testing in continuous delivery pipelines
jan
0
190
Self-contained systems: an introduction
jan
0
200
Let's just test that real quick
jan
1
420
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
290
Other Decks in Programming
See All in Programming
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
280
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
130
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.1k
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
130
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
280
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
33k
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
730
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
NPOでのDevinの活用
codeforeveryone
0
790
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
660
Featured
See All Featured
Speed Design
sergeychernyshev
32
1k
Faster Mobile Websites
deanohume
307
31k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The Invisible Side of Design
smashingmag
301
51k
It's Worth the Effort
3n
185
28k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
960
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Fireside Chat
paigeccino
37
3.5k
Music & Morning Musume
bryan
46
6.6k
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