Giuseppe Attardi Dipartimento di Informatica Università di Pisa

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Names and Scopes CS 351. Program Binding We should be familiar with this notion. A variable is bound to a method or current block e.g in C++: namespace.
Principles of Object-Oriented Software Development The language Java.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
First appearedFeaturesMain paradigmsPopular uses COMPUTING Basic FOR A=1 TO 100 IF A MOD 15 = 0 THEN PRINT “FizzBuzz” ELSE IF A MOD 3 = 0 THEN PRINT “Fizz”
Programming Languages and Paradigms Object-Oriented Programming.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa.
Programming Paradigms Procedural Functional Logic Object-Oriented.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Component-Based Software Engineering Introduction to.NET Paul Krause.
.NET Framework Danish Sami UG Lead.NetFoundry
10/16/ Realizing Concurrency using the thread model B. Ramamurthy.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Introducing Allors Applications, Tools & Platform.
Tools, Formats, & Solutions.  Survey of literature found 3 interesting ways Petri Nets are used  BioPNML – Petri Nets for Bio  GJobDL – Petri Nets.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
introductory lecture on java programming
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
Programming Language Paradigms ITSK2314 Lecture 3.
7/9/ Realizing Concurrency using Posix Threads (pthreads) B. Ramamurthy.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Chapter 1. Introduction.
Programming Languages 2nd edition Tucker and Noonan
Introduction to Object-oriented Programming
Object Oriented Programming in
The language focusses on ease of use
Modern Programming Tools And Techniques-I
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Why study programming languages?
Basic 1964 PC general purpose Imperative Small Easy to use.
Scope and Code Generation
Types for Programs and Proofs
Sections Basic Concepts of Programming
Operating System Concepts
Realizing Concurrency using the thread model
Inheritance and Big O And your first reading assignment
Internet and Java Foundations, Programming and Practice
Types of Programming Languages
Drupal VM and Docker4Drupal For Drupal Development Platform
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
CS360 Windows Programming
Drupal VM and Docker4Drupal as Consistent Drupal Development Platform
Getting Started ARCS Lab..
Introduction to MATLAB
Realizing Concurrency using Posix Threads (pthreads)
Realizing Concurrency using the thread model
Introduction to Java Originally developed by James Gosling at Sun Microsystems In 1991 named “OAK” In 1995, this language was renamed as “Java”. (which.
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
COP4020 Programming Languages
More Object-Oriented Programming
Realizing Concurrency using Posix Threads (pthreads)
Realizing Concurrency using the thread model
Realizing Concurrency using Posix Threads (pthreads)
CS510 Operating System Foundations
Programming Languages and Paradigms
Course Overview PART I: overview material PART II: inside a compiler
CSE 153 Design of Operating Systems Winter 2019
Chap 1. Getting Started Objectives
Programming Paradigms
IS 135 Business Programming
Plug-In Architecture Pattern
Presentation transcript:

Giuseppe Attardi Dipartimento di Informatica Università di Pisa Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa

Run-time Environments

Run-Time Environments Java Virtual Machine .NET Common Language Runtime Provide a virtual execution environment Exposes a structure organized into elements Not a simple abstraction of physical resources

Controlling execution Avoid damages Install/uninstall is a nightmare Component software?

Benefits Programmers Tool Developers Administrators and Users Use of library and tools Shorter integration time Higher productivity Tool Developers Avoid the need to care about infrastructure and interoperability Administrators and Users Benefit from packages solutions Independence from processors or OS

Common Language Infrastructure Exposes all items in a unified type system Packages elements in self-describing units Loads and resolves interdependencies at runtime Exposes information that allows verifying the type-safety Execution Engine enforces politics Metadata available at runtime enables dynamic and extensible solutions

Question Is it feasible to build a runtime common to all programming languages?

More in detail Prolog PHP 3 LISP How to implement logic variable? Can one use the Warren-Abstract-Machine? PHP 3 Why assignment has unusual behavior? LISP How to handle multiple-values?

Prolog example append(X, Y, Z) :- append(NIL, Y, Y) :- append([A . X], Y, [A . Z] ) :- append(X, Y, Z). :- append([a . b . c], [d . e], R) R = [a . b . c . d . e]

Prolog backtrack :- append(X, Y, [a . b]) :- append(X, NIL, [a . b]) X = [a] Y = [b] X = [a . b] Y = NIL

PHP Assignement $str = ‘Ciao.’; $str2 = $str; $str{strlen($str) – 1} = ‘!’; echo $str2; $var = $othervar Performs copy of the value of $othervar $var = &$othervar Assignment by reference

Control Can we implement tail-recursion in C? How to handle synchronization? Function pointers? How to invoke an arbitrary function given a list of arguments?

General Function Invoker invoke(fun, argn, arglist) { if (n==0) return f(); else if (n==1) return f(arg[0]); else return fun(arg[0], arg[1], .. , arg[n-1]); }

Basic Data Types Strings in C, Pascal and C++ are different Array in row or column order?

Language Interoperability C# and Cobol bark at each other

C# dog using System; public class Dog { public virtual void RollOver () { Console.WriteLine("Scratch my tummy."); Bark(); } public virtual void Bark () { Console.WriteLine("WOOF WOOF (C#)");

Cobol BigDog 000010 CLASS-ID. BigDog INHERITS Dog. 000020 ENVIRONMENT DIVISION. 000040 CONFIGURATION SECTION. 000050 REPOSITORY. 000060 CLASS Dog. 000070 OBJECT. 000080 PROCEDURE DIVISION. 000090 METHOD-ID. Bark OVERRIDE. 000160 PROCEDURE DIVISION. DISPLAY "WOOF WOOF (COBOL)". 000210 END METHOD Bark. 000220 END OBJECT. 000230 END CLASS BigDog.

Barfing dogs public class Demo { public static void Main() { Dog d = new Dog(); BigDog b = new BigDog(); d.RollOver(); b.RollOver(); } }