Download presentation
Presentation is loading. Please wait.
1
Datalogforeningen December 7, 1999 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark
2
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
3
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
4
Datalogforeningen December 7, 1999 What is ? A domain-specific high-level programming language for developing interactive Web services. HTML CGI JavaScript HTTP Auth. Java Applets Service Specification Service Specification
5
Datalogforeningen 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
6
Datalogforeningen 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
7
Datalogforeningen 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
8
Datalogforeningen 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,
9
Datalogforeningen December 7, 1999 DSL Advantages Syntax Analysis Implementation …vs. GPL + library
10
Datalogforeningen 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
11
Datalogforeningen 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
12
Datalogforeningen 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.”
13
Datalogforeningen December 7, 1999 Core Language Features C-like to minimize syntactic burdens Features: –Garbage collection –Relations, vectors, tuples –Strong type checking
14
Datalogforeningen December 7, 1999 People 1x Michael I. Schwartzbach 1x Post Doc. 3x Ph.D. students 2x Programmers 2x Testers 1x External contributor
15
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
16
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
17
Datalogforeningen December 7, 1999 3 Approaches Script-centered Perl/CGI
18
Datalogforeningen December 7, 1999 3 Approaches Script-centered Page-centered Perl/CGI ASP, PHP
19
Datalogforeningen December 7, 1999 3 Approaches Script-centered Page-centered Session-centered Perl/CGI ASP, PHP Mawl,
20
Datalogforeningen December 7, 1999 Script-Centered A script A pageA script A pageA script A page
21
Datalogforeningen December 7, 1999 Page-Centered A page
22
Datalogforeningen 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”
23
Datalogforeningen 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.
24
Datalogforeningen 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!
25
Datalogforeningen December 7, 1999 Language Requirements Compilation-based: –Static checks –(Efficiency) Domain specific: –Check Web related issues Explicit control-flow: –A clear service specification
26
Datalogforeningen December 7, 1999 Session-Centered Internet show N server:client: N
27
Datalogforeningen December 7, 1999 Hello World service { session Hello() { html D = Hello World! ; show D; }
28
Datalogforeningen December 7, 1999 Hello World service { session Hello() { show Hello World! ; }
29
Datalogforeningen December 7, 1999 A Page Counter service { session Access() { global int counter; string name; show EnterName receive [name=name]; counter = counter + 1; show AccessDoc <[counter = counter]; }
30
Datalogforeningen December 7, 1999 A Page Counter if (counter == 100) { show Congratulations <[name = name]; counter = 0; } else { show EnterName receive [name=name]; }
31
Datalogforeningen 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
32
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
33
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
34
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGIHTML CGI restore ; compute ; save
35
Datalogforeningen December 7, 1999 Adding a ”Connector” Internet client HTTP server program database CGI HTML CGI connector HTML CGI HTML restore ; compute ; save redirect
36
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
37
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
38
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGI HTML CGI connector HTML CGI HTML
39
Datalogforeningen December 7, 1999 Adding an HTML “Reply File” Internet client HTTP server program database CGI done! CGI connector jump CGI jump HTML reply file HTML reply file HTML
40
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
41
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
42
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGI done! CGI connector jump CGI jump HTML reply file HTML reply file HTML
43
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGI done! CGI connector jump CGI jump HTML reply file HTML reply file HTML same URL
44
Datalogforeningen December 7, 1999 CGI Shortcomings Stateless protocol No bookmarking Back-button problem
45
Datalogforeningen December 7, 1999 Additional Problems
46
Datalogforeningen December 7, 1999 Additional Problems
47
Datalogforeningen 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...”
48
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGI done! CGI connector jump CGI jump HTML reply file HTML reply file HTML
49
Datalogforeningen December 7, 1999 Adding a Connector Timeout Internet client HTTP server program database CGI done CGI connector jump CGI jump HTML reply file HTML reply file update Timeout
50
Datalogforeningen 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.
51
Datalogforeningen December 7, 1999 Components Internet client HTTP server program database CGI done CGI connector jump CGI jump HTML reply file HTML reply file update Timeout
52
Datalogforeningen December 7, 1999 Adding a Safety Controller Internet client HTTP server program database CGI done CGI connector jump CGI jump HTML reply file HTML reply file update controller wait pass Timeout
53
Datalogforeningen December 7, 1999 Concurrency Control counter = counter + 1;
54
Datalogforeningen December 7, 1999 Concurrency Control wait A; counter = counter + 1; wait B;
55
Datalogforeningen December 7, 1999 Concurrency Control wait A; counter = counter + 1; wait B; t,t’’: A(t) A(t’’) t’: t<t’<t’’ B(t’)
56
Datalogforeningen December 7, 1999 A Page Counter service { session Access() { global int counter; counter = counter + 1; }
57
Datalogforeningen December 7, 1999 A Page Counter (with Macros) service { session Access() { region global int counter; exclusive (counter) { counter = counter + 1; }
58
Datalogforeningen December 7, 1999 Demo Example: MutexMutex int i; bool quit; while (!quit) { flash WaitToEnterDoc; wait A; show DocA <[no=i] receive [quit = quit]; i++; } show GoodByeDoc;
59
Datalogforeningen December 7, 1999 Runtime System Availability: –In compiler and –As stand-alone package
60
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
61
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
62
Datalogforeningen December 7, 1999 Documents Traditionally: printf / Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
63
Datalogforeningen December 7, 1999 Documents Traditionally: printf / Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
64
Datalogforeningen December 7, 1999 Our Solution: Document Templates HTML HTML with named gaps...gaps plugged at runtime. Hello !
65
Datalogforeningen 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 ];
66
Datalogforeningen December 7, 1999 Plug Syntax: –exp ::= exp <[id = exp] Semantics:
67
Datalogforeningen December 7, 1999 Show / Show-Receive Syntax: –stm ::= show exp; | show exp receive [ id = id ]; Semantics: N show receive
68
Datalogforeningen December 7, 1999 Hello World (revisited) session Hello() { html H; html D = Hello ! ; H = D <[what = “World”]; show H; }
69
Datalogforeningen December 7, 1999 Example: EnterData string name, email; html Input = name: email: ; show Input receive [name = your_name, email = your_email];
70
Datalogforeningen December 7, 1999 Rec. Example: GenealogyGenealogy html GenDoc =... ; html genTree(int n, string s) { if (n == 0) return ; else return GenDoc <[mother = s + “mother”, mothers_tree = genTree(n-1, “mother’s”), father = s + “father”, father_tree = genTree(n-1, “father’s”)]; }
71
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
72
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
73
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
74
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
75
Datalogforeningen 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?
76
Datalogforeningen 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
77
Datalogforeningen December 7, 1999 Highly Domain Specific error checkbox checkbox1 nofield radioordinary rel(F )... rel(F ) tup(F )... tup(F ) 1n 1n Field Lattice:
78
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
79
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated?
80
Datalogforeningen December 7, 1999 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –No Show/Receive correspondence –Legal/sensible HTML generated? ( )
81
Datalogforeningen 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
82
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
83
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
84
Datalogforeningen December 7, 1999 Server-side Input Validation N N validate re-validate ; compute... submit re-submit re-send send
85
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming –Affects all parties involved: client server programmer
86
Datalogforeningen December 7, 1999 Client-side Input Validation N (validate ); compute... submit send validate
87
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming
88
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming
89
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming
90
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming: re-showing of pages actual validation
91
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming: re-showing of pages actual validation
92
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming: re-showing of pages actual validation
93
Datalogforeningen December 7, 1999 Drawbacks It takes time Excess network traffic Requires explicit programming: re-showing of pages actual validation –Client, server: –Programmer:
94
Datalogforeningen December 7, 1999 Obvious Language: JavaScript Why avoid JavaScript?: –GPL for very specific task –Operational form –Diverging Browser Implementations: Netscape vs. Explorer
95
Datalogforeningen December 7, 1999 Our Solution: PowerForms Domain specific language: –targeted uniquely for input validation Declarative nature (regexps): –abstracts away operational details PowerForms Declarative Specification Declarative Specification JavaScript (subset) JavaScript (subset)
96
Datalogforeningen December 7, 1999 Syntax decl ::= format id = regexp ; regexp ::= id | stringconst | union ( regexp* ) | concat ( regexp* ) | star ( regexp ) |...
97
Datalogforeningen December 7, 1999 Example: Email Format format Alpha = union(range(‘a’,’z’),range(‘A’,’Z’)); format Word =...; format Email = concat(Word,“@”,Word, star(“.”,Word));
98
Datalogforeningen December 7, 1999 Example: EnterData (revisited) html Input = name: email: ; show Input receive [name=name,email=email];
99
Datalogforeningen December 7, 1999 Example: EnterData (revisited)EnterData format Email =...; html Input = name: email: ; show Input receive [name=name,email=email];
100
Datalogforeningen December 7, 1999 Field Interdependency...usually only handled on server-side
101
Datalogforeningen 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)
102
Datalogforeningen December 7, 1999 Example DemosDemos “Spouse” Basic interdependency “Vowels and Consonants” Select filtering “NYC Office” Complex interdependency...speak for themselves...
103
Datalogforeningen December 7, 1999 Applets Integration “Treat applets as regular input fields” PowerApplet SlideBar Java: (PowerForms) HTML:
104
Datalogforeningen December 7, 1999 PowerForms: Stand-alone Tool PowerForms XML regexp formats XML regexp formats JavaScript (subset) JavaScript (subset) HTML
105
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
106
Datalogforeningen December 7, 1999 Plan Introduction Runtime System Dynamic Documents PowerForms Conclusion
107
Datalogforeningen December 7, 1999 Publications...submitted Runtime SystemWWW 8, Toronto Concurrency ControlFASE’98, Lisbon Database(IPL’92) Dynamic DocumentsPOPL’00, Boston PowerForms...submitted Macros...underway –Planned: Security / Cryptographic security / Workflow
108
Datalogforeningen 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
109
Datalogforeningen December 7, 1999 Availability? : 1.5 MB C source for UNIX/Linux –Also as stand-alone packages: Runtime System PowerForms License? –“Almost do what you want”
110
Datalogforeningen December 7, 1999 YOU: Free interesting tool –Use all of or –Use stand-alone packages Runtime System PowerForms Look out for future developments
111
Datalogforeningen December 7, 1999 US: Feedback New ideas Spread the word!
112
Datalogforeningen December 7, 1999 What is ? –Runtime System –Concurrency Control –Database –Dynamic Documents –PowerForms –Security / Cryptographic security –Syntactic-level Macros http://www.brics.dk/bigwig/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.