SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
BlazeHtml

Design of a blazingly fast
html combinator library
Hello!
My name is jasper
Studying BSc CS @ UGent
I like to make things

                @jaspervdj
               jaspervdj.be
Introduction
A web app usually has 3
important layers:

­ web application server
­ data storage layer
­ html generation layer
Trees in Haskell
> data Tree
>    = Node Tree Tree
>    | Empty
Html is a tree
This makes writing an
Html generation library
trivial in Haskell.
Le't write a library!

> type Attribute =
>     (String, String)
> type Tag = String
Le't write a library!
> data Html
>   = Node Tag [Attribute]
>           Html
>   | Leaf Tag [Attribute]
>   | Concat [Html]
>   | Text String
>   deriving (Show)
Hackage quick look
­ html
­ xhtml
­ xhtml­combinators
­ moe
­ xhtml1
s/String/Data.Text/g
­ A first good step
s/String/Data.Text/g
­ A first good step

text1 `append` text2
s/String/Data.Text/g
­ A first good step

text1 `append` text2

   BAD BAD BAD
No inspiration?
Just shamelessly steal
ideas from other Haskell
projects.
Builder Monoid
3­layer approach
Builder Fork
fromText :: Text -> Builder
fromEscapedText :: Text
                -> Builder
fromShow :: Show a
         => a -> Builder

fromRawAscii7Char :: Char
                  -> Builder
Builder Fork
Additional function:
> fromUnsafeWrite
>    :: Int
>    -> (Ptr Word8
>         -> IO ())
>    -> Builder
Benchmarks
Benchmarks
Benchmarks
Benchmarks
The future
Lots still to do until we
have a stable, fast,
awesome version.

For the curious:
github.com/jaspervdj/BlazeHtml
Questions?

Más contenido relacionado

La actualidad más candente

Oracle's ListAgg Function & Pertinent Use
Oracle's ListAgg Function & Pertinent UseOracle's ListAgg Function & Pertinent Use
Oracle's ListAgg Function & Pertinent UseBryan L. Mack
 
Reflection in Pharo5
Reflection in Pharo5Reflection in Pharo5
Reflection in Pharo5Marcus Denker
 
Adding A Dash In jQuery:
Adding A Dash In jQuery:Adding A Dash In jQuery:
Adding A Dash In jQuery:Reema
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity#Pharo Days 2016 Reflectivity
#Pharo Days 2016 ReflectivityPhilippe Back
 
Presentation on functional data mining at the IGT Cloud meet up at eBay Netanya
Presentation on functional data mining at the IGT Cloud meet up at eBay NetanyaPresentation on functional data mining at the IGT Cloud meet up at eBay Netanya
Presentation on functional data mining at the IGT Cloud meet up at eBay NetanyaChristopher Severs
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011Chris Westin
 
Callable and runnable objects in ruby
Callable and runnable objects in rubyCallable and runnable objects in ruby
Callable and runnable objects in rubyRahul Bajaj
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyGeodata AS
 
Redis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaRedis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaItamar Haber
 
Python Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IPython Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IDUSPviz
 
R Data Analysis/Rを使った人事データ分析入門
R Data Analysis/Rを使った人事データ分析入門R Data Analysis/Rを使った人事データ分析入門
R Data Analysis/Rを使った人事データ分析入門Takanori Omote
 

La actualidad más candente (20)

Nodejs vs php_apache
Nodejs vs php_apacheNodejs vs php_apache
Nodejs vs php_apache
 
Oracle's ListAgg Function & Pertinent Use
Oracle's ListAgg Function & Pertinent UseOracle's ListAgg Function & Pertinent Use
Oracle's ListAgg Function & Pertinent Use
 
Reflection in Pharo5
Reflection in Pharo5Reflection in Pharo5
Reflection in Pharo5
 
Adding A Dash In jQuery:
Adding A Dash In jQuery:Adding A Dash In jQuery:
Adding A Dash In jQuery:
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
 
Introduction to Elm
Introduction to ElmIntroduction to Elm
Introduction to Elm
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
 
#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity
 
Elm @ DublinJS
Elm @ DublinJSElm @ DublinJS
Elm @ DublinJS
 
Presentation on functional data mining at the IGT Cloud meet up at eBay Netanya
Presentation on functional data mining at the IGT Cloud meet up at eBay NetanyaPresentation on functional data mining at the IGT Cloud meet up at eBay Netanya
Presentation on functional data mining at the IGT Cloud meet up at eBay Netanya
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
 
Callable and runnable objects in ruby
Callable and runnable objects in rubyCallable and runnable objects in ruby
Callable and runnable objects in ruby
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using Arcpy
 
Redis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaRedis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of Lua
 
Network programming1
Network programming1Network programming1
Network programming1
 
3 Презентация Kotlin - why not?
3 Презентация Kotlin - why not?3 Презентация Kotlin - why not?
3 Презентация Kotlin - why not?
 
Python Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IPython Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part I
 
Roslyn
RoslynRoslyn
Roslyn
 
R Data Analysis/Rを使った人事データ分析入門
R Data Analysis/Rを使った人事データ分析入門R Data Analysis/Rを使った人事データ分析入門
R Data Analysis/Rを使った人事データ分析入門
 

Destacado

Lizard thein sein
Lizard thein seinLizard thein sein
Lizard thein seinyadana8888
 
Small group presentation
Small group presentationSmall group presentation
Small group presentationVOX Church
 
2010 Symposium - Monday - Retai
2010 Symposium - Monday - Retai2010 Symposium - Monday - Retai
2010 Symposium - Monday - RetaiSOCAP
 
Touch&play framework
Touch&play frameworkTouch&play framework
Touch&play frameworkCSP Scarl
 
Storie dal futuro: persone e cose sempre connesse
Storie dal futuro: persone e cose sempre connesseStorie dal futuro: persone e cose sempre connesse
Storie dal futuro: persone e cose sempre connesseCSP Scarl
 
What is Lean Startup?
What is Lean Startup?What is Lean Startup?
What is Lean Startup?Chris Shayan
 
how VietnamWorks works
how VietnamWorks workshow VietnamWorks works
how VietnamWorks worksChris Shayan
 
CV Somendra Nov 2016 external
CV Somendra Nov 2016 externalCV Somendra Nov 2016 external
CV Somendra Nov 2016 externalSOMENDRA06
 
Technical Instructions
Technical InstructionsTechnical Instructions
Technical InstructionsEKMom
 
Independent Presentation Final Sb (2)
Independent Presentation Final Sb (2)Independent Presentation Final Sb (2)
Independent Presentation Final Sb (2)Independent Ltd
 
D:\Ring O 2nd Grade
D:\Ring O 2nd GradeD:\Ring O 2nd Grade
D:\Ring O 2nd Gradeguest5ac3f31
 
Requisitos oo-para-projetos-oo-transicao-facil
Requisitos oo-para-projetos-oo-transicao-facilRequisitos oo-para-projetos-oo-transicao-facil
Requisitos oo-para-projetos-oo-transicao-facilSandra Rocha
 
C re ate-cirma-def-060611
C re ate-cirma-def-060611C re ate-cirma-def-060611
C re ate-cirma-def-060611CSP Scarl
 

Destacado (20)

Lizard thein sein
Lizard thein seinLizard thein sein
Lizard thein sein
 
Small group presentation
Small group presentationSmall group presentation
Small group presentation
 
2010 Symposium - Monday - Retai
2010 Symposium - Monday - Retai2010 Symposium - Monday - Retai
2010 Symposium - Monday - Retai
 
What is Scrum
What is ScrumWhat is Scrum
What is Scrum
 
Touch&play framework
Touch&play frameworkTouch&play framework
Touch&play framework
 
Marketing On The Internet
Marketing On The InternetMarketing On The Internet
Marketing On The Internet
 
Storie dal futuro: persone e cose sempre connesse
Storie dal futuro: persone e cose sempre connesseStorie dal futuro: persone e cose sempre connesse
Storie dal futuro: persone e cose sempre connesse
 
What is Lean Startup?
What is Lean Startup?What is Lean Startup?
What is Lean Startup?
 
how VietnamWorks works
how VietnamWorks workshow VietnamWorks works
how VietnamWorks works
 
CV Somendra Nov 2016 external
CV Somendra Nov 2016 externalCV Somendra Nov 2016 external
CV Somendra Nov 2016 external
 
Technical Instructions
Technical InstructionsTechnical Instructions
Technical Instructions
 
Independent Presentation Final Sb (2)
Independent Presentation Final Sb (2)Independent Presentation Final Sb (2)
Independent Presentation Final Sb (2)
 
D:\Ring O 2nd Grade
D:\Ring O 2nd GradeD:\Ring O 2nd Grade
D:\Ring O 2nd Grade
 
Dasar html
Dasar htmlDasar html
Dasar html
 
Requisitos oo-para-projetos-oo-transicao-facil
Requisitos oo-para-projetos-oo-transicao-facilRequisitos oo-para-projetos-oo-transicao-facil
Requisitos oo-para-projetos-oo-transicao-facil
 
C re ate-cirma-def-060611
C re ate-cirma-def-060611C re ate-cirma-def-060611
C re ate-cirma-def-060611
 
Red leaves profile
Red leaves profileRed leaves profile
Red leaves profile
 
3 5massvacation
3 5massvacation3 5massvacation
3 5massvacation
 
Escher
EscherEscher
Escher
 
MyFriendsTreeII
MyFriendsTreeIIMyFriendsTreeII
MyFriendsTreeII
 

Similar a Dutch hug

Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...apidays
 
The program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxThe program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxoscars29
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET WorldESUG
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracketjnewmanux
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in... ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...Saurabh Nanda
 
Echtzeitapplikationen mit Elixir und GraphQL
Echtzeitapplikationen mit Elixir und GraphQLEchtzeitapplikationen mit Elixir und GraphQL
Echtzeitapplikationen mit Elixir und GraphQLMoritz Flucht
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#Talbott Crowell
 
Internet Programming
Internet ProgrammingInternet Programming
Internet ProgrammingFkdiMl
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...bobmcwhirter
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2GDSCUniversitasMatan
 

Similar a Dutch hug (20)

Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
 
The program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxThe program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docx
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET World
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
PPT
PPTPPT
PPT
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Ant tutorial
Ant tutorialAnt tutorial
Ant tutorial
 
Java ant tutorial
Java ant tutorialJava ant tutorial
Java ant tutorial
 
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in... ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 
Echtzeitapplikationen mit Elixir und GraphQL
Echtzeitapplikationen mit Elixir und GraphQLEchtzeitapplikationen mit Elixir und GraphQL
Echtzeitapplikationen mit Elixir und GraphQL
 
WEB DEVELOPMENT
WEB DEVELOPMENTWEB DEVELOPMENT
WEB DEVELOPMENT
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Internet Programming
Internet ProgrammingInternet Programming
Internet Programming
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
 

Dutch hug