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
190
That Looks Oddly Familiar
jan
0
370
Native Clojure
jan
0
210
Native Clojure with GraalVM
jan
0
730
Compiling a lisp into a lisp using a lisp
jan
0
150
Mutation testing in continuous delivery pipelines
jan
0
160
Self-contained systems: an introduction
jan
0
170
Let's just test that real quick
jan
1
390
Combating spam, or how I befriended the Killer Rabbit of Caerbannog
jan
0
280
Other Decks in Programming
See All in Programming
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
220
Alba: Why, How and What's So Interesting
okuramasafumi
0
230
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
270
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
29
4.6k
Vue.jsでiOSアプリを作る方法
hal_spidernight
0
110
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
2.1k
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
430
2025.01.17_Sansan × DMM.swift
riofujimon
2
630
Flatt Security XSS Challenge 解答・解説
flatt_security
0
790
Package Traits
ikesyo
2
220
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
940
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
160
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
52k
Making the Leap to Tech Lead
cromwellryan
133
9k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Code Reviewing Like a Champion
maltzj
521
39k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
890
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
How STYLIGHT went responsive
nonsquared
96
5.3k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
260
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
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