Vishap Oberon Compiler http://oberon.vishap.am
Find a file
2016-12-02 13:02:35 +00:00
bootstrap Update bootstrap C sources. 2016-12-02 12:27:03 +00:00
doc PlatformWindows file sharing mode parity with PlatfromUnix. Allow GC to collect unused files. 2016-11-30 15:49:27 +00:00
src Fix incorrect dynarray length type merge with subsequent longint in IdentList. 2016-12-02 13:02:35 +00:00
triage Some more significant ReadMe work. 2016-06-27 15:53:36 +01:00
.gitattributes File mode corrections. Add lol filetype to 'lf' eolns. 2016-06-16 18:14:58 +01:00
.gitconfig File mode corrections. Add lol filetype to 'lf' eolns. 2016-06-16 18:14:58 +01:00
.gitignore Restore text file based error support as prototyped in the ErrorExperiment branch. 2016-11-14 21:00:34 +00:00
LICENSE Initial commit 2013-09-27 08:55:16 -07:00
make.cmd Add version to symbol files to avoid confusing symptoms from format changes. 2016-11-10 18:54:40 +00:00
makefile Doc updates. Add warning for anonymous ARAY or RECORD parameter types. 2016-11-24 12:49:59 +00:00
ReadMe.md Doc updates. Add warning for anonymous ARAY or RECORD parameter types. 2016-11-24 12:49:59 +00:00

Build status

Ѵishap Oberon

Ѵishap Oberon is a free and open source (GPLv3) implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows.

Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang or msc) to compile Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers.

Contents

    Installation
    A 'Hello' application
    Licensing
    Platform support and porting
    Language support and libraries
    History
    Roadmap
    Contributors
    Origin of the name "Ѵishap Oberon"
    References

Installation

While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries with the following simple steps.

1. Install prerequisites

Platform Packages
Debian/Ubuntu/Mint ... apt-get install git
Fedora/RHEL/CentOS ... yum install git gcc glibc-static (dnf instead of yum on recent Fedoras)
FreeBSD/OpenBSD/NetBSD pkg install git
OpenSUSE zypper install gcc git-core make glibc-devel-static
Cygwin use setup-x86[_x64] to add packages git, make, diffutils and gcc-core
Darwin type 'git' at the command line and accept the prompt to install it.

More details, including for MingW and MS C, in Installation.

2. Build and install the compiler and libraries

  1. git clone https://github.com/vishaps/voc
  2. cd voc
  3. [sudo] make full

Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges.

3. Set your PATH environment variable

Set your path to the installed compiler binary location as reported by make full, e.g.

System Set path
Linux export PATH="/opt/voc/bin:$PATH"
BSD export PATH="/usr/local/share/voc/bin:$PATH"
Windows See Installation
Termux export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"

Also see Installation.

A 'Hello' application

Anything appended to Oberon.Log is automatically written to stdout, so the following conventional Oberon program will display 'Hello.':

MODULE hello;
  IMPORT Oberon, Texts;
  VAR W: Texts.Writer;
BEGIN
  Texts.OpenWriter(W);
  Texts.WriteString(W, "Hello."); Texts.WriteLn(W);
  Texts.Append(Oberon.Log, W.buf)
END hello.

Alternatively the Oakwood module Out can be used to write directly to stdout:

MODULE hello;
  IMPORT Out;
BEGIN
  Out.String("Hello."); Out.Ln;
END hello.

Compile as follows:

voc hello.mod -m

The -m parameter tells voc that this is a main module, and to generate an executable binary.

Execute as usual on Linux ('./hello') or Windows ('hello').

Also see Compiling.

Licensing

Vishap Oberon's frontend and C backend engine is a fork of Josef Templs Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 GUI environment.

The Ulm Oberon Library and the Ooc libraries are distributed under GPL. Proprietry code using these libraries may not be statically linked.

Voc tools are distributed under GPLv3.

Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception.

Platform support and porting

Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc.

It compiles under gcc, clang and Microsoft Visual C.

Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin).

A C program (src/tools/make/configure.c) detects the details of the C compiler and operating system on which it is running.

The following systems are recognised:

  • Linux, including Ubuntu and Centos derivatives.
  • The BSDs, including OpenBSD and FreeBSD.
  • Cygwin under Windows, MingW under Cygwin, Bash on Ubuntu on Windows.

Additionally a Windows .cmd is provided for building with Microsoft C.

For details, including how to add support for unrecognised systems, see Porting.

Language support and libraries

Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. SYSTEM.Mod includes additional functionality and some changes for 64 bit support.

Integer and set type sizes:

Type -O2 option (default) -OC option
SHORTINT 8 bit 16 bit
INTEGER 16 bit 32 bit
LONGINT 32 bit 64 bit
SET 32 bit 64 bit

Libraries

Included libraries ease porting of code from the major Oberon systems:

  • Oberon V4 and S3 compatible library set.
  • Ooc (optimizing oberon-2 compiler) library port.
  • Ulms Oberon system library port.
  • Oakwood standard libraries.
  • Some other freely redistributable libraries.

Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations.

Vishap Oberon also supports some features of Oberon-07.

See also Features.

Contributors

Joseph Templ developed ofront as a tool to translate Oberon-2 programs into semantically equivalent C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012.

From Joseph's github repository:

Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems.

Norayr Chilingarian forked ofront in 2013, porting extensive libraries from ULM Oberon, OO2C and ETH Oberon System 3, and adding support for more platforms including 64 bit systems.

David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems.

Origin of the name "Ѵishap Oberon"

Oberon

Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the fundamentals of a modern OS and GUI can be implemented in clean and simple code orders of magnitude smaller than found in contemporary systems.

The Oberon programming language is an evolution of the Pascal and Modula languages. While it adds garbage collection, extensible types and (in Oberon-2) type-bound procedures, it is also simplified following the principals of Einstein and Antoine de Saint-Exupéry:

Make it as simple as possible, but not simpler. (Albert Einstein)

Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away. (Antoine de Saint-Exupéry, translated by Lewis Galantière.)

Ѵishap

Vishaps are dragons inhabiting the Armenian Highlands. We decided to name the project “Vishap” because ties between compilers and dragons have ancient traditions.

Also, Vishaps are known in tales, fiction. This page refers to some technologies as “computer science fiction”. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps.

References

Oberon
Oberon 2
Oberon 07