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
72
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
320
Bob: A composable and inclusive CI/CD Platform
lispyclouds
0
210
Native CLI tooling with Clojure on GraalVM
lispyclouds
0
47
Building native CLI tools with Clojure on GraalVM
lispyclouds
3
170
Other Decks in Technology
See All in Technology
Vertex AI を中心に 生成AIのアップデートを共有します
kaz1437
0
300
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
0
160
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
540
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
110
Postman v10リリース後を振り返る / Looking back at Postman v10 after release
yokawasa
1
160
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
4
900
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
190
反実仮想機械学習とは何か
usaito
PRO
11
4.1k
20240416_devopsdaystokyo
kzkmaeda
1
220
JSON攻略法.pdf
miyakemito
8
4.9k
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
350
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
25
5.8k
RailsConf 2023
tenderlove
4
540
Ruby is Unlike a Banana
tanoku
96
10k
Teambox: Starting and Learning
jrom
128
8.4k
What's in a price? How to price your products and services
michaelherold
237
11k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Code Reviewing Like a Champion
maltzj
514
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Building Applications with DynamoDB
mza
88
5.6k
Making Projects Easy
brettharned
108
5.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
227
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
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?