
OBNC Oberon Compiler - tosh
http://miasap.se/obnc/
======
ainar-g
I've always been fascinated by Wirthian languages. The radical simplicity, the
focus on fast compilation and programmer productivity.

One question I haven't researched enough is, how did the people at ETH Zürich
used Oberon for OS programming. AFAIK, all Wirthian languages have garbage
collection, and the common narrative is that you cannot use a GC'ed language
in an OS kernel. How did Wirth et al. work around this in the Oberon OS
family?

~~~
pankajdoharey
Actually before Apple implemented ARC in its OS Around Mac OS X Lion and iOS
5, the Objective-C runtime in Mac OS X was a garbage collection runtime.

~~~
cturner
Wikipedia describes GC as being automatic memory management. I don't think it
is valid to describe the traditional (pre-2007) osx/objective-c model of
manual reference counting as a form of garbage collection.

Darwin itself is mostly unix+C. Hence, this does not respond to the parent,
asking about GC in the OS itself.

~~~
Volt
>Darwin itself is mostly unix+C. Hence, this does not respond to the parent,
asking about GC in the OS itself.

You're right, but just to clarify WRT your first paragraph, Obj-C _did_
briefly have a GC'd runtime between the eras of manual and automatic ref
counting.

~~~
cturner
As you and neighbour inferred, I had not know of this. Thanks.

------
miasap
Author of OBNC here. For Windows users there will soon be a pre-compiled
version of OBNC out which includes all dependencies (gc, SDL, awk and the tcc
C compiler). With OBNC it is easy to create Oberon interfaces to C code, so
with not much effort you can use your favorite C libraries in your Oberon
projects.

~~~
pjmlp
Given the language similarities, have you ever thought of re-targeting your
compiler to generate Go code instead, thus taking advantage of the GC as well?

I see a problem with mapping SYSTEM to unsafe, though, as unsafe is not as
feature rich.

------
kwhitefoot
> all Wirthian languages have garbage collection,

Not Pascal at least and I don't think Modula has it either.

~~~
ch_123
Modula-3 had it, but it was possible to do manual allocation as well.

ALGOL-W, Pascal, Modula 2 (and probably the original Modula) did not have GC
as part of the base language or library.

~~~
ofrzeta
I don't think Modula 3 can be considered a language devised by Niklaus Wirth.

~~~
ch_123
Good point. It did receive his endorsement, however.

------
lboasso
Several other Oberon implementations exist for different platforms, including
embedded systems, native windows executables, and the Java virtual machine:
[http://oberon07.com/compilers.xhtml](http://oberon07.com/compilers.xhtml)

------
pankajdoharey
OBNC is classic example of an incremental compiler, though i never liked the
language, the compiler is worth looking at since it compiles Oberon to C.

~~~
miasap
The generated C code is also highly readable so there is a transparency in how
each Oberon construct is implemented.

------
nabla9
Oberon, Juice and Slim Binaries where really beautiful things.

But Worse is Better -
[https://www.dreamsongs.com/WorseIsBetter.html](https://www.dreamsongs.com/WorseIsBetter.html)

~~~
eterps
I am also fascinated by these subjects, I am currently studying and reverse
engineering the whole Juice / Slim Binaries thing. (Just to learn more about
them in detail). Impressive stuff indeed, but not easy to comprehend.

~~~
nabla9
It would be really nice if you could write out some kind of summary that could
work as a starting point and historical record.

I studied those things when they came out, but I have forgotten most of it.

~~~
eterps
Yes, I already considered doing that. I am now analyzing hexdumps of actual
slim binaries of some straightforward Oberon samples and try to match the
details of those with the compiler/loader/linker code and the papers written
by Michael Franz and Thomas Kistler. Being able to compile actual slim
binaries was already a big challenge (the implementation was only available on
old Macs and Win32 platform).

~~~
vidarh
I'd love to see a writeup of that too. I read the original papers when they
came out, and have wanted to do an implementation ever since.

