< bigwig > a programming language for developing interactive web services
DESCRIPTION
< bigwig > A Programming Language for Developing Interactive Web Services. Claus Brabrand. BRICS , University of Aarhus, Denmark. Plan. Introduction Runtime System Dynamic Documents PowerForms Conclusion. Plan. Introduction Runtime System Dynamic Documents PowerForms Conclusion. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/1.jpg)
Datalogforeningen <bigwig> December 7, 1999
<bigwig>A Programming Language
for DevelopingInteractive Web Services
Claus Brabrand
BRICS, University of Aarhus, Denmark
![Page 2: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/2.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 3: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/3.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 4: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/4.jpg)
Datalogforeningen <bigwig> December 7, 1999
What is <bigwig>?
• A domain-specific high-level programming language for developing interactive Web services.
<bigwig>
HTML
CGI
JavaScript
HTTP Auth.
Java Applets
Service Specification
![Page 5: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/5.jpg)
Datalogforeningen <bigwig> December 7, 1999
A collection of DSLs
• C-like skeleton language with• Runtime system• Concurrency control• Database• Dynamic documents: DynDoc• Input validation language: PowerForms• Security• Cryptographic security• Syntactic-level macros
![Page 6: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/6.jpg)
Datalogforeningen <bigwig> December 7, 1999
A collection of DSLs
• C-like skeleton language with• Runtime system• Concurrency control• Database• Dynamic documents: DynDoc• Input validation language: PowerForms• Security• Cryptographic security• Syntactic-level macros
![Page 7: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/7.jpg)
Datalogforeningen <bigwig> December 7, 1999
DSL vs. GPL
• DSL ::= Domain Specific Language• GPL ::= General Purpose Language
• DSL?– Targeted for specific problem domain– Abstraction level match problem domain
• Examples: Lex/Yacc, LaTeX
![Page 8: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/8.jpg)
Datalogforeningen <bigwig> December 7, 1999
DSL vs. GPL
• DSL ::= Domain Specific Language• GPL ::= General Purpose Language
• DSL?– Targeted for specific problem domain– Abstraction level match problem domain
• Examples: Lex/Yacc, LaTeX, <bigwig>
![Page 9: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/9.jpg)
Datalogforeningen <bigwig> December 7, 1999
DSL Advantages
• Syntax• Analysis• Implementation
…vs. GPL + library
![Page 10: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/10.jpg)
Datalogforeningen <bigwig> December 7, 1999
Goals
• Lower development time (= cost):• Targeted at Web services• Low-level high-level
• Increase functionality:• Compiler does “the dirty work”
• Reliability:• Catch errors during development
» Runtime errors Compile-time errors
![Page 11: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/11.jpg)
Datalogforeningen <bigwig> December 7, 1999
Assumptions
• “Rules of engagement”:
– Lowest common denominator• Any browser/Web server combination
– Only include basic primitives• Syntactic macro language does the rest
![Page 12: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/12.jpg)
Datalogforeningen <bigwig> December 7, 1999
Target Audience
• Programmers!– No expert Web knowledge required– No multiple choice questionnaires or
drag’n’drop
“Reduce Web service development to a standard programming task.”
![Page 13: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/13.jpg)
Datalogforeningen <bigwig> December 7, 1999
Core Language Features
• C-like to minimize syntactic burdens
• Features:– Garbage collection– Relations, vectors, tuples– Strong type checking
![Page 14: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/14.jpg)
Datalogforeningen <bigwig> December 7, 1999
People
• 1x Michael I. Schwartzbach• 1x Post Doc.• 3x Ph.D. students• 2x Programmers• 2x Testers• 1x External contributor
![Page 15: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/15.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 16: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/16.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 17: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/17.jpg)
Datalogforeningen <bigwig> December 7, 1999
3 Approaches
Script-centeredPerl/CGI
![Page 18: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/18.jpg)
Datalogforeningen <bigwig> December 7, 1999
3 Approaches
Script-centered
Page-centered
Perl/CGI
ASP, PHP
![Page 19: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/19.jpg)
Datalogforeningen <bigwig> December 7, 1999
3 Approaches
Script-centered
Page-centered
Session-centered
Perl/CGI
ASP, PHP
Mawl, <bigwig>
![Page 20: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/20.jpg)
Datalogforeningen <bigwig> December 7, 1999
Script-Centered
A script
A pageA script
A page A script
A page
![Page 21: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/21.jpg)
Datalogforeningen <bigwig> December 7, 1999
Page-Centered
A page
A page
A page
![Page 22: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/22.jpg)
Datalogforeningen <bigwig> December 7, 1999
Page-Centered
• Increased level of abstraction• Easy to add dynamics to static pages• Scalability
“Service code embedded in tags and interpreted by specialized Web server”
![Page 23: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/23.jpg)
Datalogforeningen <bigwig> December 7, 1999
Script / Page-Centered
• As the service complexity increases:– Page-centered Script-centered
• Script-centered:– default programming, escape printing.
• Page-centered:– default printing, escape programming.
![Page 24: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/24.jpg)
Datalogforeningen <bigwig> December 7, 1999
(Fundamental) Problems
• Interpretation-based:– Typically no static checks– (Efficiency)
• Not domain specific:– Cannot check Web related issues
• Implicit control-flow:– A service = A collection of scripts/pages!
![Page 25: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/25.jpg)
Datalogforeningen <bigwig> December 7, 1999
Language Requirements
• Compilation-based:– Static checks– (Efficiency)
• Domain specific:– Check Web related issues
• Explicit control-flow:– A clear service specification
![Page 26: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/26.jpg)
Datalogforeningen <bigwig> December 7, 1999
Session-Centered
Internet
show
showN
server:client:
N
![Page 27: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/27.jpg)
Datalogforeningen <bigwig> December 7, 1999
Hello World
service { session Hello() { html D = <html>Hello World!</html>; show D; }}
![Page 28: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/28.jpg)
Datalogforeningen <bigwig> December 7, 1999
Hello World
service { session Hello() { show <html>Hello World!</html>; }}
![Page 29: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/29.jpg)
Datalogforeningen <bigwig> December 7, 1999
A Page Counterservice { session Access() { global int counter; string name; show EnterName receive [name=name]; counter = counter + 1; show AccessDoc <[counter = counter]; }}
![Page 30: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/30.jpg)
Datalogforeningen <bigwig> December 7, 1999
A Page Counter if (counter == 100) { show Congratulations <[name = name]; counter = 0; } else { show EnterName receive [name=name]; }
![Page 31: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/31.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol– Session model requires state
• No bookmarking– CGI, not HTML URL
• Back-button problem– “Step-back-in-time” does not make sense
![Page 32: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/32.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 33: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/33.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 34: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/34.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI HTML
HTMLCGI
restore ;compute ;save
![Page 35: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/35.jpg)
Datalogforeningen <bigwig> December 7, 1999
Adding a ”Connector”
Internet
client
HTTP server
program
database
CGI
HTML
CGIconnector
HTML
CGI
HTML
restore ;compute ;save
redirect
![Page 36: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/36.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 37: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/37.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 38: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/38.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI
HTML
CGIconnector
HTML
CGI
HTML
![Page 39: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/39.jpg)
Datalogforeningen <bigwig> December 7, 1999
Adding an HTML “Reply File”
Internet
client
HTTP server
program
database
CGI
done!
CGIconnector
jump
CGI
jump
HTMLreplyfile
HTML
![Page 40: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/40.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 41: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/41.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 42: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/42.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI
done!
CGIconnector
jump
CGI
jump
HTMLreplyfile
HTML
![Page 43: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/43.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI
done!
CGIconnector
jump
CGI
jump
HTMLreplyfile
HTML
same URL
![Page 44: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/44.jpg)
Datalogforeningen <bigwig> December 7, 1999
CGI Shortcomings
• Stateless protocol• No bookmarking• Back-button problem
![Page 45: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/45.jpg)
Datalogforeningen <bigwig> December 7, 1999
Additional Problems
![Page 46: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/46.jpg)
Datalogforeningen <bigwig> December 7, 1999
Additional Problems
![Page 47: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/47.jpg)
Datalogforeningen <bigwig> December 7, 1999
What is going on?• Error?
– Package Lost, Service Crash, Connection down?• Ok?
– Searching Database, Long Computation, Waiting for a Resource?
• Would like to explain delays:– “searching database, please wait...”
![Page 48: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/48.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI
done!
CGIconnector
jump
CGI
jump
HTMLreplyfile
HTML
![Page 49: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/49.jpg)
Datalogforeningen <bigwig> December 7, 1999
Adding a Connector Timeout
Internet
client
HTTP server
program
database
CGI
done
CGIconnector
jump
CGI
jump
HTMLreplyfile
update
Timeout
![Page 50: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/50.jpg)
Datalogforeningen <bigwig> December 7, 1999
Concurrency Control
• Problem: Parallel service processes.– Access shared resources.– Require synchronization.
• Solution:– Specification of checkpoints & constraints– Synthesize centralized safety controller
• Ensures that service obeys constraints.
![Page 51: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/51.jpg)
Datalogforeningen <bigwig> December 7, 1999
Components
Internet
client
HTTP server
program
database
CGI
done
CGIconnector
jump
CGI
jump
HTMLreplyfile
update
Timeout
![Page 52: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/52.jpg)
Datalogforeningen <bigwig> December 7, 1999
Adding a Safety Controller
Internet
client
HTTP server
program
database
CGI
done
CGIconnector
jump
CGI
jump
HTMLreplyfile
updatecontrollerwait
pass
Timeout
![Page 53: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/53.jpg)
Datalogforeningen <bigwig> December 7, 1999
Concurrency Control
counter = counter + 1;
![Page 54: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/54.jpg)
Datalogforeningen <bigwig> December 7, 1999
Concurrency Control
wait A;counter = counter + 1;wait B;
![Page 55: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/55.jpg)
Datalogforeningen <bigwig> December 7, 1999
Concurrency Control
wait A;counter = counter + 1;wait B;
t,t’’: A(t) A(t’’) t’: t<t’<t’’ B(t’)
![Page 56: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/56.jpg)
Datalogforeningen <bigwig> December 7, 1999
A Page Counterservice { session Access() { global int counter; counter = counter + 1; }}
![Page 57: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/57.jpg)
Datalogforeningen <bigwig> December 7, 1999
A Page Counter (with Macros)service { session Access() { region global int counter; exclusive (counter) { counter = counter + 1; } }}
![Page 58: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/58.jpg)
Datalogforeningen <bigwig> December 7, 1999
Demo Example: Mutexint i;bool quit;while (!quit) { flash WaitToEnterDoc; wait A; show DocA <[no=i] receive [quit = quit]; i++;}show GoodByeDoc;
![Page 59: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/59.jpg)
Datalogforeningen <bigwig> December 7, 1999
Runtime System• Availability:
– In <bigwig> compiler and– As stand-alone package
![Page 60: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/60.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 61: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/61.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 62: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/62.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Traditionally: printf / <% print(...) %>
• Problems:– Only linear construction– Programmer/Designer tasks not separated– No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 63: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/63.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Traditionally: printf / <% print(...) %>
• Problems:– Only linear construction– Programmer/Designer tasks not separated– No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 64: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/64.jpg)
Datalogforeningen <bigwig> December 7, 1999
Our Solution: Document Templates
• HTML HTML with named gaps
• ...gaps plugged at runtime.
<html> <body bgcolor=[bgcolor]> <h1>Hello <[what]>!</h1> </body></html>
![Page 65: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/65.jpg)
Datalogforeningen <bigwig> December 7, 1999
Dynamic Documents
• Domain specific type: html (with gaps)– type ::= int | float | string | ... | html
• Domain specific (sub)language: DynDoc– exp ::= ... | c | id | id = exp | exp <[id = exp]– stm ::= ... | show exp; |
show exp receive [ id = id ];
![Page 66: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/66.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plug
• Syntax:– exp ::= exp <[id = exp]
• Semantics:
![Page 67: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/67.jpg)
Datalogforeningen <bigwig> December 7, 1999
Show / Show-Receive
• Syntax:– stm ::= show exp; |
show exp receive [ id = id ];
• Semantics:N
showshow
receive
![Page 68: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/68.jpg)
Datalogforeningen <bigwig> December 7, 1999
Hello World (revisited)
session Hello() { html H; html D = <html>Hello <[what]>!</html>; H = D <[what = “World”]; show H;}
![Page 69: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/69.jpg)
Datalogforeningen <bigwig> December 7, 1999
Example: EnterData
string name, email;html Input = <html> name: <input name=“your_name”> email: <input name=“your_email”></html>;
show Input receive [name = your_name,email = your_email];
![Page 70: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/70.jpg)
Datalogforeningen <bigwig> December 7, 1999
Rec. Example: Genealogy
html GenDoc = <html><ul><li>...</ul></html>;
html genTree(int n, string s) { if (n == 0) return <html></html>; else return GenDoc <[mother = s + “mother”,
mothers_tree = genTree(n-1, “mother’s”),father = s + “father”,father_tree = genTree(n-1, “father’s”)];
}
![Page 71: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/71.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction– Programmer/Designer tasks not separated– No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 72: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/72.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated– No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 73: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/73.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated – No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 74: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/74.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated – No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 75: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/75.jpg)
Datalogforeningen <bigwig> December 7, 1999
Static Guarantees?
• Documents Well-formed:• Two gaps with same name?• Field consistency?
• Plug operation:• Gap present?• Well-defined gap/field union?
• Show/Receive correspondence:• All fields received?• Receive types match?
![Page 76: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/76.jpg)
Datalogforeningen <bigwig> December 7, 1999
Domain Specific Analysis
• Interprocedural data-flow analysis:
– Infer exact types of all documents in program: (gaps, fields).
– check:• documents well-formed• plug operations• show/receive correspondence
![Page 77: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/77.jpg)
Datalogforeningen <bigwig> December 7, 1999
Highly Domain Specificerror
checkbox
checkbox1
nofield
radioordinary
rel(F ) ... rel(F )
tup(F ) ... tup(F )
1 n
1 n
FieldLattice:
![Page 78: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/78.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated – No Show/Receive correspondence– Legal/sensible HTML generated?
![Page 79: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/79.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated – No Show/Receive correspondence – Legal/sensible HTML generated?
![Page 80: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/80.jpg)
Datalogforeningen <bigwig> December 7, 1999
Documents
• Problems:– Only linear construction – Programmer/Designer tasks not separated – No Show/Receive correspondence – Legal/sensible HTML generated? ( )
![Page 81: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/81.jpg)
Datalogforeningen <bigwig> December 7, 1999
Future Plan
• Analyze generated HTML documents– with respect to:
• HTML 3.0 / 4.0 / ...• DTD / DSD / ...
• Ensure that only “legal” documents are generated
![Page 82: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/82.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 83: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/83.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 84: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/84.jpg)
Datalogforeningen <bigwig> December 7, 1999
Server-side Input Validation
N
N
validate
re-validate ;compute...
submit
re-submit
re-send
send
![Page 85: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/85.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time• Excess network traffic• Requires explicit programming
– Affects all parties involved:• client• server• programmer
![Page 86: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/86.jpg)
Datalogforeningen <bigwig> December 7, 1999
Client-side Input Validation
N
(validate );compute...
submit
send
validate
![Page 87: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/87.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time• Excess network traffic• Requires explicit programming
![Page 88: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/88.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic• Requires explicit programming
![Page 89: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/89.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic • Requires explicit programming
![Page 90: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/90.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic • Requires explicit programming:
• re-showing of pages• actual validation
![Page 91: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/91.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic • Requires explicit programming:
• re-showing of pages • actual validation
![Page 92: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/92.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic • Requires explicit programming:
• re-showing of pages • actual validation
![Page 93: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/93.jpg)
Datalogforeningen <bigwig> December 7, 1999
Drawbacks
• It takes time • Excess network traffic • Requires explicit programming:
• re-showing of pages • actual validation
– Client, server: – Programmer:
![Page 94: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/94.jpg)
Datalogforeningen <bigwig> December 7, 1999
Obvious Language: JavaScript
• Why avoid JavaScript?:– GPL for very specific task– Operational form– Diverging Browser Implementations:
• Netscape vs. Explorer
![Page 95: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/95.jpg)
Datalogforeningen <bigwig> December 7, 1999
Our Solution: PowerForms
• Domain specific language:– targeted uniquely for input validation
• Declarative nature (regexps):– abstracts away operational details
PowerFormsDeclarativeSpecification
JavaScript(subset)
![Page 96: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/96.jpg)
Datalogforeningen <bigwig> December 7, 1999
Syntax
• decl ::= format id = regexp ;• regexp ::= id | stringconst
| union ( regexp* ) | concat ( regexp* ) | star ( regexp ) | ...
<input type=“text” name=“N” format=“F”>
![Page 97: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/97.jpg)
Datalogforeningen <bigwig> December 7, 1999
Example: Email Format
format Alpha = union(range(‘a’,’z’),range(‘A’,’Z’));format Word = ...;format Email = concat(Word,“@”,Word,
star(“.”,Word));
![Page 98: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/98.jpg)
Datalogforeningen <bigwig> December 7, 1999
Example: EnterData (revisited)
html Input = <html> name: <input name=“name”> email: <input name=“email”></html>;
show Input receive [name=name,email=email];
![Page 99: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/99.jpg)
Datalogforeningen <bigwig> December 7, 1999
Example: EnterData (revisited)
format Email = ...;
html Input = <html> name: <input name=“name”> email: <input name=“email” format=“Email”></html>;
show Input receive [name=name,email=email];
![Page 100: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/100.jpg)
Datalogforeningen <bigwig> December 7, 1999
Field Interdependency
...usually only handled on server-side
![Page 101: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/101.jpg)
Datalogforeningen <bigwig> December 7, 1999
PowerForms (also)
• Extend (declarative specification):– formats depend on values of other fields
– Update accordingly (fixed-point process):• text / password: status icons updated• radio / checkbox: illegal options deselected• select: illegal options filtered (and deselected)
![Page 102: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/102.jpg)
Datalogforeningen <bigwig> December 7, 1999
Example Demos
• “Spouse”• Basic interdependency
• “Vowels and Consonants”• Select filtering
• “NYC Office”• Complex interdependency
...speak for themselves...
![Page 103: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/103.jpg)
Datalogforeningen <bigwig> December 7, 1999
Applets Integration
“Treat applets as regular input fields”
PowerApplet
SlideBar
Java:<applet code=“SlideBar.class”> <param name=“low” value=“32”> <param name=“high” value=“212”> <result name=“choice”></applet>
(PowerForms) HTML:
![Page 104: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/104.jpg)
Datalogforeningen <bigwig> December 7, 1999
PowerForms: Stand-alone Tool
PowerFormsXML
regexp formatsJavaScript(subset)
HTML HTML
![Page 105: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/105.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 106: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/106.jpg)
Datalogforeningen <bigwig> December 7, 1999
Plan
• Introduction• Runtime System• Dynamic Documents• PowerForms• Conclusion
![Page 107: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/107.jpg)
Datalogforeningen <bigwig> December 7, 1999
<bigwig> Publications
• <bigwig> ...submitted• Runtime System WWW 8, Toronto• Concurrency Control FASE’98, Lisbon• Database (IPL’92)• Dynamic Documents POPL’00, Boston• PowerForms ...submitted• Macros ...underway
– Planned:• Security / Cryptographic security / Workflow
![Page 108: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/108.jpg)
Datalogforeningen <bigwig> December 7, 1999
Professional Tool
• BUT,– Also a research project
• Not (yet) ideal for:– Heavy access
• Runtime system: CGI Spec. Web Server– Huge datasets
• External database
![Page 109: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/109.jpg)
Datalogforeningen <bigwig> December 7, 1999
Availability?
• <bigwig>: 1.5 MB C source• for UNIX/Linux
– Also as stand-alone packages:• Runtime System• PowerForms
• License?– “Almost do what you want”
![Page 110: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/110.jpg)
Datalogforeningen <bigwig> December 7, 1999
YOU:
• Free interesting tool– Use all of <bigwig> or– Use stand-alone packages
• Runtime System• PowerForms
• Look out for future developments
![Page 111: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/111.jpg)
Datalogforeningen <bigwig> December 7, 1999
US:
• Feedback• New ideas• Spread the word!
![Page 112: < bigwig > A Programming Language for Developing Interactive Web Services](https://reader035.vdocument.in/reader035/viewer/2022070502/56814bf0550346895db8d7cd/html5/thumbnails/112.jpg)
Datalogforeningen <bigwig> December 7, 1999
What is <bigwig>?– Runtime System– Concurrency Control– Database– Dynamic Documents– PowerForms– Security / Cryptographic security– Syntactic-level Macros
http://www.brics.dk/bigwig/