Micron – the Oberon with the power of C
programming.dev
Micron – the Oberon with the power of C
cross-posted from: https://programming.dev/post/59258877 [https://programming.dev/post/59258877] > I have been developing Micron, a lean, statically typed, modular systems programming language that combines Oberon’s simplicity and explicit module structure with C’s low-level capabilities and interoperability. > > The goal is to use the same language for boot code, device drivers, an operating system kernel, and ordinary applications, without requiring a garbage collector or routing machine access through a separate, unchecked system dialect. Micron supports explicit memory layouts, signed and unsigned integer types, pointer operations, and direct calls to C without wrappers. > > One of its central design choices is language levels. Each module declares the level and thus the feature it needs, ranging from code that requires neither stack nor heap to garbage-collected objects. A module can import only modules at the same or a lower level. For example, a kernel module declared at level 1 cannot accidentally acquire a dependency on heap allocation through an import. > > Other features include generic modules, structural interfaces, and compile-time procedures. Much of what would require a preprocessor in C is expressed through typed language features. > > There is a working compiler, interpreter, and IDE, along with a free textbook. The book explains both how the language works and the reasons behind its design. Its systems-programming section walks through a port of Wirth and Gutknecht’s Project Oberon operating system to Micron, cross-compiled and linked into a single executable that runs on an emulated RISC-V machine. > > The examples also include ports of a Smalltalk-80 VM, Scheme 9, and the original P4 Pascal compiler. The compiler and interpreter implement the language specification; native backends and tooling are still work in progress, and the current native code generation prioritises simplicity over optimisation. > > - Implementation, examples, and Linux binary: https://github.com/rochus-keller/Micron [https://github.com/rochus-keller/Micron] > > - Textbook PDF: http://software.rochus-keller.ch/micron-textbook.pdf [http://software.rochus-keller.ch/micron-textbook.pdf] > > - Language specification: https://github.com/micron-language/specification/blob/master/The_Micron_Programming_Language_Specification.adoc [https://github.com/micron-language/specification/blob/master/The_Micron_Programming_Language_Specification.adoc] > > I’m the designer and implementer, and interested in feedback on the language design, particularly the language-level approach to making runtime dependencies explicit, and on its usefulness as an alternative to C.
0 comments
No comments yet.