Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Embedded DSLs em Python - Python Sudeste 02/092016
Search
Elias Tandel
September 02, 2016
Programming
62
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Embedded DSLs em Python - Python Sudeste 02/092016
Elias Tandel
September 02, 2016
More Decks by Elias Tandel
See All by Elias Tandel
Intensivão de Encoding
etandel
0
45
Medindo distâncias astronômicas
etandel
0
42
Embedded DSLs em Python - PythonRio 28/05/2016
etandel
0
100
Software Livre
etandel
0
35
Other Decks in Programming
See All in Programming
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
AWSに止められる覚悟してますか?
morizo_1984
2
530
すこし踏み込む CancellationToken
htkym
2
1.7k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
270
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
APNsからLive Activityを開始する話
yumnumm
0
170
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Speed Design
sergeychernyshev
33
2.2k
Transcript
EDSLs em Python Elias Tandel (@etandel) Python Sudeste 02/09/2016
DSL?
DSL? • Linguagem formal
DSL? • Linguagem formal • Não necessariamente de programação
DSL? • Linguagem formal • Não necessariamente de programação •
Geralmente não turing-completa
DSL? • Linguagem formal • Não necessariamente de programação •
Geralmente não turing-completa • Focada em um tipo de problema (domínio)
DSL? • Linguagem formal • Não necessariamente de programação •
Geralmente não turing-completa • Focada em um tipo de problema (domínio) • Simples?
Exemplos
Pros vs Cons • Validação a nível de domínio •
Abstração otimizada para o problema • Custo de aprendizado • Custo de manutenção
Embedded vs External
Embedded vs External • Se utiliza da sintaxe de uma
linguagem de propósito geral (host) • Criada do zero: parser, compiler / interpreter etc.
Embedded vs External • Se utiliza da sintaxe de uma
linguagem de propósito geral (host) • Preso à sintaxe do host • Criada do zero: parser, compiler / interpreter etc. • Extremamente flexível
Embedded vs External • Se utiliza da sintaxe de uma
linguagem de propósito geral (host) • Preso à sintaxe do host • Reutiliza ferramental do host • Criada do zero: parser, compiler / interpreter etc. • Extremamente flexível • Ferramentas também devem ser criadas do zero
Embedded • Rápido de prototipar
Embedded • Rápido de prototipar • Você provavelmente já usou
pelo menos uma: ORM
Embedded • Rápido de prototipar • Você provavelmente já usou
pelo menos uma: ORM • Diferença para lib / framework não é clara
Embedded • Rápido de prototipar • Você provavelmente já usou
pelo menos uma: ORM • Diferença para lib / framework não é clara • “Torce” a sintaxe
Python? • Sintaxe pouco flexível: – Chamadas sempre com ()
vs Ruby – Operadores fixos vs Haskell
Python? • Sintaxe pouco flexível: – Chamadas sempre com ()
vs Ruby – Operadores fixos vs Haskell • Objetos muito flexíveis: – Metaclasses – Meta-object protocol
DEMO • Patterns - https://github.com/etandel/pattern- matching-dsl • JSONBender - https://github.com/Onyo/jsonbender
Resumo • EDSLs podem ajudar muito • Não tenha medo
de usar o que python te oferece – Sobrecarga de operadores – Decorators – Metaclasses – Descriptors – Context managers
Obrigado https://etandel.xyz
[email protected]
[email protected]