Ur/Web: A Simple Model for Programming the Web

Slides:



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

The DataFlex Web Framework Changing the Game Stephen W. Meeley Development Team Data Access Worldwide
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
Multiple Tiers in Action
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Intelligent Tutoring System Mobile Communication Team Drew Boatwright Nakul Dureja Richard Liou.
Client/Server Architectures
Presented by…. Group 2 1. Programming language 2Introduction.
Lightning Talk Fred Rodriguez Nguyen Do CPSC 473 May 6, 2012.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
Microsoft ASP.NET Beginning Object-Oriented Web Design Bryan Jenks © Integrated Ideas 2005.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
Overview Web Technologies Computing Science Thompson Rivers University.
1/7/2016www.infocampus.co.in1. 1/7/2016www.infocampus.co.in2 Web Development training gives you and all-round training in both the design and the development.
Feature-Level Modularity in Ur/Web Adam Chlipala WG 2.16 meeting, August 2013.
Ur/Web, a Domain-Specific Functional Programming Language for Modern Web Applications Adam Chlipala.
Ur/Web: A Statically-Typed Language for Building Web Applications from Components Adam Chlipala Emerging Languages Camp 2010.
Introduction to AJAX Pat Morin COMP Outline What is AJAX? – History – Uses – Pros and Cons An XML HTTP Transaction – Creating an XMLHTTPRequest.
CX Introduction to Web Programming
Introducing the Microsoft® .NET Framework
Web Technologies Computing Science Thompson Rivers University
Web API - Introduction AJAX, Spring Data REST SoftUni Team Web API
Top 8 Best Programming Languages To Learn
INLS 623– Stored Procedures
Introduction to Dynamic Web Programming
Security: Exploits & Countermeasures
Mobile App Development
Open Source distributed document DB for an enterprise
AJAX and REST.
The Transition to Modern Office Add-in Development
Server Concepts Dr. Charles W. Kann.
Web Software Model CS 4640 Programming Languages for Web Applications
Application with Cross-Platform GUI
Static Checking of Dynamically-Varying Security Policies in Database-Backed Applications Adam Chlipala OSDI 2010.
Asynchronous Java script And XML Technology
AJAX.
PHP / MySQL Introduction
WEB API.
Beginning Object-Oriented Web Design
IS 360 Course Introduction
Web Browser server client 3-Tier Architecture Apache web server PHP
AJAX Robin Burke ECT 360.
Asynchronous Javascript And XML
Modern web applications
Lecture 1: Multi-tier Architecture Overview
Web Application Architectures
ASP.NET Module Subtitle.
Modern web applications
Secure Web Programming
Web Application Architectures
Middleware, Services, etc.
Security: Exploits & Countermeasures
Back end Development CS Programming Languages for Web Applications
PHP Forms and Databases.
DR. JOHN ABRAHAM PROFESSOR UTPA
Web Technologies Computing Science Thompson Rivers University
Client-Server Model: Requesting a Web Page
Web Application Architectures
Web Client Side Technologies Raneem Qaddoura
Security: Attacks & Countermeasures
Back end Development CS Programming Languages for Web Applications
Web Application Development Using PHP
Message Passing Systems
Presentation transcript:

Ur/Web: A Simple Model for Programming the Web Adam Chlipala – MIT CSAIL POPL 2015 January 15, 2015

Ur / Web Ur Web A new general-purpose typed functional language Tools for implementing modern three-tier web applications Motto: “the compiler understands the structure of your web app.” Focuses on: Programmer productivity Security Performance (especially server-side, for scaling)

There are at least several users whom I have never met! The first commercial Ur/Web application: BazQux Reader, by Vladimir Shabanov Feed reader with comments http://www.bazqux.com/ On the order of 1000 paying users daily

TechEmpower Web Framework Benchmarks <http://www. techempower 3rd-party benchmarking initiative 93 frameworks in test to the right Ur/Web's performance: 4th best throughput (~100 krps) Best latency (2.1 ms) At the top of the chart in the preview results for the next round

This is reasonably real. You can download it and build some nifty Web apps. Open source at: http://www.impredicative.com/ur/ Bonus talk content: Background: a general model for programming distributed applications Background: the mess that is today's mainstream Web development techniques Ur/Web's simpler model for programming Web apps, with 2 big ideas: Encapsulation that crosses nodes of a distributed system A simple concurrency model for distributed systems Code demo

Distributed Systems (Hard) (look of mistrust) Node Node Node Node Node

Why Distributed Systems? Physics forces distribution in space to scale performance. Mutually distrusting users controlling distinct resources Challenges: Mutable state Concurrency Security

The Restricted Model of Many Web Apps Simple communication topology: only edges are between server and clients Server Most optimization work focused on server, especially for “scaling” “Thin client”: most client state is ephemeral. Centralized security: server under tight control; clients can do whatever they want. We don't care if troublemakers corrupt their own state, and server state is behind an API. Client Client Client ….................................... flashy UI

What Web programmers expect today Web Server Database SQL HTTP, URLs HTTP, HTML, HTTP, XML/JSON HTTP, XML/ JSON Browser …................................................ Browser Browser Browser AJAX! Comet (long polling) or WebSockets JavaScript All represented as normal strings in most frameworks! Hello, code injection attacks! The DOM (a big old mutable global variable, modified by looking up nodes by string ID)

function for rendering based on contents The Ur/Web model An application is written entirely in Ur/Web source code, exposing this view: Typed message-passing channels stored in DB and passed to clients. Strongly typed SQL syntax tree Web Server Database List of records of native Ur values Native Ur value Native Ur value Strongly typed document tree Key point: semantics says requests are run one at a time (the standard transaction abstraction). First-class function to run on server (marked as AJAX-style) Key point 1: threads are spawned in Ur/Web code and themselves run Ur/Web code. First-class function to run on server contains Browser Thread …........... …... Browser Browser Key point 2: client-side threading is cooperative, with thread switches only at well-defined points (a natural choice in JavaScript). Document Mutable cells …... (functional-reactive GUI style) function for rendering based on contents

Big Language Design Idea #1: Encapsulation What should we encapsulate? [On server:] Database tables RPC endpoints Message-passing channels [On client:] Subtrees of a client-side page Cookies (persistent store) Server Module encapsulating bits of state across the system Client Client Client ….................................... flashy UI

Big Language Design Idea #2: Concurrency Server may also send messages to other clients, and all deliveries re: the same RPC appear to happen atomically. RPC goes into a queue on the server. Later, server runs it atomically and places result back on client. Server c c A thread ends its cooperative slice with certain actions, like an RPC to the server. Semantics is that, at any time, just one thread is running across the whole system! f(a) b Big Idea: Semantics presents the illusion that just one thread is running at a time, across the whole system! f(a) User interactions may trigger creation of new threads. Threads Client Client Client ….................................... flashy UI

Demo time!

Open source at: http://www.impredicative.com/ur/