hn.today

Micron – a Pascal/Oberon-derived systems language with the power of C

github.com6 points1 comments
Screenshot of Micron – a Pascal/Oberon-derived systems language with the power of C

Micron is a systems programming language derived from Pascal, Oberon, and Wirth’s design principles, intended as a practical alternative to C. It aims to combine Oberon’s modularity and strictness with C’s low-level reach, supporting code from hardware initialization and drivers to kernels and applications. Instead of relying on a preprocessor, it offers generics, inlining, and compile-time procedures. Its defining safety boundary is a set of language levels: modules specify which capabilities they need, from stackless hardware code through pointers, exceptions, dynamic dispatch, and garbage collection. A module may import only modules at its own or a lower level, preventing low-level code from accidentally depending on facilities such as the heap. Micron also supports direct C interoperability and both Oberon-style and more familiar lowercase syntax.

The project provides a compiler, interpreter, and IDE, along with a specification and textbook. Its examples and migrations include a Smalltalk-80 implementation, the P4 Pascal compiler, a Scheme virtual machine, benchmark implementations, and Oberon systems; the collection represents roughly 130,000 lines of working Micron code. A Micron port of Project Oberon can be compiled, linked, and booted on an emulated RISC-V machine, while a Raspberry Pi port remains in progress. The compiler and interpreter are described as current with the specification, but native backends, C transpilation, IDE integration, and system ports are still being developed. Existing backends favor simpler stack-based implementations, with possible bugs acknowledged.

Read on github.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.