Microsoft Research March 20, 2000 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark.

Slides:



Advertisements
Similar presentations
Other Web Application Development Technologies. PHP.
Advertisements

ASP.NET Intro An introduction to the languages and communication of an ASP.NET system.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to JavaScript
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DATABASE APPLICATION DEVELOPMENT SAK 3408 The Web and DBMS.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Datalogforeningen December 7, 1999 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark.
Multiple Tiers in Action
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
INTRODUCTION TO WEB DATABASE PROGRAMMING
4.1 JavaScript Introduction
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Dynamic Web Sites Chris North cs3724: HCI. Presentations matt ketner, sam altman, mike gordon Vote: UI Hall of Fame/Shame?
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
Introduction to Internet Programming (Web Based Application)
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
WWW8 - Toronto "A Runtime System for Interactive Web Services" May 12, 1999 A Runtime System for Interactive Web Services Claus Brabrand, Anders Møller,
PHP and MySQL by Example COMP YL Professor Mattos.
1 3. Computing System Fundamentals 3.1 Language Translators.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Online Voting System by Sanghun Chi ECE345. Introduction Traditional voting system inefficient. Takes time and human resources. Does not give an instant.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Java Server Pages Can web pages be created specially for each user?
Applications Active Web Documents Active Web Documents.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Introduction and Principles
Web Applications Security What are web Applications?
PHP / MySQL Introduction
Web App vs Mobile App.
JavaScript an introduction.
Web Development Using ASP .NET
Chapter 27 WWW and HTTP.
Ada – 1983 History’s largest design effort
Presentation transcript:

Microsoft Research March 20, 2000 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 What is ? A domain-specific high-level programming language for developing interactive Web services. HTML CGI Scripts JavaScript HTTP Auth. Java Applets Service Specification Service Specification

Microsoft Research March 20, 2000 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

Microsoft Research March 20, 2000 A collection of DSLs C-like skeleton language with Runtime system (briefly) Concurrency control (briefly) Database Dynamic documents: DynDoc Input validation language: PowerForms Security Cryptographic security Syntactic-level macros

Microsoft Research March 20, 2000 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

Microsoft Research March 20, 2000 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,

Microsoft Research March 20, 2000 DSL Advantages (vs. GPL + library) Syntax Design (and restrict) expressibility Syntax conveys nature of constructs Analysis Analyze domain specific aspects Implementation Efficient implementation –Rely on syntax restrictions and analysis information

Microsoft Research March 20, 2000 Goals Lower development time (= cost): Targeted at Web services Low-level  high-level Increase functionality: Compiler does “the dirty work” Increase reliability: Catch errors during development –Runtime errors  Compile-time errors

Microsoft Research March 20, 2000 Assumptions “Rules of engagement”: –Lowest common denominator Any browser/Web server combination –Only include basic primitives Syntactic macro language does the rest

Microsoft Research March 20, 2000 Target Audience Programmers! –No expert Web knowledge required –No multiple choice questionnaires “Reduce Web service development to a standard programming task.”

Microsoft Research March 20, 2000 Core Language Features C-like to minimize syntactic burdens Not C-like features: –Garbage collection –Relations, vectors, tuples –Strong type checking

Microsoft Research March 20, 2000 People 1x Michael I. Schwartzbach 1x Post Doc. 5x Ph.D. students 2x Programmers 2x Testers 1x External contributor

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, Approaches Script-centered Perl/CGI

Microsoft Research March 20, Approaches Page-centered Script-centered Perl/CGI ASP, PHP

Microsoft Research March 20, Approaches Session-centered Page-centered Script-centered Perl/CGI ASP, PHP Mawl,

Microsoft Research March 20, 2000 Script-Centered A script A pageA script A pageA script A page

Microsoft Research March 20, 2000 Page-Centered A page

Microsoft Research March 20, 2000 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”

Microsoft Research March 20, 2000 Script- vs. Page-Centered As the service complexity increases: –Page-centered  Script-centered Script-centered: –default programming, escape printing. Page-centered: –default printing, escape programming.

Microsoft Research March 20, 2000 (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!

Microsoft Research March 20, 2000 Language Requirements Compilation-based: –Static checks –(Efficiency) Domain specific: –Check Web related issues Explicit control-flow: –A clear service specification

Microsoft Research March 20, 2000 Language Requirements Compilation-based: –Static checks –(Efficiency) Domain specific: –Check Web related issues Explicit control-flow: –A clear service specification

Microsoft Research March 20, 2000 Session-Centered Internet show e server:client: e one service program

Microsoft Research March 20, 2000 Hello World service { session Hello() { html D = Hello World! ; show D; }

Microsoft Research March 20, 2000 Hello World service { session Hello() { show Hello World! ; }

Microsoft Research March 20, 2000 A Page Counter service { session Access() { shared int counter; string name; show EnterName receive [name=name]; counter = counter + 1; show AccessDoc <[counter = counter]; }

Microsoft Research March 20, 2000 A Page Counter  if (counter == 100) { counter = 0; show Congratulations <[name = name]; } else { counter = counter + 1; show AccessDoc <[counter = counter]; } 

Microsoft Research March 20, 2000 CGI Shortcomings Stateless protocol Session model requires state No bookmarking CGI URL bookmarked, not HTML URL Back-button problem “Step-back-in-time” does not make sense Long response times Clients get impatient

Microsoft Research March 20, 2000 Our Solution Runtime System (based on CGI) “Any browser/Web server combination” Problems:Solutions: –Stateless protocol –No bookmarking –Back-button problem –Long response times

Microsoft Research March 20, 2000 Our Solution Runtime System (based on CGI) “Any browser/Web server combination” Problems:Solutions: –Stateless protocolconnector process –No bookmarking –Back-button problem –Long response times

Microsoft Research March 20, 2000 Our Solution Runtime System (based on CGI) “Any browser/Web server combination” Problems:Solutions: –Stateless protocolconnector process –No bookmarkinguse html reply file –Back-button problem –Long response times

Microsoft Research March 20, 2000 Our Solution Runtime System (based on CGI) “Any browser/Web server combination” Problems:Solutions: –Stateless protocolconnector process –No bookmarkinguse html reply file –Back-button problemuse html reply file –Long response times

Microsoft Research March 20, 2000 Our Solution Runtime System (based on CGI) “Any browser/Web server combination” Problems:Solutions: –Stateless protocolconnector process –No bookmarkinguse html reply file –Back-button problemuse html reply file –Long response times+ refresh + timeout

Microsoft Research March 20, 2000 Runtime System Availability: –in compiler –as stand-alone package Underway... –Specialized runtime system: CGI  Specialized Web server –efficiency, scalability

Microsoft Research March 20, 2000 Concurrency Control Problem: –Parallel service processes. Access shared resources. Require synchronization. Example: counter = counter + 1;

Microsoft Research March 20, 2000 Counter Example  counter = counter + 1; 

Microsoft Research March 20, 2000 Counter Example …add checkpoints  wait A; counter = counter + 1; wait B; 

Microsoft Research March 20, 2000 Counter Example  wait A; counter = counter + 1; wait B;   t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’) …and constraints (“M2L-Str” logic)

Microsoft Research March 20, 2000 Counter Example  wait A; counter = counter + 1; wait B;   t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’) Exclusive access “Ensure that service obeys constraints”

Microsoft Research March 20, 2000 Compilation Process  t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’) Mona DFA:

Microsoft Research March 20, 2000 In practice... service { session Access() { shared int counter;  counter = counter + 1;  }

Microsoft Research March 20, 2000 Syntax Macros service { session Access() { region shared int counter;  exclusive (counter) { counter = counter + 1; }

Microsoft Research March 20, 2000 Demo Example: MutexMutex label A, B;  t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’)

Microsoft Research March 20, 2000 Demo Example: MutexMutex label A, B;  t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’) session A() { while (!quit) { wait A; show Passed_A; }

Microsoft Research March 20, 2000 Demo Example: MutexMutex label A, B;  t,t’’: A(t)  A(t’’)  t<t’’   t’: t<t’<t’’  B(t’) session A() { while (!quit) { wait A; show Passed_A; } session B() { while (!quit) { wait B; show Passed_B; }

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Documents Traditionally: printf(…) / Problems: –Only linear construction –Programmer/Designer tasks not separated –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Traditionally: printf(…) / Problems: –Only linear construction –Programmer/Designer tasks not separated –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Our Solution: Document Templates HTML  HTML with named gaps Hello ! …gaps are plugged at runtime

Microsoft Research March 20, 2000 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 ];

Microsoft Research March 20, 2000 Plug Syntax: –exp ::= exp <[id = exp] Semantics: (no side-effects!)

Microsoft Research March 20, 2000 Hello World (revisited) session Hello() { html H = Hello ! ; html W = World ; html D; D = H <[what = W]; show D; }

Microsoft Research March 20, 2000 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”)]; }

Microsoft Research March 20, 2000 Highly Efficient Runtime Representation Time: –Plug: O(1) (constant time). –Show:O(|D|)(linear time). Space (maximum sharing): –Doc.:O(#plugs)(not O(|D|) !)

Microsoft Research March 20, 2000 Show / Show-Receive Syntax: –stm ::= show exp; | show exp receive [ id = id ]; Semantics: e show receive

Microsoft Research March 20, 2000 Example: EnterData string name, ; html Input = name: ; show Input receive [name = name, = ];

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction –Programmer/Designer tasks not separated –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated  –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated  –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Static Guarantees? Documents well-formed? Field consistency? Plug operation: Gap present? Consistent field union? Show/Receive correspondence: All fields received? Field receive types match?

Microsoft Research March 20, 2000 Answer: 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

Microsoft Research March 20, 2000 Highly Domain Specific error checkbox checkbox1 nofield  radioordinary rel(F )... rel(F ) tup(F )... tup(F ) 1n 1n (Simplified) Field lattice:

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated  –Show/Receive correspondence? –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated  –Show/Receive correspondence?  –Legal/sensible HTML generated?

Microsoft Research March 20, 2000 Documents Problems: –Only linear construction  –Programmer/Designer tasks not separated  –Show/Receive correspondence?  –Legal/sensible HTML generated? (  )

Microsoft Research March 20, 2000 Future Plan Analyze generated HTML documents –with respect to: HTML 3.2 / 4.01 /... DTD / DSD /... Ensure that only “legal” documents are generated

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Server-side Input Validation e e validate  re-validate ; compute... submit re-submit re-send send

Microsoft Research March 20, 2000 Drawbacks It takes time Excess network traffic Requires explicit programming –Affects all parties involved: client server programmer

Microsoft Research March 20, 2000 Client-side Input Validation e (validate ); compute... submit send validate

Microsoft Research March 20, 2000 Drawbacks It takes time Excess network traffic Requires explicit programming

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic Requires explicit programming

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic  Requires explicit programming

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic  Requires explicit programming: re-showing of pages actual validation

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic  Requires explicit programming: re-showing of pages  actual validation

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic  Requires explicit programming: re-showing of pages  actual validation 

Microsoft Research March 20, 2000 Drawbacks It takes time  Excess network traffic  Requires explicit programming: re-showing of pages  actual validation  –Client, server: –Programmer: 

Microsoft Research March 20, 2000 Obvious Language: JavaScript Why avoid JavaScript?: –GPL for very specific task –Operational form –Diverging browser implementations: Explorer vs. Netscape

Microsoft Research March 20, 2000 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)

Microsoft Research March 20, 2000 Syntax decl ::= format id = regexp ; regexp ::= id | stringconst | union ( regexp* ) | concat ( regexp* ) | star ( regexp ) |...

Microsoft Research March 20, 2000 Example: Format format Alpha = union(range(‘a’,’z’),range(‘A’,’Z’)); format Word =...; format = star(concat(“.”,Word)));

Microsoft Research March 20, 2000 Example: EnterData (revisited) html Input = name: ; show Input receive [name=name, = ];

Microsoft Research March 20, 2000 Example: EnterData (revisited) format =...; html Input = name: ; show Input receive [name=name, = ];

Microsoft Research March 20, 2000 Example: EnterData (revisited) format =...; html Input = name: ; show Input receive [name=name, = ];

Microsoft Research March 20, 2000 Example: EnterData (revisited)EnterData format =...; html Input = name: ; show Input receive [name=name, = ];

Microsoft Research March 20, 2000 Field Interdependency...usually only handled on server-side

Microsoft Research March 20, 2000 PowerForms (also) Extend (declarative specification): –formats depend on values of other fields –Update accordingly text / password: status icons updated radio / checkbox: illegal options deselected select: illegal options filtered (and deselected) –Note: Fixed-point process (  #fields)

Microsoft Research March 20, 2000 Example DemosDemos “Spouse” Basic interdependency “Vowels and Consonants” Select filtering “NYC Office” Complex interdependency...speak for themselves...

Microsoft Research March 20, 2000 PowerForms XML regexp formats XML regexp formats JavaScript (subset) JavaScript (subset) HTML …also as Stand-alone Tool:

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Plan Introduction Runtime Model Dynamic Documents PowerForms Conclusion

Microsoft Research March 20, 2000 Availability? : 1.5 MB C source for UNIX/Linux –Also as stand-alone packages: Runtime System PowerForms License? Gnu Public License

Microsoft Research March 20, 2000 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

Microsoft Research March 20, 2000 Current Activities –Scalable specialized runtime system. –External database integration. –Better dynamic documents. –”Next generation” syntax macros. –Security (information flow). –Cryptographic protocol integration. –Service management. –and more...

Microsoft Research March 20, 2000 What is ? –Runtime System –Concurrency Control –Database –Dynamic Documents –PowerForms –Security / Cryptographic security –Syntactic-level Macros

Microsoft Research March 20, 2000 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