SlideShare a Scribd company logo
1 of 75
Download to read offline
Grammarware Memes
   Eelco Visser & Guido Wachsmuth
Background
Spoofax Language Workbench
WebDSL Web Programming Language

  define page post(p: Post, title: String) {
    init{ p.update(); }
    title{ output(p.title) }
    bloglayout(p.blog){
      placeholder view { postView(p) }
      postComments(p)
    }
  }

  define ajax postView(p: Post) {
    pageHeader2{ output(p.title) }
    postBodyLayout(p) {
  	   postContent(p)
  	   postExtendedContent(p)
  	   postActions(p)
  	 }
  }
Researchr Bibliography Management System
WebLab Programming Education on the Web
Some Philosophical Considerations
Grammarware vs Modelware?




 GPCE                   MODELS
OOPSLA                   ICMT
Grammarware vs Modelware?




 GPCE                   MODELS
              SLE
OOPSLA                   ICMT
Functional vs Object-Oriented vs
            Logic vs ...
Remember the Programming Language Wars?




    ICFP                     OOPSLA
Remember the Programming Language Wars?




    ICFP         GPCE        OOPSLA
Scala: Object-Oriented or
        Functional?



ā€˜closureā€™: a purely functional feature?
X-ware is a Memeplex



memeplex: selection of memes from the meme pool
What is Grammarware?
Grammarware is about
  (Parsing) Text

               module users

               imports library

               entity User {
                 email    : String
                 password : String
                 isAdmin : Bool
               }
Grammarware is about
                           Structure
Module(
  "users"
, [ Imports("library")
  , Entity(
      "User"
    , [ Property("email", Type("String"))
      , Property("password", Type("String"))
      , Property("isAdmin", Type("Bool"))
      ]
    )
  ]
)
Grammarware: Text & Structure
Grammarware is about Transformation
Source to Source Transformation
Source to Source Transformation
Transformation & Analysis


  name resolution

    type checking

      desugaring

  code generation
Some Memes from
the Spoofax Memeplex
EnFun: Entities with Functions
 module blog
   entity String {
     function plus(that:String): String
   }
   entity Bool { }
   entity Set<T> {
     function add(x: T)
     function remove(x: T)
     function member(x: T): Bool
   }
   entity Blog {
     posts : Set<Post>
     function newPost(): Post {
       var p : Post := Post.new();
       posts.add(p);
     }
   }
   entity Post {
     title : String
   }
Structure
Signature & Terms


constructors
  Module : ID * List(Definition) -> Module
  Imports : ID -> Definition




         Module(
           "application"
         , [Imports("library"),
            Imports("users"),
            Imports("frontend")]
         )
Entities & Properties

constructors
  Entity : ID * List(Property) -> Definition
  Type   : ID -> Type
  New    : Type -> Exp

constructors
  Property     : ID * Type -> Property
  This         : Exp
  PropAccess   : Exp * ID -> Exp



Module("users"
, [ Imports("library")
  , Entity("User"
    , [ Property("email",    Type("String"))
      , Property("password", Type("String"))
      , Property("isAdmin", Type("Bool"))])])
Constants & Operators & Variables
constructors                           constructors
  String : STRING -> Exp                 Geq    : Exp     * Exp ->   Exp
  Int    : INT -> Exp                    Leq    : Exp     * Exp ->   Exp
  False : Exp                            Gt     : Exp     * Exp ->   Exp
  True   : Exp                           Lt     : Exp     * Exp ->   Exp
                                         Eq     : Exp     * Exp ->   Exp
                                         Mul    : Exp     * Exp ->   Exp
                                         Minus : Exp      * Exp ->   Exp
                                         Plus   : Exp     * Exp ->   Exp
                                         Or     : Exp     * Exp ->   Exp
                                         And    : Exp     * Exp ->   Exp
                                         Not    : Exp     -> Exp


                           constructors
                             VarDecl       :   ID * Type -> Stat
                             VarDeclInit   :   ID * Type * Exp -> Stat
                             Assign        :   Exp * Exp -> Stat
                             Var           :   ID -> Exp
Statements & Functions

constructors
  Exp    : Exp -> Stat
  Block : List(Stat) -> Stat
  Seq    : List(Stat) -> Stat
  While : Exp * List(Stat) -> Stat
  IfElse : Exp * List(Stat) * List(ElseIf) * Option(Else) -> Stat
  Else   : List(Stat) -> Else
  ElseIf : Exp * List(Stat) -> ElseIf


constructors
  FunDef   :   ID * List(Arg) * Type * List(Stat) -> Property
  FunDecl :    ID * List(Arg) * Type -> Property
  Arg      :   ID * Type -> Arg
  Return   :   Exp -> Stat
  MethCall :   Exp * ID * List(Exp) -> Exp
  ThisCall :   ID * List(Exp) -> Exp
Transformation
Transformation by Strategic Rewriting

 rules

   desugar:
     Plus(e1, e2) -> MethCall(e1, "plus", [e2])

   desugar:
     Or(e1, e2) -> MethCall(e1, "or", [e2])

   desugar :
     VarDeclInit(x, t, e) ->
     Seq([VarDecl(x, t),
          Assign(Var(x), e)])

 strategies

   desugar-all = topdown(repeat(desugar))
Return-Lifting Applied



function fact(n: Int): Int {       function fact(n: Int): Int {
                                     var res: Int;
    if(n == 0) {                     if(n == 0) {
      return 1;                        res := 1;
    } else {                         } else {
      return this * fact(n - 1);       res := this * fact(n - 1);
    }                                }
                                     return res;
}                                  }
Return-Lifting Rules

rules

  lift-return-all =
    alltd(lift-return; normalize-all)

  lift-return :
    FunDef(x, arg*, Some(t), stat1*) ->
    FunDef(x, arg*, Some(t), Seq([
      VarDecl(y, t),
      Seq(stat2*),
      Return(Var(y))
    ]))
    where y := <new>;
          stat2* := <alltd(replace-return(|y))> stat1*

  replace-return(|y) :
    Return(e) -> Assign(y, e)
Seq Normalization

strategies

  normalize-all = innermost-L(normalize)

rules // seq lifting

  normalize :
    [Seq(stat1*) | stat2*@[_|_]] -> [Seq([stat1*,stat2*])]

  normalize :
    [stat, Seq(stat*)] -> [Seq([stat | stat*])]

  normalize :
    Block([Seq(stat1*)]) -> Block(stat1*)

  normalize :
    FunDef(x, arg*, t, [Seq(stat*)]) -> FunDef(x, arg*, t, stat*)
Interpretation



     eval
Small Step Operational Semantics



rules // driver

    steps = repeat(step)
	
    step:
      State([Frame(fn, this, slots, cont)|f*], heap) ->
      State(stack', heap')
    where
      cont' := <eval> cont;
      stack' := <update-stack (|...)> [Frame(..., cont')|f*];
      heap' := <update-heap(|...)> heap
Small Step Operational Semantics



eval(|this, slots, heap):
	 Var(x) -> val
	 where val := <lookup> (x, slots)
	
eval(|this, slots, heap):
	 PropAccess(Ptr(p), prop) -> val
	 where
	 	 Object(_, props) 	:= <lookup> (p, heap);
	 	 val	 	 	 	 	 	 := <lookup> (prop, props)
From Text to Structure
Declarative Syntax Deļ¬nition




                              Entity("User", [
                                 Property("first", Type("String")),
                                 Property("last", Type("String"))
                              ])



signature
  constructors
    Entity   : ID * List(Property) -> Definition
    Type     : ID                  -> Type
    Property : ID * Type           -> Property
Declarative Syntax Deļ¬nition




entity User {                 Entity("User", [
  first : String                 Property("first", Type("String")),
  last   : String                Property("last", Type("String"))
}                             ])



signature
  constructors
    Entity   : ID * List(Property) -> Definition
    Type     : ID                  -> Type
    Property : ID * Type           -> Property
Declarative Syntax Deļ¬nition

context-free syntax
  "entity" ID "{" Property* "}" -> Definition {"Entity"}
  ID                            -> Type       {"Type"}
  ID ":" Type                   -> Property   {"Property"}



entity User {                 Entity("User", [
  first : String                 Property("first", Type("String")),
  last   : String                Property("last", Type("String"))
}                             ])



signature
  constructors
    Entity   : ID * List(Property) -> Definition
    Type     : ID                  -> Type
    Property : ID * Type           -> Property
Declarative Syntax Deļ¬nition

context-free syntax
  "entity" ID "{" Property* "}" -> Definition {"Entity"}
  ID                            -> Type       {"Type"}
  ID ":" Type                   -> Property   {"Property"}



entity User {                 Entity("User", [
  first : String                 Property("first", Type("String")),
  last   : String                Property("last", Type("String"))
}                             ])



signature
  constructors
    Entity   : ID * List(Property) -> Definition
    Type     : ID                  -> Type
    Property : ID * Type           -> Property
Context-free Syntax
context-free syntax                 constructors
  "true"       -> Exp   {"True"}      True   : Exp
  "false"      -> Exp   {"False"}     False : Exp
  "!" Exp      -> Exp   {"Not"}       Not    : Exp -> Exp
  Exp "&&" Exp -> Exp   {"And"}       And    : Exp * Exp -> Exp
  Exp "||" Exp -> Exp   {"Or"}        Or     : Exp * Exp -> Exp
Lexical Syntax
context-free syntax                 constructors
  "true"       -> Exp   {"True"}      True   : Exp
  "false"      -> Exp   {"False"}     False : Exp
  "!" Exp      -> Exp   {"Not"}       Not    : Exp -> Exp
  Exp "&&" Exp -> Exp   {"And"}       And    : Exp * Exp -> Exp
  Exp "||" Exp -> Exp   {"Or"}        Or     : Exp * Exp -> Exp


lexical syntax                      constructors
  [a-zA-Z][a-zA-Z0-9]* -> ID         : String -> ID
  "-"? [0-9]+          -> INT        : String -> INT
  [ tnr]           -> LAYOUT




           scannerless generalized (LR) parsing
Ambiguity
context-free syntax                        constructors
  "true"       -> Exp   {"True"}             True   : Exp
  "false"      -> Exp   {"False"}            False : Exp
  "!" Exp      -> Exp   {"Not"}              Not    : Exp -> Exp
  Exp "&&" Exp -> Exp   {"And"}              And    : Exp * Exp -> Exp
  Exp "||" Exp -> Exp   {"Or"}               Or     : Exp * Exp -> Exp



          isPublic || isDraft && (author == principal())




amb([
   And(Or(Var("isPublic"), Var("isDraft")),
       Eq(Var("author"), ThisCall("principal", []))),
   Or(Var("isPublic"),
      And(Var("isDraft"), Eq(Var("author"), ThisCall("principal", []))))
])
Disambiguation by Encoding Precedence
context-free syntax                      constructors
  "true"       -> Exp   {"True"}           True   : Exp
  "false"      -> Exp   {"False"}          False : Exp
  "!" Exp      -> Exp   {"Not"}            Not    : Exp -> Exp
  Exp "&&" Exp -> Exp   {"And"}            And    : Exp * Exp -> Exp
  Exp "||" Exp -> Exp   {"Or"}             Or     : Exp * Exp -> Exp




context-free syntax
  "(" Exp ")"    ->   Exp0   {bracket}
  "true"         ->   Exp0   {"True"}
  "false"        ->   Exp0   {"False"}
  Exp0           ->   Exp1
  "!" Exp0       ->   Exp1   {"Not"}
  Exp1           ->   Exp2
  Exp1 "&&" Exp2 ->   Exp2   {"And"}
  Exp2           ->   Exp3
  Exp2 "||" Exp3 ->   Exp3   {"Or"}
Declarative Disambiguation
context-free syntax
  "true"       -> Exp {"True"}
  "false"      -> Exp {"False"}
  "!" Exp      -> Exp {"Not"}
  Exp "&&" Exp -> Exp {"And", left}
  Exp "||" Exp -> Exp {"Or", left}
  "(" Exp ")" -> Exp {bracket}
context-free priorities
  {left: Exp.Not} >
  {left: Exp.Mul} >
  {left: Exp.Plus Exp.Minus} >
  {left: Exp.And} >
  {non-assoc: Exp.Eq Exp.Lt Exp.Gt Exp.Leq Exp.Geq}


isPublic || isDraft && (author == principal())


             Or(Var("isPublic"),
                And(Var("isDraft"),
                    Eq(Var("author"), ThisCall("principal", []))))
Generating Text from Structure
Code Generation by String Concatenation



 to-java:
   Property(x, Type(t)) -> <concat-strings>[
     "private ", t, " ", x, ";nn",
     "public ", t, " get_", x, " {n",
     "    return ", x, ";n",
     "}n",
     "public void set_", x, " (", t, " ", x, ") {n",
     "    this.", x, " = ", x, ";n",
     "}"
   ]
String Interpolation Templates


  to-java:
    Property(x, Type(t)) -> $[
      private [t] [x];

        public [t] get_[x] {
          return [x];
        }

        public void set_[x] ([t] [x]) {
          this.[x] = [x];
        }
    ]
Code Generation by
Model Transformation
Generating Structured Representations


to-java:
  Property(x, Type(t)) -> [
    Field([Private()], Type(t), Var(x)),

      Method([Public()], Type(t), $[get_[x]], [], [
        Return(Var(x))
      ]),

      Method([Public()], None(), $[set_[x]], [Param(Type(t), x)], [
         Assign(FieldAccess(This(), x), Var(x))
      ])
  ]
Concrete Object Syntax


 to-java:
   Property(x, Type(t)) -> |[
    private t x;

        public t get_#x {
            return x;
        }

        public void set_#x (t x) {
            this.x = x;
        }
   ]|
Rewriting with Concrete Object Syntax

  module desugar

  imports Enfun

  strategies

    desugar-all = topdown(repeat(desugar))

  rules
    desugar: |[ !e       ]| -> |[ e.not() ]|
    desugar: |[ e1 && e2 ]| -> |[ e1.and(e2) ]|
    desugar: |[ e1 || e2 ]| -> |[ e1.or(e2) ]|

    desugar: |[ e1 +   e2 ]| -> |[ e1.plus(e2) ]|
    desugar: |[ e1 *   e2 ]| -> |[ e1.times(e2) ]|
    desugar: |[ e1 -   e2 ]| -> |[ e1.minus(e2) ]|
Rewriting with Concrete Object Syntax

lift-return-cs :
  |[ function x(arg*) : t { stat1* } ]| ->
  |[ function x(arg*): t {
       var y : t;
       ( stat2* )
       return y;
     } ]|
  where y := <new>;
        stat2* := <alltd(replace-return(|y))> stat1*




         lift-return :
           FunDef(x, arg*, Some(t), stat1*) ->
           FunDef(x, arg*, Some(t), Seq([
             VarDecl(y, t),
             Seq(stat2*),
             Return(Var(y))
           ]))
           where y := <new>;
                 stat2* := <alltd(replace-return(|y))> stat1*
Pretty-Printing by
Model Transformation
Code Formatting
module users
  entity String { }
  entity User { first : String last : String }




       Module(
         "demo1"
                                                   module users
       , [ Entity("String", None(), None(), [])
         , Entity(                                 entity String   {
             "User"
                                                   }
           , [ Property("first", Type("String"))
             , Property("last", Type("String"))
             ]                                     entity User {
           )                                         first : String
         ]
       )
                                                     last : String
                                                   }
Pretty-Printer Speciļ¬cation


prettyprint-Definition :
  Entity(x, prop*) ->
    [ H([SOpt(HS(), "0")]
       , [ S("entity ")
         , <pp-one-Z(prettyprint-ID)> x
         , S(" {")
         ]
       )
     , <pp-indent(|"2")> [<pp-V-list(prettyprint-Property)> p*]
     , H([SOpt(HS(), "0")], [S("}")]
       )
     ]
Structure Editors
Discoverability
Editors with Syntactic Completion
Completion Templates



completions

  completion template Definition : "entity ID { }" =
    "entity " <ID:ID> " {nt" (cursor) "n}" (blank)

  completion template Type : "ID" =
    <ID:ID>

  completion template Property : "ID : ID " =
    <ID:ID> " : " <ID:Type> (blank)
Syntax Templates: Structure + Layout
                                    context-free syntax
                                      "entity" ID "{" Property* "}" -> Definition {"Entity"}
                                      ID                            -> Type       {"Type"}
                                      ID ":" Type                   -> Property   {"Property"}



templates
                                    signature
                                      constructors
                                        Entity   : ID * List(Property) -> Definition
  Definition.Entity = <                 Type     : ID                  -> Type
                                        Property : ID * Type           -> Property
    entity <ID> {
      <Property*; separator="n">
                                    completions
    }                                 completion template Definition : "entity ID { }" =

  >                                     "entity " <ID:ID> " {nt" (cursor) "n}" (blank)

                                      completion template Type : "ID<>" =
                                        <ID:ID> "<" <:Type> ">"

  Type.Type = <<ID>>                  completion template Property : "ID : ID " =
                                        <ID:ID> " : " <ID:Type> (blank)




  Property.Property = <
                                    prettyprint-Definition =
    <ID> : <Type>                     ?Entity(x, prop*)
                                      ; ![ H(

  >                                           [SOpt(HS(), "0")]
                                           , [ S("entity ")
                                              , <pp-one-Z(prettyprint-ID)> x
                                              , S(" {")
                                              ]
                                           )
                                         , <pp-indent(|"2")> [<pp-V-list(prettyprint-Property)> p*]
                                         , H([SOpt(HS(), "0")], [S("}")]
                                           )
                                         ]
Type Checking
Example: Checking Method Calls

module renaming

  entity String {
    function plus(that:String): String { ... }
  }

  entity User {
    firstName : String
    lastName : String
    fullName : String
    function rename(first: String, last: String) {
      fullName := first.plus(0);          // argument has wrong type
      fullName := first.plus();           // too few arguments
      fullName := first.plus(last, last); // too many arguments
      fullName := first.plus(last);       // correct
    }
  }
Constraint Checks

rules // errors

  type-error :
    (e, t) -> (e, $[Type [<pp>t] expected instead of [<pp>t']])
    where <type-of> e => t'; not(<subtype>(t', t))

rules // functions

  constraint-error:
    |[ e.x(e*) ]| -> (x, $[Expects [m] arguments, found [n]])
    where <lookup-type> x => (t*, t);
          <length> e* => n; <length> t* => m;
          not(<eq>(m, n))

  constraint-error:
    |[ e.x(e*) ]| -> <zip; filter(type-error)> (e*, t*)
    where <lookup-type> x => (t*, t)
Type Analysis




rules // constants

  type-of   :   |[ true ]|    ->   TypeBool()
  type-of   :   |[ false ]|   ->   TypeBool()
  type-of   :   Int(i)        ->   TypeInt()
  type-of   :   String(x)     ->   TypeString()
Types of Names

rules // names

  type-of :
    Var(x) -> <lookup-type> x

  type-of :
    |[ e.x ]| -> t
    where <lookup-type> x => t

  type-of :
    |[ e.x(e*) ]| -> t
    where <lookup-type> x => (t*, t)

  type-of :
    |[ f(e*) ]| -> t
    where <lookup-type> f => (t*, t)
Analysis: Name Resolution




                   +
Deļ¬nitions and References

                                  deļ¬nition

  test type refers to entity [[
    module test
    entity [[String]] { }
    entity User {
      first : [[String]]
      last : String
    }
  ]] resolve #2 to #1
                                  reference
From Tree to Graph



Module(
  "test"
, [ Entity("String", [])
  , Entity(
      "User"
    , [ Property("first",   )
      , Property("last",    )
      ]
    )
  ]
)
Unique Names


Module(
  "users"{[Module(), "users"]}
  , [ Entity("String"{[Type(), "String", "users"]}, [])
    , Entity(
        "User"{[Type(), "User", "users"]}
      , [ Property(
            "first"{[Property(), "first", "User", "users"]}
          , Type("String"{[Type(), "String", "users"]}))
        , Property(
            "last"{[Property(), "last", "User", "users"]}
          , Type("String"{[Type(), "String", "users"]}))
        ]
      )
    ]
  )




      + index mapping unique names to values
Spoofax Name Binding Language
      namespaces Module Type             See the full story in
                                          SLE talk on Friday
      rules

        Entity(c, _) :
          defines Type c
              	 	 	
        Type(x, _) :
          refers to Type x
      	 	
        Module(m, _) :
          defines Module m
          scopes Type
      	 	
        Imports(m) :
          imports Type from Module m



  abstract from name resolution algorithmics
spoofax.org




http://spoofax.org

More Related Content

What's hot

Joy of scala
Joy of scalaJoy of scala
Joy of scalaMaxim Novak
Ā 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlinintelliyole
Ā 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real Worldosfameron
Ā 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingEelco Visser
Ā 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from javaIndicThreads
Ā 
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•Jung Kim
Ā 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecLoĆÆc Descotte
Ā 
OO in JavaScript
OO in JavaScriptOO in JavaScript
OO in JavaScriptGunjan Kumar
Ā 
Scala in practice
Scala in practiceScala in practice
Scala in practiceandyrobinson8
Ā 
Pig Introduction to Pig
Pig Introduction to PigPig Introduction to Pig
Pig Introduction to PigChris Wilkes
Ā 
Java script arrays
Java script arraysJava script arrays
Java script arraysFrayosh Wadia
Ā 
Scala - brief intro
Scala - brief introScala - brief intro
Scala - brief introRazvan Cojocaru
Ā 
From android/java to swift (3)
From android/java to swift (3)From android/java to swift (3)
From android/java to swift (3)allanh0526
Ā 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Jonas BonƩr
Ā 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation streamRuslan Shevchenko
Ā 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheetRuslan Shevchenko
Ā 

What's hot (20)

Joy of scala
Joy of scalaJoy of scala
Joy of scala
Ā 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlin
Ā 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real World
Ā 
Java string handling
Java string handlingJava string handling
Java string handling
Ā 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error Checking
Ā 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from java
Ā 
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•
Swiftģ™€ Objective-Cė„¼ ķ•Øź»˜ ģ“°ėŠ” ė°©ė²•
Ā 
Scala for curious
Scala for curiousScala for curious
Scala for curious
Ā 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
Ā 
OO in JavaScript
OO in JavaScriptOO in JavaScript
OO in JavaScript
Ā 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
Ā 
Scala in practice
Scala in practiceScala in practice
Scala in practice
Ā 
Pig Introduction to Pig
Pig Introduction to PigPig Introduction to Pig
Pig Introduction to Pig
Ā 
Java script arrays
Java script arraysJava script arrays
Java script arrays
Ā 
Scala - brief intro
Scala - brief introScala - brief intro
Scala - brief intro
Ā 
From android/java to swift (3)
From android/java to swift (3)From android/java to swift (3)
From android/java to swift (3)
Ā 
ddd+scala
ddd+scaladdd+scala
ddd+scala
Ā 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
Ā 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
Ā 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
Ā 

Similar to Grammarware Memes

Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in goYusuke Kita
Ā 
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Eelco Visser
Ā 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scalaMohsen Zainalpour
Ā 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022InfluxData
Ā 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a tryEugene Zharkov
Ā 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1saydin_soft
Ā 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming iiPrashant Kalkar
Ā 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With EclipsePeter Friese
Ā 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with PythonHan Lee
Ā 
JavaScript, TypeScipt and React Native
JavaScript, TypeScipt and React NativeJavaScript, TypeScipt and React Native
JavaScript, TypeScipt and React NativeMitchell Tilbrook
Ā 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scalaparag978978
Ā 
Scala Bootcamp 1
Scala Bootcamp 1Scala Bootcamp 1
Scala Bootcamp 1Knoldus Inc.
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
Ā 
Introducing scala
Introducing scalaIntroducing scala
Introducing scalaMeetu Maltiar
Ā 
Improving Correctness with Types Kats Conf
Improving Correctness with Types Kats ConfImproving Correctness with Types Kats Conf
Improving Correctness with Types Kats ConfIain Hull
Ā 

Similar to Grammarware Memes (20)

Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
Ā 
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Ā 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scala
Ā 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Ā 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
Ā 
Meet scala
Meet scalaMeet scala
Meet scala
Ā 
360|iDev
360|iDev360|iDev
360|iDev
Ā 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1
Ā 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming ii
Ā 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With Eclipse
Ā 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
Ā 
JavaScript, TypeScipt and React Native
JavaScript, TypeScipt and React NativeJavaScript, TypeScipt and React Native
JavaScript, TypeScipt and React Native
Ā 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
Ā 
Scala Bootcamp 1
Scala Bootcamp 1Scala Bootcamp 1
Scala Bootcamp 1
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Ā 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Ā 
Introducing scala
Introducing scalaIntroducing scala
Introducing scala
Ā 
Improving Correctness with Types Kats Conf
Improving Correctness with Types Kats ConfImproving Correctness with Types Kats Conf
Improving Correctness with Types Kats Conf
Ā 

More from Eelco Visser

CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingEelco Visser
Ā 
CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesEelco Visser
Ā 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingEelco Visser
Ā 
CS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionCS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionEelco Visser
Ā 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionEelco Visser
Ā 
A Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesA Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesEelco Visser
Ā 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with StatixEelco Visser
Ā 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
Ā 
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Eelco Visser
Ā 
Compiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementCompiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementEelco Visser
Ā 
Compiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersCompiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersEelco Visser
Ā 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
Ā 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
Ā 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksEelco Visser
Ā 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisEelco Visser
Ā 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionEelco Visser
Ā 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsEelco Visser
Ā 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
Ā 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
Ā 
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingCompiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingEelco Visser
Ā 

More from Eelco Visser (20)

CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
Ā 
CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic Services
Ā 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | Parsing
Ā 
CS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionCS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definition
Ā 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
Ā 
A Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesA Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation Rules
Ā 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
Ā 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Ā 
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Ā 
Compiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementCompiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory Management
Ā 
Compiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersCompiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | Interpreters
Ā 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code Generation
Ā 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual Machines
Ā 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
Ā 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
Ā 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint Resolution
Ā 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type Constraints
Ā 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
Ā 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Ā 
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingCompiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Ā 

Recently uploaded

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
Ā 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
Ā 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
Ā 
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 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
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
Ā 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Ā 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
Ā 
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 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, ...
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 

Grammarware Memes

  • 1. Grammarware Memes Eelco Visser & Guido Wachsmuth
  • 4. WebDSL Web Programming Language define page post(p: Post, title: String) { init{ p.update(); } title{ output(p.title) } bloglayout(p.blog){ placeholder view { postView(p) } postComments(p) } } define ajax postView(p: Post) { pageHeader2{ output(p.title) } postBodyLayout(p) { postContent(p) postExtendedContent(p) postActions(p) } }
  • 8. Grammarware vs Modelware? GPCE MODELS OOPSLA ICMT
  • 9. Grammarware vs Modelware? GPCE MODELS SLE OOPSLA ICMT
  • 10. Functional vs Object-Oriented vs Logic vs ...
  • 11. Remember the Programming Language Wars? ICFP OOPSLA
  • 12. Remember the Programming Language Wars? ICFP GPCE OOPSLA
  • 13. Scala: Object-Oriented or Functional? ā€˜closureā€™: a purely functional feature?
  • 14. X-ware is a Memeplex memeplex: selection of memes from the meme pool
  • 16. Grammarware is about (Parsing) Text module users imports library entity User { email : String password : String isAdmin : Bool }
  • 17.
  • 18. Grammarware is about Structure Module( "users" , [ Imports("library") , Entity( "User" , [ Property("email", Type("String")) , Property("password", Type("String")) , Property("isAdmin", Type("Bool")) ] ) ] )
  • 19. Grammarware: Text & Structure
  • 20. Grammarware is about Transformation
  • 21. Source to Source Transformation
  • 22. Source to Source Transformation
  • 23. Transformation & Analysis name resolution type checking desugaring code generation
  • 24. Some Memes from the Spoofax Memeplex
  • 25. EnFun: Entities with Functions module blog entity String { function plus(that:String): String } entity Bool { } entity Set<T> { function add(x: T) function remove(x: T) function member(x: T): Bool } entity Blog { posts : Set<Post> function newPost(): Post { var p : Post := Post.new(); posts.add(p); } } entity Post { title : String }
  • 27. Signature & Terms constructors Module : ID * List(Definition) -> Module Imports : ID -> Definition Module( "application" , [Imports("library"), Imports("users"), Imports("frontend")] )
  • 28. Entities & Properties constructors Entity : ID * List(Property) -> Definition Type : ID -> Type New : Type -> Exp constructors Property : ID * Type -> Property This : Exp PropAccess : Exp * ID -> Exp Module("users" , [ Imports("library") , Entity("User" , [ Property("email", Type("String")) , Property("password", Type("String")) , Property("isAdmin", Type("Bool"))])])
  • 29. Constants & Operators & Variables constructors constructors String : STRING -> Exp Geq : Exp * Exp -> Exp Int : INT -> Exp Leq : Exp * Exp -> Exp False : Exp Gt : Exp * Exp -> Exp True : Exp Lt : Exp * Exp -> Exp Eq : Exp * Exp -> Exp Mul : Exp * Exp -> Exp Minus : Exp * Exp -> Exp Plus : Exp * Exp -> Exp Or : Exp * Exp -> Exp And : Exp * Exp -> Exp Not : Exp -> Exp constructors VarDecl : ID * Type -> Stat VarDeclInit : ID * Type * Exp -> Stat Assign : Exp * Exp -> Stat Var : ID -> Exp
  • 30. Statements & Functions constructors Exp : Exp -> Stat Block : List(Stat) -> Stat Seq : List(Stat) -> Stat While : Exp * List(Stat) -> Stat IfElse : Exp * List(Stat) * List(ElseIf) * Option(Else) -> Stat Else : List(Stat) -> Else ElseIf : Exp * List(Stat) -> ElseIf constructors FunDef : ID * List(Arg) * Type * List(Stat) -> Property FunDecl : ID * List(Arg) * Type -> Property Arg : ID * Type -> Arg Return : Exp -> Stat MethCall : Exp * ID * List(Exp) -> Exp ThisCall : ID * List(Exp) -> Exp
  • 32. Transformation by Strategic Rewriting rules desugar: Plus(e1, e2) -> MethCall(e1, "plus", [e2]) desugar: Or(e1, e2) -> MethCall(e1, "or", [e2]) desugar : VarDeclInit(x, t, e) -> Seq([VarDecl(x, t), Assign(Var(x), e)]) strategies desugar-all = topdown(repeat(desugar))
  • 33. Return-Lifting Applied function fact(n: Int): Int { function fact(n: Int): Int { var res: Int; if(n == 0) { if(n == 0) { return 1; res := 1; } else { } else { return this * fact(n - 1); res := this * fact(n - 1); } } return res; } }
  • 34. Return-Lifting Rules rules lift-return-all = alltd(lift-return; normalize-all) lift-return : FunDef(x, arg*, Some(t), stat1*) -> FunDef(x, arg*, Some(t), Seq([ VarDecl(y, t), Seq(stat2*), Return(Var(y)) ])) where y := <new>; stat2* := <alltd(replace-return(|y))> stat1* replace-return(|y) : Return(e) -> Assign(y, e)
  • 35. Seq Normalization strategies normalize-all = innermost-L(normalize) rules // seq lifting normalize : [Seq(stat1*) | stat2*@[_|_]] -> [Seq([stat1*,stat2*])] normalize : [stat, Seq(stat*)] -> [Seq([stat | stat*])] normalize : Block([Seq(stat1*)]) -> Block(stat1*) normalize : FunDef(x, arg*, t, [Seq(stat*)]) -> FunDef(x, arg*, t, stat*)
  • 37. Small Step Operational Semantics rules // driver steps = repeat(step) step: State([Frame(fn, this, slots, cont)|f*], heap) -> State(stack', heap') where cont' := <eval> cont; stack' := <update-stack (|...)> [Frame(..., cont')|f*]; heap' := <update-heap(|...)> heap
  • 38. Small Step Operational Semantics eval(|this, slots, heap): Var(x) -> val where val := <lookup> (x, slots) eval(|this, slots, heap): PropAccess(Ptr(p), prop) -> val where Object(_, props) := <lookup> (p, heap); val := <lookup> (prop, props)
  • 39. From Text to Structure
  • 40. Declarative Syntax Deļ¬nition Entity("User", [ Property("first", Type("String")), Property("last", Type("String")) ]) signature constructors Entity : ID * List(Property) -> Definition Type : ID -> Type Property : ID * Type -> Property
  • 41. Declarative Syntax Deļ¬nition entity User { Entity("User", [ first : String Property("first", Type("String")), last : String Property("last", Type("String")) } ]) signature constructors Entity : ID * List(Property) -> Definition Type : ID -> Type Property : ID * Type -> Property
  • 42. Declarative Syntax Deļ¬nition context-free syntax "entity" ID "{" Property* "}" -> Definition {"Entity"} ID -> Type {"Type"} ID ":" Type -> Property {"Property"} entity User { Entity("User", [ first : String Property("first", Type("String")), last : String Property("last", Type("String")) } ]) signature constructors Entity : ID * List(Property) -> Definition Type : ID -> Type Property : ID * Type -> Property
  • 43. Declarative Syntax Deļ¬nition context-free syntax "entity" ID "{" Property* "}" -> Definition {"Entity"} ID -> Type {"Type"} ID ":" Type -> Property {"Property"} entity User { Entity("User", [ first : String Property("first", Type("String")), last : String Property("last", Type("String")) } ]) signature constructors Entity : ID * List(Property) -> Definition Type : ID -> Type Property : ID * Type -> Property
  • 44. Context-free Syntax context-free syntax constructors "true" -> Exp {"True"} True : Exp "false" -> Exp {"False"} False : Exp "!" Exp -> Exp {"Not"} Not : Exp -> Exp Exp "&&" Exp -> Exp {"And"} And : Exp * Exp -> Exp Exp "||" Exp -> Exp {"Or"} Or : Exp * Exp -> Exp
  • 45. Lexical Syntax context-free syntax constructors "true" -> Exp {"True"} True : Exp "false" -> Exp {"False"} False : Exp "!" Exp -> Exp {"Not"} Not : Exp -> Exp Exp "&&" Exp -> Exp {"And"} And : Exp * Exp -> Exp Exp "||" Exp -> Exp {"Or"} Or : Exp * Exp -> Exp lexical syntax constructors [a-zA-Z][a-zA-Z0-9]* -> ID : String -> ID "-"? [0-9]+ -> INT : String -> INT [ tnr] -> LAYOUT scannerless generalized (LR) parsing
  • 46. Ambiguity context-free syntax constructors "true" -> Exp {"True"} True : Exp "false" -> Exp {"False"} False : Exp "!" Exp -> Exp {"Not"} Not : Exp -> Exp Exp "&&" Exp -> Exp {"And"} And : Exp * Exp -> Exp Exp "||" Exp -> Exp {"Or"} Or : Exp * Exp -> Exp isPublic || isDraft && (author == principal()) amb([ And(Or(Var("isPublic"), Var("isDraft")), Eq(Var("author"), ThisCall("principal", []))), Or(Var("isPublic"), And(Var("isDraft"), Eq(Var("author"), ThisCall("principal", [])))) ])
  • 47. Disambiguation by Encoding Precedence context-free syntax constructors "true" -> Exp {"True"} True : Exp "false" -> Exp {"False"} False : Exp "!" Exp -> Exp {"Not"} Not : Exp -> Exp Exp "&&" Exp -> Exp {"And"} And : Exp * Exp -> Exp Exp "||" Exp -> Exp {"Or"} Or : Exp * Exp -> Exp context-free syntax "(" Exp ")" -> Exp0 {bracket} "true" -> Exp0 {"True"} "false" -> Exp0 {"False"} Exp0 -> Exp1 "!" Exp0 -> Exp1 {"Not"} Exp1 -> Exp2 Exp1 "&&" Exp2 -> Exp2 {"And"} Exp2 -> Exp3 Exp2 "||" Exp3 -> Exp3 {"Or"}
  • 48. Declarative Disambiguation context-free syntax "true" -> Exp {"True"} "false" -> Exp {"False"} "!" Exp -> Exp {"Not"} Exp "&&" Exp -> Exp {"And", left} Exp "||" Exp -> Exp {"Or", left} "(" Exp ")" -> Exp {bracket} context-free priorities {left: Exp.Not} > {left: Exp.Mul} > {left: Exp.Plus Exp.Minus} > {left: Exp.And} > {non-assoc: Exp.Eq Exp.Lt Exp.Gt Exp.Leq Exp.Geq} isPublic || isDraft && (author == principal()) Or(Var("isPublic"), And(Var("isDraft"), Eq(Var("author"), ThisCall("principal", []))))
  • 49. Generating Text from Structure
  • 50. Code Generation by String Concatenation to-java: Property(x, Type(t)) -> <concat-strings>[ "private ", t, " ", x, ";nn", "public ", t, " get_", x, " {n", " return ", x, ";n", "}n", "public void set_", x, " (", t, " ", x, ") {n", " this.", x, " = ", x, ";n", "}" ]
  • 51. String Interpolation Templates to-java: Property(x, Type(t)) -> $[ private [t] [x]; public [t] get_[x] { return [x]; } public void set_[x] ([t] [x]) { this.[x] = [x]; } ]
  • 52. Code Generation by Model Transformation
  • 53. Generating Structured Representations to-java: Property(x, Type(t)) -> [ Field([Private()], Type(t), Var(x)), Method([Public()], Type(t), $[get_[x]], [], [ Return(Var(x)) ]), Method([Public()], None(), $[set_[x]], [Param(Type(t), x)], [ Assign(FieldAccess(This(), x), Var(x)) ]) ]
  • 54. Concrete Object Syntax to-java: Property(x, Type(t)) -> |[ private t x; public t get_#x { return x; } public void set_#x (t x) { this.x = x; } ]|
  • 55. Rewriting with Concrete Object Syntax module desugar imports Enfun strategies desugar-all = topdown(repeat(desugar)) rules desugar: |[ !e ]| -> |[ e.not() ]| desugar: |[ e1 && e2 ]| -> |[ e1.and(e2) ]| desugar: |[ e1 || e2 ]| -> |[ e1.or(e2) ]| desugar: |[ e1 + e2 ]| -> |[ e1.plus(e2) ]| desugar: |[ e1 * e2 ]| -> |[ e1.times(e2) ]| desugar: |[ e1 - e2 ]| -> |[ e1.minus(e2) ]|
  • 56. Rewriting with Concrete Object Syntax lift-return-cs : |[ function x(arg*) : t { stat1* } ]| -> |[ function x(arg*): t { var y : t; ( stat2* ) return y; } ]| where y := <new>; stat2* := <alltd(replace-return(|y))> stat1* lift-return : FunDef(x, arg*, Some(t), stat1*) -> FunDef(x, arg*, Some(t), Seq([ VarDecl(y, t), Seq(stat2*), Return(Var(y)) ])) where y := <new>; stat2* := <alltd(replace-return(|y))> stat1*
  • 58. Code Formatting module users entity String { } entity User { first : String last : String } Module( "demo1" module users , [ Entity("String", None(), None(), []) , Entity( entity String { "User" } , [ Property("first", Type("String")) , Property("last", Type("String")) ] entity User { ) first : String ] ) last : String }
  • 59. Pretty-Printer Speciļ¬cation prettyprint-Definition : Entity(x, prop*) -> [ H([SOpt(HS(), "0")] , [ S("entity ") , <pp-one-Z(prettyprint-ID)> x , S(" {") ] ) , <pp-indent(|"2")> [<pp-V-list(prettyprint-Property)> p*] , H([SOpt(HS(), "0")], [S("}")] ) ]
  • 63. Completion Templates completions completion template Definition : "entity ID { }" = "entity " <ID:ID> " {nt" (cursor) "n}" (blank) completion template Type : "ID" = <ID:ID> completion template Property : "ID : ID " = <ID:ID> " : " <ID:Type> (blank)
  • 64. Syntax Templates: Structure + Layout context-free syntax "entity" ID "{" Property* "}" -> Definition {"Entity"} ID -> Type {"Type"} ID ":" Type -> Property {"Property"} templates signature constructors Entity : ID * List(Property) -> Definition Definition.Entity = < Type : ID -> Type Property : ID * Type -> Property entity <ID> { <Property*; separator="n"> completions } completion template Definition : "entity ID { }" = > "entity " <ID:ID> " {nt" (cursor) "n}" (blank) completion template Type : "ID<>" = <ID:ID> "<" <:Type> ">" Type.Type = <<ID>> completion template Property : "ID : ID " = <ID:ID> " : " <ID:Type> (blank) Property.Property = < prettyprint-Definition = <ID> : <Type> ?Entity(x, prop*) ; ![ H( > [SOpt(HS(), "0")] , [ S("entity ") , <pp-one-Z(prettyprint-ID)> x , S(" {") ] ) , <pp-indent(|"2")> [<pp-V-list(prettyprint-Property)> p*] , H([SOpt(HS(), "0")], [S("}")] ) ]
  • 66. Example: Checking Method Calls module renaming entity String { function plus(that:String): String { ... } } entity User { firstName : String lastName : String fullName : String function rename(first: String, last: String) { fullName := first.plus(0); // argument has wrong type fullName := first.plus(); // too few arguments fullName := first.plus(last, last); // too many arguments fullName := first.plus(last); // correct } }
  • 67. Constraint Checks rules // errors type-error : (e, t) -> (e, $[Type [<pp>t] expected instead of [<pp>t']]) where <type-of> e => t'; not(<subtype>(t', t)) rules // functions constraint-error: |[ e.x(e*) ]| -> (x, $[Expects [m] arguments, found [n]]) where <lookup-type> x => (t*, t); <length> e* => n; <length> t* => m; not(<eq>(m, n)) constraint-error: |[ e.x(e*) ]| -> <zip; filter(type-error)> (e*, t*) where <lookup-type> x => (t*, t)
  • 68. Type Analysis rules // constants type-of : |[ true ]| -> TypeBool() type-of : |[ false ]| -> TypeBool() type-of : Int(i) -> TypeInt() type-of : String(x) -> TypeString()
  • 69. Types of Names rules // names type-of : Var(x) -> <lookup-type> x type-of : |[ e.x ]| -> t where <lookup-type> x => t type-of : |[ e.x(e*) ]| -> t where <lookup-type> x => (t*, t) type-of : |[ f(e*) ]| -> t where <lookup-type> f => (t*, t)
  • 71. Deļ¬nitions and References deļ¬nition test type refers to entity [[ module test entity [[String]] { } entity User { first : [[String]] last : String } ]] resolve #2 to #1 reference
  • 72. From Tree to Graph Module( "test" , [ Entity("String", []) , Entity( "User" , [ Property("first", ) , Property("last", ) ] ) ] )
  • 73. Unique Names Module( "users"{[Module(), "users"]} , [ Entity("String"{[Type(), "String", "users"]}, []) , Entity( "User"{[Type(), "User", "users"]} , [ Property( "first"{[Property(), "first", "User", "users"]} , Type("String"{[Type(), "String", "users"]})) , Property( "last"{[Property(), "last", "User", "users"]} , Type("String"{[Type(), "String", "users"]})) ] ) ] ) + index mapping unique names to values
  • 74. Spoofax Name Binding Language namespaces Module Type See the full story in SLE talk on Friday rules Entity(c, _) : defines Type c Type(x, _) : refers to Type x Module(m, _) : defines Module m scopes Type Imports(m) : imports Type from Module m abstract from name resolution algorithmics