Suche senden
Hochladen
Internal DSLs Scala
•
0 gefällt mir
•
669 views
Z
zefhemel
Folgen
My brief talk about my attempt to build an internal version of the WebDSL language.
Weniger lesen
Mehr lesen
Technologie
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 29
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
Taeho Kim
Introduzione JQuery
Introduzione JQuery
orestJump
레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?
Taeho Kim
Kotlin: Let's Make Android Great Again
Kotlin: Let's Make Android Great Again
Taeho Kim
Javascript
Javascript
orestJump
Unfiltered Unveiled
Unfiltered Unveiled
Wilfred Springer
My First Ruby
My First Ruby
Murray Steele
8. Php MongoDB stergerea unui document
8. Php MongoDB stergerea unui document
Razvan Raducanu, PhD
Empfohlen
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
Taeho Kim
Introduzione JQuery
Introduzione JQuery
orestJump
레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?
Taeho Kim
Kotlin: Let's Make Android Great Again
Kotlin: Let's Make Android Great Again
Taeho Kim
Javascript
Javascript
orestJump
Unfiltered Unveiled
Unfiltered Unveiled
Wilfred Springer
My First Ruby
My First Ruby
Murray Steele
8. Php MongoDB stergerea unui document
8. Php MongoDB stergerea unui document
Razvan Raducanu, PhD
PureScript & Pux
PureScript & Pux
Arthur Xavier
Html5 appunti.0
Html5 appunti.0
orestJump
6. Php MongoDB adaugarea unui document
6. Php MongoDB adaugarea unui document
Razvan Raducanu, PhD
Intro to F#
Intro to F#
Kristian Hellang
Scala on Your Phone
Scala on Your Phone
Michael Galpin
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Dmitriy Kiriyenko
Karan
Karan
karanchanana1
9. Php MongoDB cautarea unui document
9. Php MongoDB cautarea unui document
Razvan Raducanu, PhD
wget.pl
wget.pl
Yasuhiro Onishi
Elm: delightful web development
Elm: delightful web development
Amir Barylko
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30
Mahmoud Samir Fayed
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
Mahmoud Samir Fayed
Fcontratos
Fcontratos
karlloss
Perl Fitxers i Directoris
Perl Fitxers i Directoris
frankiejol
Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011
Rafael Felix da Silva
Ruby Language - A quick tour
Ruby Language - A quick tour
aztack
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
SeongGyu Jo
PHP Lecture 4 - Working with form, GET and Post Methods
PHP Lecture 4 - Working with form, GET and Post Methods
Al-Mamun Sarkar
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
Ralph Winzinger
Frontrow conf
Frontrow conf
zefhemel
Docker ecosystem
Docker ecosystem
zefhemel
Internal DSLs
Internal DSLs
zefhemel
Weitere ähnliche Inhalte
Was ist angesagt?
PureScript & Pux
PureScript & Pux
Arthur Xavier
Html5 appunti.0
Html5 appunti.0
orestJump
6. Php MongoDB adaugarea unui document
6. Php MongoDB adaugarea unui document
Razvan Raducanu, PhD
Intro to F#
Intro to F#
Kristian Hellang
Scala on Your Phone
Scala on Your Phone
Michael Galpin
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Dmitriy Kiriyenko
Karan
Karan
karanchanana1
9. Php MongoDB cautarea unui document
9. Php MongoDB cautarea unui document
Razvan Raducanu, PhD
wget.pl
wget.pl
Yasuhiro Onishi
Elm: delightful web development
Elm: delightful web development
Amir Barylko
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30
Mahmoud Samir Fayed
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
Mahmoud Samir Fayed
Fcontratos
Fcontratos
karlloss
Perl Fitxers i Directoris
Perl Fitxers i Directoris
frankiejol
Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011
Rafael Felix da Silva
Ruby Language - A quick tour
Ruby Language - A quick tour
aztack
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
SeongGyu Jo
PHP Lecture 4 - Working with form, GET and Post Methods
PHP Lecture 4 - Working with form, GET and Post Methods
Al-Mamun Sarkar
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
Ralph Winzinger
Was ist angesagt?
(19)
PureScript & Pux
PureScript & Pux
Html5 appunti.0
Html5 appunti.0
6. Php MongoDB adaugarea unui document
6. Php MongoDB adaugarea unui document
Intro to F#
Intro to F#
Scala on Your Phone
Scala on Your Phone
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Karan
Karan
9. Php MongoDB cautarea unui document
9. Php MongoDB cautarea unui document
wget.pl
wget.pl
Elm: delightful web development
Elm: delightful web development
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
Fcontratos
Fcontratos
Perl Fitxers i Directoris
Perl Fitxers i Directoris
Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011
Ruby Language - A quick tour
Ruby Language - A quick tour
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
PHP Lecture 4 - Working with form, GET and Post Methods
PHP Lecture 4 - Working with form, GET and Post Methods
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
Andere mochten auch
Frontrow conf
Frontrow conf
zefhemel
Docker ecosystem
Docker ecosystem
zefhemel
Internal DSLs
Internal DSLs
zefhemel
Expand your horizons
Expand your horizons
zefhemel
mobl - model-driven engineering lecture
mobl - model-driven engineering lecture
zefhemel
Cloud9 IDE Talk at meet.js Poznań
Cloud9 IDE Talk at meet.js Poznań
zefhemel
mobl presentation @ IHomer
mobl presentation @ IHomer
zefhemel
mobl
mobl
zefhemel
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
Sander van der Burg
Avoiding JavaScript Pitfalls Through Tree Hugging
Avoiding JavaScript Pitfalls Through Tree Hugging
zefhemel
Andere mochten auch
(10)
Frontrow conf
Frontrow conf
Docker ecosystem
Docker ecosystem
Internal DSLs
Internal DSLs
Expand your horizons
Expand your horizons
mobl - model-driven engineering lecture
mobl - model-driven engineering lecture
Cloud9 IDE Talk at meet.js Poznań
Cloud9 IDE Talk at meet.js Poznań
mobl presentation @ IHomer
mobl presentation @ IHomer
mobl
mobl
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
Avoiding JavaScript Pitfalls Through Tree Hugging
Avoiding JavaScript Pitfalls Through Tree Hugging
Ähnlich wie Internal DSLs Scala
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212
Mahmoud Samir Fayed
IN4308 Lecture 3
IN4308 Lecture 3
Eelco Visser
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
Anton Arhipov
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202
Mahmoud Samir Fayed
Web весна 2013 лекция 6
Web весна 2013 лекция 6
Technopark
Software Language Design & Engineering
Software Language Design & Engineering
Eelco Visser
Web осень 2012 лекция 6
Web осень 2012 лекция 6
Technopark
Scala DSLの作り方
Scala DSLの作り方
Tomoharu ASAMI
The Ring programming language version 1.7 book - Part 44 of 196
The Ring programming language version 1.7 book - Part 44 of 196
Mahmoud Samir Fayed
JDK 8
JDK 8
Maciej Dragan
The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210
Mahmoud Samir Fayed
Are we ready to Go?
Are we ready to Go?
Adam Dudczak
compose_speaker_session.pdf
compose_speaker_session.pdf
AnkurAgarwal151093
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
Mahmoud Samir Fayed
Scala in practice
Scala in practice
patforna
大量地区化解决方案V5
大量地区化解决方案V5
bqconf
Introduction to Python
Introduction to Python
UC San Diego
Ähnlich wie Internal DSLs Scala
(20)
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212
IN4308 Lecture 3
IN4308 Lecture 3
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202
Web весна 2013 лекция 6
Web весна 2013 лекция 6
Software Language Design & Engineering
Software Language Design & Engineering
Web осень 2012 лекция 6
Web осень 2012 лекция 6
Scala DSLの作り方
Scala DSLの作り方
The Ring programming language version 1.7 book - Part 44 of 196
The Ring programming language version 1.7 book - Part 44 of 196
JDK 8
JDK 8
The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210
Are we ready to Go?
Are we ready to Go?
compose_speaker_session.pdf
compose_speaker_session.pdf
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
Scala in practice
Scala in practice
大量地区化解决方案V5
大量地区化解决方案V5
Introduction to Python
Introduction to Python
Kürzlich hochgeladen
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
apidays
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
apidays
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Dropbox
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Rustici Software
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Khushali Kathiriya
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
lior mazor
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Kürzlich hochgeladen
(20)
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Internal DSLs Scala
1.
Internal DSLs
in Scala Zef Hemel Medewerker no. 0855447
2.
Java++
3.
header("Add entry") form {
table { row { col { text("Your name:") } col { newEntry.name = input(newEntry.name) } } row { col { text("Your message:") } col { newEntry.text = inputText(newEntry.text) } } } button("Post") { newEntry.save() goto(Home()) } }
4.
in Scala
5.
Pages
6.
case class Home()
extends Page { def ui { header("Welcome to my guestbook!") section { header("All entries") list { for (e <- cache("entries", Entry.all)) { listitem { form { text(e.name) text(": ") text(e.text) button("Delete") { e.delete() goto(Home()) } } } } } } } }
7.
Templates
8.
case class Home()
extends Page { def ui { header("Welcome to my guestbook!") section { entries } } def entries { header("All entries") list { for (e <- cache("entries", Entry.all)) { listitem { form { text(e.name) text(": ") text(e.text) button("Delete") { e.delete() goto(Home()) } } } } } } }
9.
abstract class MainTemplate
extends Page { def body def ui { block("headerblock") { header { navigate(Home()) {text("My Guestbook")} } } hr body hr text("(C) 2009, Zef Hemel") } }
10.
case class Home()
extends MainTemplate { def body { header("Welcome to my guestbook!") section { entries } } def entries { header("All entries") for (e <- cache("entries", Entry.all)) { listitem { form { text(e.name) text(": ") text(e.text) button("Delete") { e.delete() goto(Home()) } } } } } ... }
11.
Styling
12.
object DefaultStyle extends
Style { block("headerblock") >> header { fontsize = 30 pt; width = 100 percent; bgcolor = "#eeeeee"; } section >> header { color = "#0c0ccc"; } body { fontfamily = "Helvetica, Arial, Verdana, sans-serif" } }
13.
abstract class MainTemplate
extends Page { def body style = DefaultStyle def ui { block("headerblock") { header { navigate(Home()) {text("My Guestbook")} } } hr body hr text("(C) 2009, Zef Hemel") } }
14.
Access Control (added this
morning in 15 lines of code)
15.
case class CannotEnter()
extends Page with AccessControl { def canAccess = false def ui { text("You should never see this!") } }
16.
Data model
17.
class Entry extends
DataObject { def singleton = Entry @Column var name : String = "" @Column var text : String = "" } object Entry extends DataObjectSingleton(classOf[Entry])
18.
How?
19.
OO features basic: classes,
objects, inheritance, reflection traits
20.
function programming
closures
21.
flexible syntax
a >> b == a.>>(b) form { ... } ~= form(() => { ... })
22.
implicits 8 pt ==
new UnitIntWrapper(8).pt Entry.all == Entry.all(dbSession)
23.
type inference
var newEntry = Entry() == var newEntry : Entry = Entry()
24.
Advantages
25.
“languages” as libraries trivial
“language” composition
26.
Limitations
27.
Scala → JVM
28.
model checking
== type checking
29.
boiler plate case class
Home() extends Page { def ui { } }
Jetzt herunterladen