Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
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
220
That Looks Oddly Familiar
jan
0
440
Native Clojure
jan
0
250
Native Clojure with GraalVM
jan
0
780
Compiling a lisp into a lisp using a lisp
jan
0
170
Mutation testing in continuous delivery pipelines
jan
0
200
Self-contained systems: an introduction
jan
0
220
Let's just test that real quick
jan
1
430
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
300
Other Decks in Programming
See All in Programming
エディターってAIで操作できるんだぜ
kis9a
0
720
AIコーディングエージェント(skywork)
kondai24
0
160
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
愛される翻訳の秘訣
kishikawakatsumi
2
320
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.5k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
700
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
320
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.8k
TestingOsaka6_Ozono
o3
0
150
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Navigating Team Friction
lara
191
16k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Practical Orchestrator
shlominoach
190
11k
Building Adaptive Systems
keathley
44
2.9k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
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