Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Fremtidens programmeringssprog
Bent Thomsen
[email protected] of Computer Science
Aalborg University
2
So how would you like to programme in 20 years?
3
How would you like to program in 20 years?
• Research project (codename P2025)– Reviewing the state-of-the-art– Experimenting with advanced programming
• Functional and OO integration
– Developing a new programming language• ”The P-gang”:
• Kurt Nørmark • Lone Leth • Bent Thomsen
4
Approach
• Basic Research (Grundforskning) – someone has to do it …• We want to influence the next generation of mainstream
programming languages• Integration playground for new language ideas• Constructive: design and implement
– languages and compilers– Experimental systems
• Openness and open source• Umbrella covering the research work of the group in coming years
– Research, Master Thesis (speciale), DAT7/8 and PhD
• You are now part of a project running over several years • Several Master Student projects already done
5
2003/2004/2005/2006/2007 Projects• DAT5/INF7/SW9
– Java vs. .Net Mobile (ver. 1 and 2) – Business Process Management– Quality control in Open Source Development– Impedance mismatch (performance, C#, Java)– XML and programming language representation– Languages and games– Aspect oriented Programming
• DAT6/INF8/SW10– Mobile Business Process Infrastructure based on Ambients– Aspect.Net and JTL– Search for WS based on Semantic Web– Performance analysis of J2ME systems– Communication in Open Source Projects– New concurrency constructs in Java– Type inference for Ruby
• DAT8/D8– Java vs. C on DSP– Multiple dispatch in C#– Real-time Java– Agile development methods and PhP programming
6
Programming Language Research
• Oldest CS discipline (except HW)– All software is written in a programming language– over 50 years since first Fortran compiler
• Long term research– New ideas, concepts, … implemented in ”pure” language– May eventually become understood and incorporated in
mainstream Languages– It takes 10++ years for a paradigm shift to make it to industrial
practice– It takes 5 years from language ideas to industrial strength
implementation– And 5 years of ”deltas” to make it competitive
• High Risk – Low Reward– One in 7000 languages make it– Hardly anybody (except Bill Gates) make money on PrgL.
7
What is the Most Important Open Problem in
Computing?
8
The Most Important Open Problem in Computing
Increasing Programmer Productivity– Write programs correctly– Write programs quickly– Write programs easily
• Why?– Decreases support cost– Decreases development cost– Decreases time to market– Increases satisfaction
Todd A. Proebsting
9
How to increase Programmer Productivity?
3 ways of increasing programmer productivity:1. Process (software engineering)
– Controlling programmers– Good process can yield up to 20% increase
2. Tools (verification, static analysis, program generation)– Good tools can yield up to 10% increase
3. Language design --- the center of the universe!– Core abstractions, mechanisms, services, guarantees– Affect how programmers approach a task (C vs. SML)– New languages can yield 700% increase
10
Why Are There So Many Programming Languages
• Why does some people speak French?• Programming languages have evolved over time as
better ways have been developed to design them.– First programming languages were developed in the 1950s– Since then thousands of languages have been developed
• Different programming languages are designed for different types of programs.
11
C
Different Programming language Design Philosophies
Other languages
If all you have is a hammer, then everything looks like a nail.
12
Computers in the good old days
13
… in the beginning of time
14
Computers today
15
And there is more just around the corner …
16
And some are really really BIG
17
And everything will be diverse and parallel
18
Programming Language History1940s
The first electronic computers were monstrous contraptions– Programmed in binary machine code by hand– Code is not reusable or relocatable– Computation and machine maintenance were difficult:
• cathode tubes regularly burned out• The term ‘‘bug’’ originated from a bug that reportedly roamed
around in a machine causing short circuits
19
Programming Language HistoryLate 1940s early 1950s
• Assembly languages – invented to allow machine operations to be expressed
in mnemonic abbreviations – Enables larger, reusable, and re-locatable programs– Actual machine code is produced by an assembler– Early assemblers had a one-to-one correspondence
between assembly and machine instructions– Later: expansion of macros into multiple machine
instructions to achieve a form of higher-level programming
20
Programming Language HistoryMid 1950s
• Fortran , the first higher-level language– Now programs could be developed that were machine
independent!– Main computing activity in the 50s: solve numerical
problems in science and engineering– Other high-level languages soon followed:
• Algol 58 is an improvement compared to Fortran• Cobol for business computing• Lisp for symbolic computing and artificial intelligence• BASIC for "beginners"
21
Programming Language History1960s
• Structured Programming, Dijkstra, Dahl, and Hoare.
• Pascal, Niklaus Wirth (ETH, Zurich)– Modelled after Algol– No GOTO– Very strongly typed– Procedures nested inside each other– Designed for teaching programming
• Simula, Dahl and Nygaard (Norway)– The first language with objects, classes, and
subclasses
22
Programming Language History1970s
• C, Ken Thompson (Bell Labs)– Successor to B, which was stripped-down BCPL.– High-level constructs and low-level power
• Ada, Jean Ichbiah (France)– Instigated by the Department of Defense– Designed for systems programming, especially
embedded systems.
23
Programming Language History1970s
• Smalltalk, Alan Kay, Adele Goldberg (Xerox PARC)– Graphics-rich
• GUI• Fonts
– Object-oriented• Everything is an object• Objects communicate through messages
• Scheme, Gerald Sussman & Guy Steele (MIT)– LISP with static scoping
• Prolog, Philippe Roussel (France)– Based on rules, facts, and queries.
24
Programming Language History1980s
• Object-oriented programming– Important innovation for software development– The concept of a class is based on the notion of data
type abstraction from Simula 67 , a language for discrete event simulation that has classes but noinheritance
• 1979-1983: C++ Bjarne Stroustrop (Bell Labs)– Originally thought of as “C with classes”.– First widely-accepted object-oriented language.– First implemented as a pre-processor for the C
compiler.
25
Programming Language History1980s
• Functional Programming– Extensive list of new concepts
• Lazy vs. eager evaluation• Pure vs. imperative features• Parametric polymorphism• Type inference• (Garbage collection)
– Hope– Clean– Haskell– SML– Caml
26
Programming Language History1990s
• HTML, Tim Berners-Lee (CERN)– “Hypertext Markup Language”
• Language of the World Wide Web.– A markup language, not a programming language.
• Scripting languages– PERL.
• CGI or Apache module– TCL/TK
• Easy construction of GUIs– Languages within Web pages
• JavaScript, VBScript• PHP, ASP, JSP
• Java, James Gosling (Sun)
27
The evolution of Java• 1993 Oak project at Sun
– small, robust, architecture independent, Object-Oriented, language to control interactive TV.
– didn’t go anywhere• 1995 Oak becomes Java
– Focus on the web• 1996 Java 1.0 available• 1997 (March) Java 1.1 - some language changes, much larger
library, new event handling model • 1997 (September) Java 1.2 beta – huge increase in libraries
including Swing, new collection classes, J2EE• 1998 (October) Java 1.2 final (Java2!)• 2000 (April) Java 1.3 final• 2001 Java 1.4 final (assert)• 2004 Java 1.5 (parameterized types, enum, …)• 2005 J2EE 1.5• 2006 Java 1.6• 2006 (August) Java 1.7 project starts – Open Source!!
28java.applet, java.awt, java.io, java.lang, java.net, java.util
java.math, java.rmi, java.security, java.sql, java.text, java.beans
javax.accessibility, javax.swing, org.omg
javax.naming, javax.sound, javax.transaction
java.nio, javax.imageio,javax.net, javax.print,javax.security, org.w3c
javax.activity,javax.management
Java 1.08 packages212 classes
Java 1.123 packages504 classes
Java 1.259 packages1520 classes
Java 1.377 packages1595 classes
Java 1.4103 packages2175 classes
Java 1.5131 packages2656 classes
New Events
Inner class
Object Serialization
Jar Files
International
Reflection
JDBC
RMI
JFC/Swing
Drag and Drop
Java2D
CORBA
JNDI
Java Sound
Timer
Regular ExpLoggingAssertionsNIO
29
Programming Language History2000s
• XML• Microsoft .NET
– Multiple languages• C++• C#• Visual Basic• COBOL• Fortran• Eiffel
– Common virtual machine– Web services
30
C# History• 12/1998 – COOL project started• 07/1999 – First internal ports to COOL• 02/2000 – Named changed to C#• 07/2000 – First public preview release• 02/2002 – VS.NET 2002, C# 1.0 released• 05/2003 – VS.NET 2003, C# 1.1 released• 06/2004 – Beta 1 of VS 2005, C# 2.0• 04/2005 – Beta 2 of VS 2005, C# 2.0• 08/2005 – VS 2005, C# 2.0 released• 10/2005 – C# 3.0 announced
31
C# Language Enhancements
• C# 2.0– Generics– Anonymous methods (delegates)– Iterators
• C# 3.0– expressions as syntactic values, i.e. quoted lambda
expressions, – type inference– anonymous types
32
Programming Language Genealogy
prog_lang_poster.pdf Diagram by Peter Sestoft
33
Beyond Java 1.7 and C# 3.0
• Aspect Oriented Programming– AspectJ
• Business Process Management– BPML
• Multi Paradigm integration– C# 4.0 New concurrency model?
• C# 3.0 (XML, SQL, lambda expressions)• C Omega (C# 3.0 + Join calculus)
– X10– Scala (Functional, OO)– Fortress
34
Further ahead
• Fitting round objects into square tables– OO, SQL and XML integration
• Configuration and components level programming– Non-computation programming– Program maintenance (24 x 7)
• Business Process Programming• Model Driven Programming• Threads and Concurrency• Real-time Programming• Resource awareness
– Memory usage– Power usage (Mobile and Grid)
35
A typical web applicationWeb-Client
Web-Server
DBMS
DatabaseOutput
SQL commands
PHPScript
HTML-Form (+JavaScript)
Reply
WWW
SubmitData
Call PHPinterpreter
Response Response
LAN
Web-Browser
DatabaseServer
36
Web-based applications today
Presentation: HTML, CSS, Javascript, Flash, Java applets, ActiveX controls
Business logic: C#, Java, VB, PHP, Perl, Python,Ruby …
Beans, servlets, CGI, ASP.NET,…
Database: SQL
File system
Application serverWeb serverContent management system
Operating System
Sockets, HTTP, email, SMS, XML, SOAP, REST, Rails, reliable messaging, AJAX, …Replication, distribution,
load-balancing, security, concurrency
37
Incoherent programming models
• Web is very different from back-end systems• Mobile is different from Web• Embedded computing is very different again• Transformations of data representations all the time –
databases, programming language, file formats, communications
• Very dynamic systems– Lifespan not defined– Updates while running
• Uniform solutions are not likely– You can’t reboot the internet– The Microsoft vs Java discussion gets in the way
38
The big issue
• Building the theoretical foundation and supporting infrastructure for both mobile, pervasive, embedded and global computations is a HUGE challenge
• In other words: How to programme the largest computer in the world?
• Ad hoc vs systematic
39
Future Directions
• Now is a good time to re-visit the foundations and create new models
• Now is a good time to experiment with new programming language concepts and constructs
• There is a need for lots of practical experimentation to understand the real needs of applications
40
What determines a “good” language• Formerly: Run-time performance
– (Computers were more expensive than programmers)
• Now: Life cycle (human) cost is more important– Ease of designing, coding– Debugging– Maintenance– Reusability
• FADS
41
Criteria in a good language design
• Readability– understand and comprehend a computation easily and accurately
• Write-ability– express a computation clearly, correctly, concisely, and quickly
• Reliability– assures a program will not behave in unexpected or disastrous ways
• Orthogonality– A relatively small set of primitive constructs can be combined in a
relatively small number of ways– Every possible combination is legal– Lack of orthogonality leads to exceptions to rules
42
Criteria (Continued)
• Uniformity– similar features should look similar and behave similar
• Maintainability– errors can be found and corrected and new features added easily
• Generality– avoid special cases in the availability or use of constructs and by
combining closely related constructs into a single more general one• Extensibility
– provide some general mechanism for the user to add new constructs to a language
• Standardability– allow programs to be transported from one computer to another without
significant change in language structure• Implementability
– ensure a translator or interpreter can be written
43
Tennent’s Language Design principles
44
New Programming Language! Why Should I Care?
• The problem is not designing a new language– It’s easy! Thousands of languages have been developed
• The problem is how to get wide adoption of the new language– It’s hard! Challenges include
• Competition• Usefulness• Interoperability• Fear
“It’s a good idea, but it’s a new idea; therefore, I fear it and must reject it.”--- Homer Simpson
• The financial rewards are low, but …
45
Famous Danish Computer Scientists
• Peter Nauer– BNF and Algol
• Per Brinck Hansen– Monitors and Concurrent Pascal
• Dines Bjorner– VDM and ADA
• Bjarne Straustrup– C++
• Mads Tofte– SML
• Rasmus Lerdorf– PhP
• Anders Hejlsberg– Turbo Pascal and C#
• Jacob Nielsen
46
47
48
So how would you like to programme in 20 years?
49
What is a program?
• a program is a set of instructions for controlling a computer.
50
What is a program?
• a program is a specification of a computation waiting to have a computer system (in its most general meaning of the term) supplied to execute it
Dikestra
51
Some advice from an expert
• Programming languages are for people• Design for yourself and your friends• Give the programmer as much control as
possible• Aim for brevity