Color: A Modern Web Development Language Mark J. Stahl Advised By: Dr. Mark Burge Department of Computer Science Undergraduate Project.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Sue Wills July Objects The JavaScript language is completely centered around objects, and because of this, it is known as an Object Oriented Programming.
XHTML & CSS 2 By Trevor Adams. Last week XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
Object Oriented Programming Chapter 7 Programming Languages by Ravi Sethi.
1 CIS607, Fall 2005 Semantic Information Integration Instructor/Organizer: Dejing Dou Week 1 (Sept. 28)
Tutorial 10 Programming with JavaScript
1 COS 425: Database and Information Management Systems XML and information exchange.
Javascript II Expressions and Data Types. 2 JavaScript Review programs executed by the web browser programs embedded in a web page using the script element.
ASP.NET Programming with C# and SQL Server First Edition
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
David Evans CS200: Computer Science University of Virginia Computer Science Class 29: Vocational Skills How to Build a.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 19 Clicker Questions November 3, 2009.
CSS/417 Introduction to Database Management Systems Workshop 5.
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
The Document Object Model. Goals Understand how a JavaScript can communicate with the web page in which it “lives.” Understand how to use dot notation.
CISC474 - JavaScript 03/02/2011. Some Background… Great JavaScript Guides: –
Tutorial 2 Variables and Objects. Working with Variables and Objects Variables (or identifiers) –Values stored in computer memory locations –Value can.
Chapter 4 JavaScript and Dynamic Web pages. Objectives Static Web pages Dynamic Web pages JavaScript Variables Assignments. JavaScript Functions –(prompt(“”,””)
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
JavaScript, Fourth Edition
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
CSC 142 Computer Science II Zhen Jiang West Chester University
Principles of programming languages 5: An operational semantics of a small subset of C Department of Information Science and Engineering Isao Sasano.
Semantics. Semantics is a precise definition of the meaning of a syntactically and type-wise correct program. Ideas of meaning: –Operational Semantics.
Introduction to Programming Languages S1.3.1Bina © 1998 Liran & Ofir Introduction to Programming Languages Programming in C.
Semanntic Web Exercises. XML-exercises (1) 1.Give an XML-document (by not using attributes), which includes the information that the first name of a person.
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.
JavaScript Syntax, how to use it in a HTML document
CS 603: Programming Languages Lecture 25 Spring 2004 Department of Computer Science University of Alabama Joel Jones.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Representing data with XML SE-2030 Dr. Mark L. Hornick 1.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
CS 403: Programming Languages Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Logic Programming Tarik Booker. What will we cover?  Introduction  Definitions  Predicate Calculus  Prolog  Applications.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
TeachJava! 2003 Corky Cartwright Dung Nguyen Stephen Wong Charlie Reis, James Hsia, Peter Centgraf.
CPS120: Introduction to Computer Science Lecture 16 Data Structures, OOP & Advanced Strings.
CS 106 Introduction to Computer Science I 03 / 22 / 2010 Instructor: Michael Eckmann.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
1 CSC103: Introduction to Computer and Programming Lecture No 17.
Expressions and Data Types Professor Robin Burke.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: Vocational Skills (How to Build.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
ActionScript Programming Help
Programming Web Pages with JavaScript
7.1 What Is An Object Object-oriented program - Description or simulation of application Object-oriented programming is done by adopting or extending an.
Yaşar Tonta & Orçun Madran [yasartonta, Hacettepe University
Discrete Structures for Computer Science
JavaScript an introduction.
Programming Techniques
Database SQL.
Presentation transcript:

Color: A Modern Web Development Language Mark J. Stahl Advised By: Dr. Mark Burge Department of Computer Science Undergraduate Project

Introduction Color is a prototyped object-oriented language designed specifically for the development of the World Wide Web. The core of the language is based on the message-passing semantics of Self and SmallTalk. Color’s evaluator was inspired by a declarative, logic programming language called Prolog. And the syntax of Color is taken directly from JavaScript, providing the familiarity and syntactic structures of the C family of languages. Current Web Language Problems Attempt to be everything to everyone URI’s (Universal Resource Identifiers) are not linguistically considered Relational database access is still reliant upon antiquated standards (i.e. SQL) No linguistic support for markup languages (XML, HTML, etc) Color Addresses These Problems Color is not a all-purpose language, and is specific to the Web domain URI’s are used for both local and remote resource (daemon, and file) access Color uses declarative (Prolog-like) expressions for database querying Markup languages are treated the same as other Objects within Color

XML / HTML Querying The following examples illustrate the using of declarative statements and predicate logic to query XML documents var xmlFamily = Mary Joseph Joseph Eleanor Mark Joseph ; // Define an ancestor predicate ‘ancestor(?c, ?p) <- ‘parent(?c, ?p); ‘ancestor(?c, ?p) <- ‘parent(?c, ?g) && ancestor( ?g, ?p); The first statement says that ‘p’ is an ancestor of ‘c’ if ‘p’ is a parent of ‘c’. The second statement says ‘p’ is an ancestor of ‘c’ if ‘c’ has some parent ‘g’ and if ‘p’ is an ancestor of ‘g’; The second line provides a recursive definition while the first line provides the simplest definition on an ancestor. // Is Joseph an ancestor of Mark’s? ancestor(“Mark”, “Joseph”); » true // Who are Mary’s ancestors? ancestor(“Mary”, ?tree); » tree = [“Joseph”, “Eleanor”)

Relational Database Querying The following examples illustrate the using of declarative statements and predicate logic to query relational database without SQL // Define an ancestor predicate ‘ancestor(?c, ?p) <- ‘parent(?c, ?p); ‘ancestor(?c, ?p) <- ‘parent(?c, ?g) && ancestor( ?g, ?p); The first statement says that ‘p’ is an ancestor of ‘c’ if ‘p’ is a parent of ‘c’. The second statement says ‘p’ is an ancestor of ‘c’ if ‘c’ has some parent ‘g’ and if ‘p’ is an ancestor of ‘g’; The second line provides a recursive definition while the first line provides the simplest definition on an ancestor. // Is Joseph an ancestor of Mark’s? ancestor(“Mark”, “Joseph”); » true // Who are Mary’s ancestors? tree = ancestor(“Mary”, ?tree); » [“Joseph”, “Eleanor”] firstname 1 2 parent index 3 Mary Joseph Mark Joseph Eleanor The members table within the stahlfamily database.

XML / HTML Element Access The following examples illustrate using the. operators in order to return or change a single value or the entirety of an XML element var xmlFamily = Mary Joseph Joseph Eleanor Mark Joseph ; // Return the first name of the first child in the list. // Returns an XMLList object containing “Mary”. var name = xmlFamily.stahlfamily.member[0].firstname; // Change Joseph’s name to Walter xmlFamily.stahlfamily.member[1].firstname = “Walter”; // Return the parent of the third child in the list. // Returns an XML object contain: // Joseph. var parent = xmlFamily.stahlfamily.member[2][1]; // Assign a variable with Joseph’s position. // Return a String object containing “father”. var familyPos =

Relational Database Access The following examples illustrate using the. operators in order to return or change a single value or the entirety of a relational database // Obtain a database resource and assign it to xmlFamily var xmlFamily = ; // Return the first name of the first child in the list. // Returns an XMLList object containing “Mary”. var name = xmlFamily.stahlfamily.member[0].firstname; // Change Joseph’s name to Walter xmlFamily.stahlfamily.member[1].firstname = “Walter”; // Return the parent of the third child in the list. // Returns an XML object contain: // Joseph. var parent = xmlFamily.stahlfamily.member[2][1]; // Assign a variable with Joseph’s position. // Return a String object containing “father”. var familyPos = firstname 1 2 parent index 3 Mary Joseph Mark Joseph Eleanor The members table within the stahlfamily database.

The Linguistic Ancestry of Color Self( –Self provided Color with its prototyped object semantics. Color also used Self’s message-passing semantics as its core syntactic structure. Color:3 + 4» 3.add(4)» 7 Self:3 + 4or 3 add: 4» 7 JavaScript( –In order to remain familiar to the majority of programmers, JavaScript was chosen to used as the main syntactic structure Color. –With JavaScript’s infix notation and the dot operator (used for object slot access), the learning curve to become proficient with Color would be heavily decreased.

Color Objects and Object Inheritance print how to print objects proto +how to add points proto x3 x: y y: 5 proto x7 x: y y: 9 clone point how to clone an object proto x0 x: y y: 0 Each Color point intrinsically describes its own format, but appeals to another object for any behavior that is shared amount points. To create a new object in Color, the ‘clone’ message is sent to the prototypical point. The ‘clone’ method copies its receiver.

Color Syntax and Objects Identifiers and Function int x = 5;// integer object with the value of 5 x = 5; // variable of type ‘variant’ containing and // integer object fun hypo(a, b) { // function can be nested fun square(x) { return x * x; } // functions can act as data as well fun square (x) { return x * x;) a = square(4); b = square; c = b(5); Objects fun Rectangle(w, h) {// Rectangle constructor this.width = w; this.height = h; } page = new Rectangle(8, 11); // assuming a function computer_area page.area = computer_area; // assuming and object Circle // we can define a property available to all Cirlcs Circle.proto.pi = ; // or change an objects prototype at runtime page.proto = new Circle();