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
Embedded DSLs em Python - Python Sudeste 02/092016
Search
Elias Tandel
September 02, 2016
Programming
0
52
Embedded DSLs em Python - Python Sudeste 02/092016
Elias Tandel
September 02, 2016
Tweet
Share
More Decks by Elias Tandel
See All by Elias Tandel
Intensivão de Encoding
etandel
0
37
Medindo distâncias astronômicas
etandel
0
35
Embedded DSLs em Python - PythonRio 28/05/2016
etandel
0
89
Software Livre
etandel
0
30
Other Decks in Programming
See All in Programming
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
Oxlintはいいぞ
yug1224
5
1.3k
MUSUBIXとは
nahisaho
0
130
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
CSC307 Lecture 07
javiergs
PRO
0
550
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
CSC307 Lecture 03
javiergs
PRO
1
490
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
55
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
47
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
90
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
290
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
エンジニアに許された特別な時間の終わり
watany
106
230k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
Being A Developer After 40
akosma
91
590k
Accessibility Awareness
sabderemane
0
49
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]