15
Yngve Sundblad KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010 Simula Mother Tongue for a Generation of Nordic Programmers Yngve Sundblad HCI, CSC, KTH

Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula !Mother Tongue !

for a Generation of !Nordic Programmers!

Yngve Sundblad HCI, CSC, KTH!

Page 2: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Inspired by Ole-Johan Dahl, 1931-2002, and Kristen Nygaard, 1926-2002

“From the cold waters of Norway comes Object-Oriented Programming” (first line in Bertrand Meyerʼs widely used text book Object Oriented Software Construction) !

Page 3: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula concepts 1967 •  Class of similar Objects (in Simula declaration of CLASS

with data and actions)!•  Objects created as Instances of a Class (in Simula NEW

object of class)!•  Data attributes of a class (in Simula type declared as

parameters or internal)!•  Method attributes are patterns of action (PROCEDURE)!•  Message passing, calls of methods (in Simula dot-notation)!•  Subclasses that inherit from superclasses!•  Polymorphism with several subclasses to a superclass!•  Co-routines (in Simula Detach – Resume)!•  Encapsulation of data supporting abstractions!

Page 4: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula example

BEGIN! REF(taxi) t; CLASS taxi(n); INTEGER n;! BEGIN ! INTEGER pax; PROCEDURE book; IF pax<n THEN pax:=pax+1;! pax:=n; END of taxi;! t:-NEW taxi(5); t.book; t.book; print(t.pax) END!

Output: 7 !

Page 5: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Teaching basic computer science from 1970

Simula excellent tool, example:!Binary tree node with post order scan method!CLASS node(left, right); REF(node) left, right;!BEGIN ! PROCEDURE scan(x); REF(node) x;! INSPECT x DO BEGIN! scan(left);! scan(right);! visit(THIS node);! END of scan;!END of node;!Built in Simula framework (class) for set handling, Simset!

Data structures on firm theoretical footing by Ole-Johan Dahl, Tony Hoare,

Niklaus Wirth (Algorithms+Datastructues=Programs)!

Page 6: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Teaching basic computer science from 1970

In Simula Ole-Johan Dahl and Kristen Nygaard invented structuring into objects as instances of classes and subclasses, complementing the then current procedural structures.!This encourages encapsulation and inheritance for modularisation and reuse and tree structuring of program elements, supporting overview and maintainability of programs.!Structured Programming with Style was put on firm theoretical and practical foundation in the early 1970s by Ole-Johan Dahl, Edsger Dijkstra & Niklaus Wirth (Structured Programming book), Brian Kernighan & P.J. Plauger (The Elements of Programming Style book), Donald Knuth and Kristen Nygaard !

Program structuring

Page 7: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Teaching basic computer science from 1970

The advanced Simula constructions (procedures)!Detach!Resume(x)!Call(x)!allows an object under execution to stop and hand over control to another detached object, which then continues its execution, or the main program.!This quasi-parallellism is the basis for the discrete event simulation facilities in the framework (class) Simulation.!This can be used for emulation of real parallellism and was taught to the most advanced students.!

Program structures: Coroutines & Simulation

Page 8: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Teaching basic computer science from 1970

Object-oriented structures, class and subclass hierarchy and objects with methods, are very natural when describing graphical entities on the screen with interaction.!

In our first graphics courses basic structuring and algorithmic concepts such as display lists, hidden surface algorithms, finding object clicked on etc., were described and implemented in Simula.!

In the 1980s Smalltalk, much more elaborated, and a graphic environment in itself, took over this role.!

Computer Graphics and Interaction

Page 9: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula programming tools from the 1970s

Around Simula were developed (in Simula) tools to facilitate structuring, debugging, analysing and safeguarding programs:!SIMED – structuring source code with indentation, capitalising Simula keyword etc.!SIMDDT – debugging with setting halt point, inspecting variables at those points, etc. !FQC – getting statistics on number of executions of each statement!SAFEIO – Input routines that check validity of type of input, within prescribed interval, etc. !

Page 10: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula dialog programming environment

A deciding factor for the success of Simula in education and research was the implementation for the DEC-systems, our first advanced dialog time-sharing environment, from early 1970s (Arnborg, Jones, Noble, Weston & al, FOA)!

At KTH it was extensively used 1976-1988, on three dedicated DEC20-computers, Nadja, Vera & Venus.!Here (June 2010) is Nadja, which started directly after22 years of stand-still.!

DEC-10 and DEC-20

Page 11: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula heritage inProgramming languages:!

•  1970s: Smalltalk (Alan Kay, Adele Goldberg), Modula-2 (Niklaus Wirth), LOOPS (Dan Bobrow)!

•  1980s: Eiffel (Bertrand Meyer), C++ (Bjarne Stroustrup), Objective C (Brad Cox), Object Pascal (Niklaus Wirth, Anders Hejlsberg)!

•  1990s: Python (Guido van Rossum), Java (Jim Gosling), Objective Ada (Jean Ichbiah), C# (Anders Hejlsberg)!

All are based on concepts in Simula, the “Latin” of object oriented programming languages, that “modern” languages build on!

Page 12: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula heritage in programming environments!

“Then there was Simula. It was a great concept and I was lucky enough to see it as almost a new thing.”!

“If you combine Simula and Lisp—Lisp didnʼt have data structures, it had instances of objects—you would have a dynamic type system that would give you the range of expression you need.”!

“It is not too much of an exaggeration to say that most of my ideas from then on took their roots from Simula--but not as an attempt to improve it. It was the promise of an entirely new way to structure computations that took my fancy. As it turned out, it would take quite a few years to understand how to use the insights and to devise efficient mechanisms to execute them.”!

Citations from Alan Kay and Adele Goldberg on the ideas behind Smalltalk!

Smalltalk-80, the generic!program development browser

Page 13: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Post-Simula in our education:!Until 1986 all first programming courses at KTH used Simula, majors the full object-oriented concepts, minors the Algol part.!From 1984 Smalltalk was introduced in second course on graphics and interaction, on Sun, Tektronix, Macintosh.!First course for majors from 1986 is Abelson-Sussman: Structure and Interpretation of Computer Programs, based on “pure” Lisp dialect Scheme. !Minors start with Java, then elective Python.!The NADA Stockholm University major Computer Science education used Simula on Macintoshes until 1997, then Abelson-Sussman.!Computer Science in Lund also used Simula in education until 1997 and keeps up the heritage by providing compilers.!

Page 14: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Thanks!

NADA (CSC), KTH:!Stefan Arnborg!Serafim Dahl!Örjan Leringe!Kjell Lindqvist!Staffan Romberger!

FOA (FOI):!Kalle Mäkilä!Mats Ohlin !Jacob Palme!

Lund University:!Sten Henriksson!Boris Magnusson!

Page 15: Simula Mother Tongue for a Generation of Nordic …...Mother Tongue ! for a Generation of ! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! KTH - CSC (School of Computer Science

Yngve Sundblad!KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula October 2010!

Simula in education:!

Questions?!

Similar or different experiences?!