OBNC – Oberon-07 Compiler

29 AlexeyBrin 6 5/17/2025, 12:00:53 PM miasap.se ↗

Comments (6)

jll29 · 16m ago

  Oberon-2 -> C compiler
  ======================

  (release 0.17.2)

    220 LEX source files (scanner for lexical analysis) src/*.l
  4,192 YACC source files (parser for syntactic and semantic analysis
        and part of code generation) src/*.y
    809 C header files (misc. definitions and interfaces) src/*.h
  9,197 C implementation code files (main driver,
        command line handling, symbol table, other auxiliary data types
        and runtime system/library implementation) src/*.c
    707 build, install, and test scripts (sh)
  ------
  15,125 < 16K LOC
  ======

  (+6,299 lines of Oberon-2 test code)
Such a very compact code base! Oberon-2 may never have reached the distribution that Pascal had (which was an issue of timing as well due to influential distributions like P-System Pascal and Borland Turbo-Pascal/Delphi), but it's a great exercise in minimalism.
vdupras · 10m ago
Not to brag -- hum, ok, YES, to brag --, but Dusk's Oberon compiler[1][2] is less than 1500 lines of Forth code and it compiles directly to native code (no transpiling to C). Yes, Oberon is simple.

[1]: https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/doc/co...

[2]: https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/comp/o...

pkaye · 9m ago
I imagine its minimal optimizations at that point?
johnisgood · 1h ago
Is Oberon used anywhere, if so, where? Is it picked for new projects?
pjmlp · 1h ago
Yes, Astrobe is still in business for about 20 years.

https://www.astrobe.com/default.htm

ETHZ still uses Active Oberon somehow,

https://gitlab.inf.ethz.ch/felixf/oberon

This is the owner of that repo,

https://inf.ethz.ch/de/personen/person-detail.MTMyNjc0.TGlzd...

However I do agree it is very niche, one is better of with Go, D, C#, Swift, as modern compiled managed languages with low level language features for systems programming.

bri3d · 1h ago
It’s used at ETHZ still if you count institutional use.

Commercially it had some popularity in industrial automation and robotics many years ago and some companies still maintain Oberon codebases for this reason. I believe this is the main target market for the commercial Astrobe Oberon compiler for Cortex-M, which sells enough to stick around.

I can’t think of a good reason to start a new commercial product in it and I’m not aware of any new commercial uses, but there are still lots of academic and hobby projects cropping up.