HAWK HTML IS ALL WE KNOW JON ADELSON, ETHAN BENJAMIN, JUSTIN - - PowerPoint PPT Presentation

hawk
SMART_READER_LITE
LIVE PREVIEW

HAWK HTML IS ALL WE KNOW JON ADELSON, ETHAN BENJAMIN, JUSTIN - - PowerPoint PPT Presentation

HAWK HTML IS ALL WE KNOW JON ADELSON, ETHAN BENJAMIN, JUSTIN CHANG, GRAHAM GOBIESKI, GEORGE YU OVERVIEW Imperative Language Pattern-action structure based on AWK Handles CSS selectors and Regex for patterns Full type inference


slide-1
SLIDE 1

HAWK

HTML IS ALL WE KNOW

JON ADELSON, ETHAN BENJAMIN, JUSTIN CHANG, GRAHAM GOBIESKI, GEORGE YU

slide-2
SLIDE 2

OVERVIEW

  • Imperative Language
  • Pattern-action structure based on AWK
  • Handles CSS selectors and Regex for

patterns

  • Full type inference
slide-3
SLIDE 3

TUTORIAL

  • Compile source code: make
  • To run tests: make test
  • Write HAWK: *.hk
  • To Compile a Program: ./prog <program-name> >

Program.java

  • To Run a Program: javac Program.java && java -cp ./

_hawk_lib/jsoup.jar: Program <args>

slide-4
SLIDE 4

DEMO

  • Demo 1: Find all prime numbers in a document
  • Demo 2: Find the average number of upvotes on the front

page of Reddit

  • Demo 3: Get the weather
  • Demo 4: Line counter; 4500 total lines of code
  • Demo 5: Nasty Type Inference
slide-5
SLIDE 5

DEMO 5

BEGIN{ fun getSingletonTable(x){ return {x}; } fun modifyTable(t){ t[0] = getSingletonTable(42); } table = {}; table[0] = {}; nestedTable = table[0]; modifyTable(nestedTable); nestedNestedTable = table[0][0]; value = nestedNestedTable[0]; print(value); } END{}

slide-6
SLIDE 6

LANGUAGE IMPLEMENTATION

slide-7
SLIDE 7

LESSONS LEARNED

  • Start early!
  • Know OCaml
  • Weekly group work sessions increase

productivity

  • Don’t commit broken code
  • Know your LRM and set reasonable

goals