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
590
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Jan Stępień
See All by Jan Stępień
graalvm-jug-bb
jan
1
250
That Looks Oddly Familiar
jan
0
480
Native Clojure
jan
0
280
Native Clojure with GraalVM
jan
0
810
Compiling a lisp into a lisp using a lisp
jan
0
190
Mutation testing in continuous delivery pipelines
jan
0
220
Self-contained systems: an introduction
jan
0
260
Let's just test that real quick
jan
1
470
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
330
Other Decks in Programming
See All in Programming
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
320
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
110
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
350
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
840
New "Type" system on PicoRuby
pocke
1
480
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
450
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
450
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
BBQ
matthewcrist
89
10k
How GitHub (no longer) Works
holman
316
150k
New Earth Scene 8
popppiees
3
2.3k
Visualization
eitanlees
152
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
350
Abbi's Birthday
coloredviolet
2
7.9k
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