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
DSL - Domain Specific Languages
Search
Jean Carlo Emer
March 05, 2012
Programming
2
380
DSL - Domain Specific Languages
Gerenciamento de métodos, operadores e ações para construção de linguagens no escopo do programa.
Jean Carlo Emer
March 05, 2012
Tweet
Share
More Decks by Jean Carlo Emer
See All by Jean Carlo Emer
Web & Mobile
jcemer
1
180
Thinking metrics on React apps
jcemer
0
150
Cache em aplicações web
jcemer
0
280
Aplicações Web - um estudo sobre React
jcemer
1
180
Lapidando o Globo Play
jcemer
1
250
Desenvolvedor mobile precisa aprender Web
jcemer
1
100
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
600
Tudo o que a web (podia ser) ainda será
jcemer
8
600
Embarque App
jcemer
0
470
Other Decks in Programming
See All in Programming
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
120
ニーリーにおけるプロダクトエンジニア
nealle
0
740
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
440
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
1
4.4k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
370
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
39
8.3k
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1k
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
0
300
GraphRAGの仕組みまるわかり
tosuri13
8
520
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
Select API from Kotlin Coroutine
jmatsu
1
220
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
Featured
See All Featured
Visualization
eitanlees
146
16k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Designing for Performance
lara
609
69k
Scaling GitHub
holman
459
140k
The Language of Interfaces
destraynor
158
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Transcript
DSL Domain Specific Languages Jean Carlo Emer
Linguagem que se presta a resolver um problema específico.
Muitas já não são? Ruby, PHP, JavaScript, XSL, PostScript, Emacs
Lisp...
1.Invente uma sintaxe DSL e construa um interpretador ou compilador.
2.Molde uma linguagem existente adicionando ou alterand o métodos, operadores, e ações padrões.
LISP "permite criar" DSL Construção da linguagem no escopo do
programa.
with Employee "123-45-6789" do salary -1000 warn :misconduct end
• 100% objetos / não, não é a OO de
Java • 100% aberto / DSL? • Indicadores de Métodos / ? ! = []= • Parênteses podem ser omitidos
• Numeric 1, 2, 3.1 • String "String" • Symbol
:Symbol • Array [1, 'string', 3, [], {}, "oi"] • Hash {'tabela' => 'valor'} • Regexp /regexp/
class Pessoa attr_reader :nome, :idade def initialize(nome, idade) @nome, @idade
= nome, idade end end
class Pessoa def >(pessoa) self.idade > pessoa.idade end end puts
Pessoa.new("-", 22) > Pessoa.new("--", 44)
4.months + 3.weeks + 2.days
4.months() + 3.weeks() + 2.days()
4.months()+(3.weeks()+(2.days())) Faz sentido? A propósito, é nome de filme, assistam!
class Fixnum def impar? self%2 == 1 end end 0.impar?
class Tabuleiro def [](lin, col) col *= 2 (@linhas[lin] &
(Peca::Qualquer << col)) >> col end end t[0,1] = Peca::Branca
class Pessoa def method_missing(m, *args, &block) puts "Ninguém chamado #{m}
por aqui " end end Pessoa.new.jeancarloemer @variable ||= "valor padrão"
class String def *(s) ... end end "a" * "ba"
Já existe "a"*3 que resulta em "aaa"
Fim!
[email protected]
inf.ufrgs.br/~jcemer @jcemer