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
78
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
370
Bob: A composable and inclusive CI/CD Platform
lispyclouds
0
220
Native CLI tooling with Clojure on GraalVM
lispyclouds
0
60
Building native CLI tools with Clojure on GraalVM
lispyclouds
3
180
Other Decks in Technology
See All in Technology
ドメイン名の終活について - JPAAWG 7th -
mikit
32
19k
Intuneお役立ちツールのご紹介
sukank
3
770
FOSS4G 2024 Japan コアデイ 一般発表25 PythonでPLATEAUのデータを手軽に扱ってみる
ra0kley
1
140
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
140
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
140
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
110
組み込みLinuxの時系列
puhitaku
4
1.1k
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
130
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
450
データの信頼性を支える仕組みと技術
chanyou0311
6
1.7k
エンジニア候補者向け資料2024.11.07.pdf
macloud
0
4.6k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
KATA
mclloyd
29
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Designing Experiences People Love
moore
138
23k
Why Our Code Smells
bkeepers
PRO
334
57k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Navigating Team Friction
lara
183
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Automating Front-end Workflow
addyosmani
1366
200k
Gamification - CAS2011
davidbonilla
80
5k
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?