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
80
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
400
Bob: A composable and inclusive CI/CD Platform
lispyclouds
0
240
Native CLI tooling with Clojure on GraalVM
lispyclouds
0
62
Building native CLI tools with Clojure on GraalVM
lispyclouds
3
200
Other Decks in Technology
See All in Technology
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
7.6k
OPENLOGI Company Profile for engineer
hr01
1
33k
MobileActOsaka_250704.pdf
akaitadaaki
0
110
AIとともに進化するエンジニアリング / Engineering-Evolving-with-AI_final.pdf
lycorptech_jp
PRO
0
150
SmartNewsにおける 1000+ノード規模 K8s基盤 でのコスト最適化 – Spot・Gravitonの大規模導入への挑戦
vsanna2
0
120
Backlog ユーザー棚卸しRTA、多分これが一番早いと思います
__allllllllez__
1
130
OPENLOGI Company Profile
hr01
0
67k
Model Mondays S2E03: SLMs & Reasoning
nitya
0
330
Core Audio tapを使ったリアルタイム音声処理のお話
yuta0306
0
180
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
5
680
20250625 Snowflake Summit 2025活用事例 レポート / Nowcast Snowflake Summit 2025 Case Study Report
kkuv
1
410
Tech-Verse 2025 Global CTO Session
lycorptech_jp
PRO
0
1.6k
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Designing for Performance
lara
610
69k
Fireside Chat
paigeccino
37
3.5k
Bash Introduction
62gerente
614
210k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
For a Future-Friendly Web
brad_frost
179
9.8k
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?