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
Medusa - Final Draft - PyCon India 2014
Search
Rahul De
September 21, 2014
Technology
0
84
Medusa - Final Draft - PyCon India 2014
The final draft for my presentation at PyCon India, 2014
Rahul De
September 21, 2014
Tweet
Share
More Decks by Rahul De
See All by Rahul De
What if your databases never forgot
lispyclouds
0
410
Bob: A composable and inclusive CI/CD Platform
lispyclouds
0
250
Native CLI tooling with Clojure on GraalVM
lispyclouds
0
66
Building native CLI tools with Clojure on GraalVM
lispyclouds
3
230
Other Decks in Technology
See All in Technology
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
400
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
660
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
120
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
230
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
360
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
580
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
470
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.5k
Webhook best practices for rock solid and resilient deployments
glaforge
1
290
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
150
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
190
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Are puppies a ranking factor?
jonoalderson
1
2.7k
Side Projects
sachag
455
43k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Code Review Best Practice
trishagee
74
20k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
A Tale of Four Properties
chriscoyier
162
24k
4 Signs Your Business is Dying
shpigford
187
22k
Odyssey Design
rkendrick25
PRO
1
500
Transcript
Project Medusa PYCON INDIA / 2014 / BANGALORE
About Me Rahul De Developer, Foodie, Movie Enthusiast and a
Snake Charmer
Medusa She’s Faster, Stronger and Kills with One Look! http://github.com/rahul080327/medusa
What she isn’t An ugly terrifying monster Just another Python
Implementation Slow
What she is Runs Python Faster Compiles to Dart Uses
JIT and hotspot Extendable and Scalable
Demo 1: The Pledge HELLO WORLD
Demo 2: The Turn THE FIBONACCI SERIES
Demystifying Medusa TOWERS OF HANOI
A Python Script hanoi.py
The Cache (C++/SQLite 3) STEP 1
InFile (Primary Key) Hash GenCode <absolute file path> <SHA 256>
<dart code> “/home/Heisenberg/ hanoi.py” “345AEFF…” “import ‘dart:io’…”
The Compiler (Python) STEP 2
Python 2.7 Source Python AST Module AST Node Visitior Framework
Dart Code Generator for every Node/Optimizer Final Stitched/ Optimized Dart Code
The Python AST Module Module FunctionDef ‘TOH’ [n, x, y,
z] Stmt If Compare (n, >, 0) Stmt CallFunc ‘TOH’ [n - 1, x, y, z] Stmt CallFunc ‘TOH’ [n - 1, z y, x] CallFunc ‘TOH’ [25, 1, 2, 3] The Abstract Syntax Tree for hanoi.py
AST Node Visitor Framework FunctionDef ‘TOH’ [n, x, y, z]
Stmt If Compare (n, >, 0) Stmt CallFunc ‘TOH’ [n - 1, x, y, z] Stmt CallFunc ‘TOH’ [n - 1, z y, x] The FunctionDef node being visited
Optimised Dart Code Generator def TOH (n, x, y, z):
if n > 0: TOH (n - 1, x, z, y) TOH (n - 1, z, y, x) TOH (n, x, y, z) { if (n > 0) { TOH (n - 1, x, z, y); TOH (n - 1, z, y, x); } }
Final Stitched Dart Code import “file:////Users/Heisenberg/.medusa/lib/inbuilts.dart”; ! TOH (n,x,y,z) {
if (n > 0) { TOH((n - 1), x, z, y); TOH((n - 1), z, y, x); } } ! main() { TOH($n(25), $n(1), $n(2), $n(3)); }
Demo 3: The Prestige SOLVING TOWERS OF HANOI
The End The Prestige Images © Warner Brothers, Christopher Nolan
and respective owners.
Questions?