Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Oberon

< >

Oberon is a programming language created in 1986 by Niklaus Wirth.

#315on PLDB 38Years Old
Homepage · REPL · Wikipedia · Subreddit · FAQ · Docs

Oberon is a general-purpose programming language created in 1986 by Niklaus Wirth and the latest member of the Wirthian family of ALGOL-like languages (Euler, Algol-W, Pascal, Modula, and Modula-2). Oberon was the result of a concentrated effort to increase the power of Modula-2, the direct successor of Pascal, and simultaneously to reduce its complexity. Its principal new feature is the concept of type extension of record types: It permits the construction of new data types on the basis of existing ones and to relate them, deviating from the dogma of strictly static data typing. Read more on Wikipedia...


Example from Riju:
MODULE Main; IMPORT Out; BEGIN Out.String("Hello, world!"); Out.Ln; END Main.
Example from hello-world:
MODULE HelloWorld; IMPORT Out; BEGIN Out.Open; Out.String('Hello World'); END HelloWorld.
Example from Wikipedia:
MODULE Rectangles; IMPORT Figures; TYPE Rectangle* = POINTER TO RectangleDesc; RectangleDesc* = RECORD (Figures.FigureDesc) x, y, w, h : INTEGER; END; PROCEDURE Draw* (r : Rectangle); BEGIN (* ... *) END Draw; (* Other procedures here *) PROCEDURE Handle* (f: Figure; VAR msg: Figures.Message); VAR r : Rectangle; BEGIN r := f(Rectangle); IF msg IS Figures.DrawMsg THEN Draw(r) ELSIF msg IS Figures.MarkMsg THEN Mark(r) ELSIF msg IS Figures.MoveMsg THEN Move(r, msg(Figures.MoveMsg).dx, msg(Figures.MoveMsg).dy) ELSE (* ignore *) END END Handle; PROCEDURE New* (VAR r : Rectangle); BEGIN NEW(r); Figures.Init(r, Handle); END New; END Rectangles.

Language features

Feature Supported Example Token
Strings 'Hello world' '
Assignment :=
Comments (* A comment *)
MultiLine Comments (* A comment *) (* *)
Pointers
Print() Debugging Out.String
Semantic Indentation X

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements

Built with Scroll v154.3.0