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
88
0
Share
Medusa - Final Draft - PyCon India 2014
The final draft for my presentation at PyCon India, 2014
Rahul De
September 21, 2014
More Decks by Rahul De
See All by Rahul De
What if your databases never forgot
lispyclouds
0
430
Bob: A composable and inclusive CI/CD Platform
lispyclouds
0
260
Native CLI tooling with Clojure on GraalVM
lispyclouds
0
70
Building native CLI tools with Clojure on GraalVM
lispyclouds
3
240
Other Decks in Technology
See All in Technology
Unlocking the Apps
pimterry
0
160
個人AIからチームAIへ:開発における品質と生産性の再設計
moongift
PRO
0
350
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
1.6k
先取りMaven4 ~16年ぶりのメジャーアップデート、その進化とは?~
ogiwarat
0
120
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
120
Datadog 認定試験の概要と対策
uechishingo
0
220
Strands Agents超入門
kintotechdev
1
150
BigQuery の Cross-cloud Lakehouse への歩み
phaya72
2
330
Chart.js が簡単に使えるようになっていたので OGP 画像生成に使った話
kamekyame
0
120
Diagnosing performance problems without the guesswork
elenatanasoiu
0
150
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
150
Claude Codeですべての日常業務を爆速化しよう!
minorun365
PRO
17
16k
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
240
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Tell your own story through comics
letsgokoyo
1
940
The untapped power of vector embeddings
frankvandijk
2
1.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
550
Design in an AI World
tapps
1
220
Docker and Python
trallard
47
3.9k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Designing for Performance
lara
611
70k
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?