Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Simula

From Wikipedia, the free encyclopedia
Early object-oriented programming language
This article is about the programming language. For the village in Estonia, seeSimula, Estonia.
Not to be confused withSimulia.
Simula
ParadigmsMulti-paradigm:procedural,imperative,structured,object-oriented
FamilyALGOL
Designed byOle-Johan Dahl
DeveloperKristen Nygaard
First appeared1962; 64 years ago (1962)
Stable release
Simula 67, Simula I
Typing disciplineStatic,nominative
ScopeLexical
Implementation languageALGOL 60 (mostly)
SIMSCRIPT (some parts)
OSUnix-like,Windows,z/OS,TOPS-10,MVS
Websitewww.simula67.info
Influenced by
ALGOL 60,SIMSCRIPT
Influenced
BETA,CLU,Eiffel,Emerald,Pascal,Smalltalk,C++, and many otherobject-oriented programming languages

Simula is the name of twosimulation programming languages, Simula I and Simula 67, developed in the 1960s at theNorwegian Computing Center inOslo, byOle-Johan Dahl andKristen Nygaard.Syntactically, it is an approximatesuperset ofALGOL 60,[1]: 1.3.1 and was also influenced by the design ofSIMSCRIPT.[2][3]

Simula 67 introducedobjects,[1]: 2, 5.3 classes,[1]: 1.3.3, 2 inheritance andsubclasses,[1]: 2.2.1 virtual procedures,[1]: 2.2.3 coroutines,[1]: 9.2  anddiscrete event simulation,[1]: 14.2  and featuredgarbage collection.[1]: 9.1  Other forms ofsubtyping (besides inheriting subclasses) were introduced in Simula derivatives.[citation needed]

Simula is considered thefirst object-oriented programming language. As its name suggests, the first Simula version by 1962 was designed for doingsimulations; Simula 67 though was designed to be a general-purposeprogramming language[4] and provided the framework for many of the features of object-oriented languages today.

Simula has been used in a wide range of applications such as simulatingvery-large-scale integration (VLSI) designs,process modeling,communication protocols,algorithms, and other applications such astypesetting,computer graphics, andeducation.

Computer scientists such asBjarne Stroustrup, creator of C++, andJames Gosling, creator of Java, have acknowledged Simula as a major influence.[5] Simula-type objects are reimplemented inC++,Object Pascal,Java,C#, and many other languages.

History

[edit]

The following account is based on Jan Rune Holmevik's historical essay.[6][7][8][9]

Kristen Nygaard started writing computer simulation programs in 1957. Nygaard saw a need for a better way to describe the heterogeneity and theoperation of a system. To further develop his ideas for acomputer language to describe a system, Nygaard realized that he needed someone with morecomputer programming skills than he had.Ole-Johan Dahl joined him on his work in January 1962. Shortly after, the decision was made to link the language toALGOL 60. By May 1962, the main concepts for asimulation language were established;SIMULA I, a specialized programming language designed for simulating discrete event systems, was born.

Kristen Nygaard was invited to visit theEckert–Mauchly Computer Corporation in late May 1962 in connection with the marketing of their newUNIVAC 1107 computer. At that visit, Nygaard presented the ideas of Simula toRobert Bemer, the director of systems programming atUnivac. Bemer was a greatALGOL fan and found the Simula project compelling. Bemer was alsochairperson of a session at the second international conference on information processing hosted byInternational Federation for Information Processing (IFIP). He invited Nygaard, who presented the paper "SIMULA – An Extension of ALGOL to the Description of Discrete-Event Networks".

TheNorwegian Computing Center got aUNIVAC 1107 in August 1963 at a considerable discount, on which Dahl implemented the SIMULA I under contract with UNIVAC. The implementation was based on the UNIVACALGOL 60 compiler. SIMULA I was fully operational on the UNIVAC 1107 by January 1965. In the following few years, Dahl and Nygaard spent a lot of time teaching Simula. Simula spread to several countries around the world and SIMULA I was later implemented on other computers including theBurroughs B5500 and the RussianUral-16.

In 1966C. A. R. Hoare introduced the concept of record class construct, which Dahl and Nygaard extended with the concept of prefixing and other features to meet their requirements for a generalized process concept. Dahl and Nygaard presented their paper onclass andsubclass declarations at the IFIP Working Conference onsimulation languages inOslo, May 1967. This paper became the first formal definition of Simula 67. In June 1967, a conference was held to standardize the language and initiate a number of implementations. Dahl proposed to unify thetype and the class concept. This led to serious discussions, and the proposal was rejected by the board. Simula 67 was formally standardized on the first meeting of the Simula Standards Group (SSG) in February 1968.

Pages from the DECsystem-10 SIMULA Language Handbook, as published by the Swedish National Defence Research Institute

Simula was influential in the development ofSmalltalk and laterobject-oriented programming languages. It also helped inspire theactor model of concurrent computation although Simula only supportscoroutines and not trueconcurrency.[10]

In the late sixties and the early seventies, there were four main implementations of Simula:

These implementations were ported to a wide range of platforms. TheTOPS-10 implemented the concept of public, protected, and private member variables and procedures, that later was integrated into Simula Standard in 1986.

Simula Standard 1986 is the latest standard and is ported to a wide range of platforms. There are mainly four implementations:

  • Simula AS
  • Lund Simula
  • GNU Cim[11]
  • Portable Simula Revisited[12]

In November 2001, Dahl and Nygaard were awarded theIEEE John von Neumann Medal by theInstitute of Electrical and Electronics Engineers "For the introduction of the concepts underlying object-oriented programming through the design and implementation of SIMULA 67". In April 2002, they received the 2001 A. M.Turing Award by theAssociation for Computing Machinery (ACM), with the citation: "For ideas fundamental to the emergence of object oriented programming, through their design of the programming languages Simula I and Simula 67." Dahl and Nygaard died in June and August of that year, respectively,[13] before the ACM Turing Award Lecture[14] that was scheduled to be delivered at the November 2002OOPSLA conference in Seattle.

Simula Research Laboratory is aresearch institute named after the Simula language, and Nygaard held a part-time position there from the opening in 2001. The new Computer Science building at theUniversity of Oslo is named Ole Johan Dahl's House, in Dahl's honour, and the main auditorium is named Simula.

Sample code

[edit]

Minimal program

[edit]

The emptycomputer file is the minimalprogram in Simula, measured by the size of thesource code. It consists of one thing only; a dummystatement.

However, the minimal program is more conveniently represented as an empty block:

BeginEnd;

It begins executing and immediately terminates. The language lacks anyreturn value from the program.

Classic Hello world

[edit]

An example of aHello world program in Simula:

BeginOutText ("Hello, World!");Outimage;End;

Simula iscase-insensitive.

Classes, subclasses and virtual procedures

[edit]

A more realistic example with use of classes,[1]: 1.3.3, 2  subclasses[1]: 2.2.1  and virtual procedures:[1]: 2.2.3 

BeginClass Glyph;Virtual:Procedure printIsProcedure print;;BeginEnd;      GlyphClass Char (c);Character c;BeginProcedure print;        OutChar(c);End;      GlyphClass Line (elements);Ref (Glyph)Array elements;BeginProcedure print;BeginInteger i;For i:= 1Step 1Until UpperBound (elements, 1)Do            elements (i).print;         OutImage;End;End;Ref (Glyph) rg;Ref (Glyph)Array rgs (1 : 4);! Main program;   rgs (1):-New Char ('A');   rgs (2):-New Char ('b');   rgs (3):-New Char ('b');   rgs (4):-New Char ('a');   rg:-New Line (rgs);   rg.print;End;

The above example has onesuper class (Glyph) with twosubclasses (Char andLine). There is onevirtual procedure with twoimplementations. The execution starts by executing the main program. Simula lacks the concept ofabstract classes, since classes with purevirtual procedures can beinstantiated. This means that in the above example, all classes can be instantiated. Calling a pure virtual procedure will however produce arun-timeerror.

Call by name

[edit]

Simula supportscall by name[1]: 8.2.3  so theJensen's Device can easily be implemented. However, the default transmission mode for simple parameter iscall by value, contrary toALGOL which used call by name. The source code for the Jensen's Device must therefore specify call by name for the parameters when compiled by a Simula compiler.

Another much simpler example is thesummation function{\displaystyle \sum } which can be implemented as follows:

RealProcedure Sigma (k, m, n, u);Name k, u;Integer k, m, n;Real u;BeginReal s;   k:= m;While k <= nDoBegin s:= s + u; k:= k + 1;End;   Sigma:= s;End;

The above code uses call by name for the controlling variable (k) and the expression (u).This allows the controlling variable to be used in the expression.

Note that the Simula standard allows for certain restrictions on the controlling variablein afor loop. The above code therefore uses a while loop for maximum portability.

The following:

Z=i=11001(i+a)2{\displaystyle Z=\sum _{i=1}^{100}{1 \over (i+a)^{2}}}

can then be implemented as follows:

Z:= Sigma (i, 1, 100, 1 / (i + a) ** 2);

Simulation

[edit]

Simula includes asimulation[1]: 14.2  package for doingdiscrete event simulations. This simulation package is based on Simula's object-oriented features and itscoroutine[1]: 9.2  concept. Simula provided functions to dorandom number generation ofpseudo-random numbers.[1]: 12.1 

Sam, Sally, and Andy are shopping for clothes. They must share one fitting room. Each one of them is browsing the store for about 12 minutes and then uses the fitting room exclusively for about three minutes, each following a normal distribution. A simulation of their fitting room experience is as follows:

SimulationBeginClass FittingRoom;BeginRef (Head) door;Boolean inUse;Procedure request;BeginIf inUseThenBegin             Wait (door);             door.First.Out;End;         inUse:=True;End;Procedure leave;Begin         inUse:=False;Activate door.First;End;      door:-New Head;End;Procedure report (message);Text message;Begin      OutFix (Time, 2, 0); OutText (": " & message); OutImage;End;      ProcessClass Person (pname);Text pname;BeginWhileTrueDoBegin         Hold (Normal (12, 4, u));         report  (pname & " is requesting the fitting room");         fittingroom1.request;         report (pname & " has entered the fitting room");         Hold (Normal (3, 1, u));         fittingroom1.leave;         report (pname & " has left the fitting room");End;End;Integer u;Ref (FittingRoom) fittingRoom1;      fittingRoom1:-New FittingRoom;ActivateNew Person ("Sam");ActivateNew Person ("Sally");ActivateNew Person ("Andy");   Hold (100);End;

The main block is prefixed withSimulation for enabling simulation. The simulation package can be used on any block and simulations can even be nested when simulating someone doing simulations.

The fitting room object uses a queue (door) for getting access to the fitting room. When someone requests the fitting room and it's in use they must wait in this queue (Wait (door)). When someone leaves the fitting room the first one (if any) is released from the queue (Activate door.first) and accordingly removed from the door queue (door.First.Out).

Person is a subclass ofProcess and its activity is described using hold (time for browsing the store and time spent in the fitting room) and calls procedures in the fitting room object for requesting and leaving the fitting room.

The main program creates all the objects and activates all the person objects to put them into the event queue. The main program holds for 100 minutes of simulated time before the program terminates.

Notes

[edit]
  1. ^abcdefghijklmnoDahl, Ole-Johan; Myhrhaug, Bjørn;Nygaard, Kristen (1970).Common Base Language(PDF) (Report). Norwegian Computing Center. Archived from the original on 2024-09-19. Retrieved20 August 2025.
  2. ^Nygaard, Kristen (1978)."The Development of the Simula Languages"(PDF).The development of .. SIMULA I and SIMULA 67... were influenced by the design of SIMSCRIPT ...
  3. ^Dahl, Ole-Johan; Myhrhaug, Bjørn;Nygaard, Kristen (1970).Simula: A language for programming and description of discrete event systems introduction and user's manual(PDF) (Report). Norwegian Computing Center. Archived from the original on 2025-08-23. Retrieved29 October 2025.
  4. ^Kristen Nygaard and Ole-Johan Dahl. 1978. The development of the SIMULA languages. History of programming languages. Association for Computing Machinery, New York, NY, USA, 439–480. DOI:https://doi.org/10.1145/800025.1198392
  5. ^Wong, William."Before C, What Did You Use?".Electronic Design. Retrieved22 May 2017.
  6. ^Holmevik, Jan Rune (1994)."Compiling Simula: A historical study of technological genesis"(PDF).IEEE Annals of the History of Computing.16 (4):25–37.doi:10.1109/85.329756.S2CID 18148999. Retrieved12 May 2010.
  7. ^Holmevik, Jan Rune."Compiling Simula". Oslo, Norway: Institute for Studies in Research and Higher Education. Archived fromthe original on 20 April 2009. Retrieved19 April 2017.
  8. ^Holmevik, Jan Rune."The History of Simula". Oslo, Norway: Institute for Studies in Research and Higher Education. Archived fromthe original on 27 October 2025. Retrieved27 October 2025.
  9. ^Holmevik, Jan Rune."The Simula programming language". Oslo, Norway: University of Oslo. Archived fromthe original on 27 October 2025. Retrieved27 October 2025.
  10. ^Lehrmann Madsen, Ole (2014). "Building Safe Concurrency Abstractions". In Agha, Gul; Igarashi, Atsushi; Kobayashi, Naoki; Masuhara, Hidehiko; Matsuoka, Satoshi; Shibayama, Etsuya; Taura, Kenjiro (eds.).Concurrent Objects and Beyond. Lecture Notes in Computer Science. Vol. 8665. Berlin: Springer. p. 68.doi:10.1007/978-3-662-44471-9.ISBN 978-3-662-44471-9.S2CID 1000741.
  11. ^"GNU Cim".
  12. ^"Portable Simula Revisited".GitHub. Retrieved17 June 2019.
  13. ^"ACM Ole-Johan Dahl and Kristen Nygaard - Obituary". Acm.org. Archived fromthe original on 19 July 2011. Retrieved14 January 2012.
  14. ^"ACM Turing Award Lectures". Informatik.uni-trier.de. Retrieved14 January 2012.

Sources

[edit]

Further reading

[edit]

External links

[edit]
Implementations
Technical
standards
Dialects
Formalisms
Community
Organizations
Professional
associations
Business
Education
Government
People
ALGOL 58
MAD
ALGOL 60
Simula
ALGOL 68
Comparison
^ = full name and link in older ALGOL version above
Categories:ALGOLALGOL 60
International
National
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=Simula&oldid=1328974922"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp