Ur: Statically-Typed Metaprogramming with Type-Level Record Computation Adam Chlipala PLDI 2010.

Slides:



Advertisements
Similar presentations
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Advertisements

The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Designing a Database Unleashing the Power of Relational Database Design.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
Databases Dan Otero Alex Loddengaard
Databases & Data Warehouses Chapter 3 Database Processing.
Project Proposal: Academic Job Market and Application Tracker Website Project designed by: Cengiz Gunay Client: Cengiz Gunay Audience: PhD candidates and.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
1 Introduction to databases concepts CCIS – IS department Level 4.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Simple Database.
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Architecture Planning and designing a successful system Use tried and tested techniques Easy to maintain Robust and long lasting.
Attacking Applications: SQL Injection & Buffer Overflows.
Ruby on Rails CSE 190M, Spring 2009 Week 6. Overview How to use a database Demo creating a blog application on Rails Explain how the application works.
11 Using ADO.NET II Textbook Chapter Getting Started Last class we started a simple example of using ADO.NET operations to access the Addresses.
WEEK 1, DAY 2 STEVE CHENOWETH CSSE DEPT CSSE 533 –INTRO TO MONGODB.
We will cover in this lecture A first look at issues related to Security Maintenance Scalability Simple Three Tier Architecture Module Road Map Assignment.
What have we learned?. What is a database? An organized collection of related data.
CS499 Project #3 XML mySQL Test Generation Members Erica Wade Kevin Hardison Sameer Patwa Yi Lu.
MySQL Importing and creating a database. CSV (Comma Separated Values) file CSV = Comma Separated Values – they are simple text files containing data which.
Information Systems Today: Managing in the Digital World TB3-1 3 Technology Briefing Database Management “Modern organizations are said to be drowning.
Planning & Creating a Database By Ms. Naira Microsoft Access.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
SE305 Database System Technology 25/09/2014 Quiz-1.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Chapter 1: Introduction. 1.2 Database Management System (DBMS) DBMS contains information about a particular enterprise Collection of interrelated data.
2 Copyright © 2008, Oracle. All rights reserved. Building the Physical Layer of a Repository.
Computer Science School of Computing Clemson University Reasoning with Queues and Web Interface Demo.
1 A Sane Approach to Modern Web Application Development Adam Chlipala February 22, 2010.
CS242 SQL. What is SQL? SQL:  stands for Structured Query Language  allows you to access a database  is an ANSI standard computer language  can execute.
School of Informatics University of Edinburgh An Introduction to Ruby on Rails Ken Dawson.
Ur/Web: A Simple Model for Programming the Web
Feature-Level Modularity in Ur/Web Adam Chlipala WG 2.16 meeting, August 2013.
Safe Database Abstractions with Type-Level Record Computation Adam Chlipala RADICAL 2010.
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 DBMS Purpose of Database Systems View of Data
Databases and the MVC Model
DYNAMIC APEX COMPONENTS
Generating Pieces of Web Applications with Type-Level Programming
Types for Programs and Proofs
Chapter 1: Introduction
CSC 222: Object-Oriented Programming
POOL persistency framework for LHC
SQL OVERVIEW DEFINING A SCHEMA
Nicholas Shahan Spring 2016
Structured Query Language
Chapter 15 Introduction to Rails.
Introduction to DBMS Purpose of Database Systems View of Data
Lecture 2 Database & SQL Continued
Creating and Managing Database Tables
Databases and the MVC Model
Chapter 18 Finalizing a Database.
Object Relational Mapping Tools
Dynamic Sql Not so scary?
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
IBM C IBM Big Data Engineer. You want to train yourself to do better in exam or you want to test your preparation in either situation Dumpspedia’s.
IT Solutions for Administrators - Databases
Microsoft Access 2010 Lesson 2 Access Lesson 2 Lesson Plans
Martin Rinard, Jiasi Shen, Varun Mangalick
Presentation transcript:

Ur: Statically-Typed Metaprogramming with Type-Level Record Computation Adam Chlipala PLDI 2010

2 Programmer Effort Strength of Guarantee Verification Types Web Applications Operating Systems Compilers Runtime systems.... Dependent Types Type-Level Computation Ur/Web, a domain-specific language for metaprogramming Web applications

3 Object-Relational Mapping SQL Table Schema Metaprogram Object-Oriented Interface ● Add row ● Modify row ● Search ●...

4 Automatic Admin Interface SQL Table Schema IdABCD Metaprogram

5 In-Browser Spreadsheet

6 Ad-Hoc Code Generation? SQL Table Schema IdABCD script/generate scaffold T Id:int A:string B:float C:string D:int Metaprogra m app models post.rb views posts index.html.erb show.html.erb config routes.rb.... Edit some source files to customize.... Now change the database schema....

7 Run-Time Reflection? SQL Table Schema IdABCD Library uses reflection to behave differently based on object metadata How do we know that this library is correct? How can we be sure that the library never produces code vulnerable to code injection attacks or other failures of abstraction?

8 A Solution Inspired by Dependent Typing SQL Table Schema IdABCD Metaprogram (Static type guarantees correct operation!) Uses type-level computation Code-level iteration over types Guaranteed free of injection vulnerabilities, for any metaprogram input

9 table t1 : {Id : int, A : int, B : string, C : float, D : bool} PRIMARY KEY Id open Crud.Make(struct val tab = t1 val title = "Crud1" val cols = {A = Crud.int "A", B = Crud.string "B", C = Crud.float "C", D = Crud.bool "D"} end) An Example Application SQL Table Schema IdABCD Metaprogram Iterate over the structure of this record.

10 What's in the Type System? ● Type-level functions: (t. t → t) ● Type-level records: [A = (t. t → t), B = (t. t)] ● Type-level record concatenation: A ++ B ● Type-level map: map (t. t → t) [A = int, B = float] ● Disjointness constraints: [A = int, B = float] ~ r ● Automatic application of algebraic laws – E.g., map f (map g r) = map (f ○ g) r

11 Higher-Order Polymorphism HtmlPage adminInterface (Metadata m) { /* iterate over m */ } fun 'T adminInterface (m : 'T Metadata) : HtmlPage = (* iterate over m? *) fun ['T :: Type] adminInterface (m : 'T Metadata) : HtmlPage = (* iterate over m? *) fun ['T :: {Type}] adminInterface (m : $(map Metadata 'T)) (it : 'T Iterator) : HtmlPage = it (* appropriate arguments here... *)

12 Ur/Web Available At: Including online demos with syntax-highlighted source code