OBNC——Oberon-07编译器
OBNC – Oberon-07 Compiler

原始链接: https://miasap.se/obnc/

OBNC 是 Niklaus Wirth 的 Oberon 编程语言(2016 版本)的编译器,它将 Oberon 源代码翻译成 C 代码,然后使用主机系统的 C 编译器进行编译。它具有一个构建命令来管理文件的编译和重新编译。OBNC 采用 GNU GPL(编译器)和 Mozilla 公共许可证(库)发布,允许 Oberon 项目在任何许可证下授权。 OBNC 包含编译器、构建工具、文档生成器、一个基本库和一个“ext”库(命令行参数、错误流打印、字符串转换和陷阱处理程序自定义)。它用 C 语言实现,在 POSIX 系统上编译需要 Boehm-Demers-Weiser 垃圾收集器 (GC)。对于 MS Windows,提供了一个包含依赖项的预编译版本。注意:使用 0.17 之前的版本编译的模块不兼容,必须重新编译。Gedit/Pluma 提供了文本编辑器扩展,提供语法高亮和自动关键字大写。还可以访问关于 Oberon-2 面向对象编程的文档、文章和书籍。

This Hacker News thread discusses OBNC, an Oberon-07 compiler written in C, praised for its compact codebase of under 16,000 lines. A user then promotes Dusk's Oberon compiler, written in under 1500 lines of Forth code, compiling directly to native code. The discussion branches into the specifics of parsing in Forth, with the author of Dusk explaining their recursive approach to parsing and code generation. The thread explores the motivation behind writing an Oberon compiler for Dusk, specifically to port the Oberon system's GUI architecture, despite Dusk's minimalist philosophy. The conversation touches on different versions of Oberon, with some users preferring Oberon-2. Finally, the thread discusses current uses of Oberon, acknowledging its niche status in industrial automation and robotics, while suggesting modern alternatives for systems programming. Overall, the commentary emphasizes Oberon's simplicity and potential for enabling expression in a system.

原文
OBNC

OBNC is a compiler for Niklaus Wirth’s programming language Oberon. It implements the final version of the language from 2016. OBNC translates source code written in Oberon to the lower-level programming language C. The translated code is then compiled and linked using the C compiler and linker of the host operating system. The build command obnc performs all these tasks and keeps track of which files need to be compiled or recompiled.

The compiler is released under the GNU General Public License while the libraries are released under the Mozilla Public License. With the Mozilla license an Oberon project compiled with OBNC can be released under any license.

See the changelog for latest updates, and MD5SUMS to verify the integrity of downloaded files.

Downloads

The source package obnc contains the compiler with a build tool, a documentation generator and a small basic library of seven modules defined in The Oakwood Guidelines for Oberon-2 Compiler Developers. It also contains a (non-standard) library called ext which extends the basic library with modules for accessing command line arguments and environment variables, printing to the standard error stream, converting numbers to strings and vice versa, and for customizing the trap handler. The ext library was previously distributed as a separate package but has now been included in the main package for convenience.

Obnc is implemented in C and should compile on any POSIX compatible operating system. To build obnc you also need the Boehm-Demers-Weiser garbage collector GC. Further instructions are included in the README file in the root directory of the package.

For MS Windows users there is also a pre-compiled version of OBNC with all dependencies included (GC, SDL, Gawk and TCC):

Note: Output files generated by OBNC version 0.15 or earlier are not compatible with OBNC 0.17. If you have used a previous version, your modules need to be recompiled; simply delete the generated .obnc directory in your module directories before using the new version.

Text editor extensions

To make editing of Oberon source files more pleasant I have created a language mode for the text editor Gedit which provides syntax highlighting, and also a plugin which automatically converts reserved and predefined words from lowercase to uppercase as you type them. These extensions are also compatible with the text editor Pluma which is a fork of Gedit that has a more traditional look.

Documentation

Oberon:

OBNC Commands:

OBNC – Frequently Asked Questions (FAQ)

Articles

Books

Object-Oriented Programming in Oberon-2 (PDF, 1.4 MB) by Hanspeter Mössenböck
Oberon-2 has language support for type-bound procedures (methods), otherwise it is very similar to standard Oberon which OBNC targets (the article Data abstraction in Oberon describes how classes are implemented in standard Oberon).

Contact

If you have found an error or have suggestions for improvements you can contact [email protected]. Questions about Oberon can be posted on Stack Overflow or in the Oberon mailing list at ETHZ. There is also the Usenet newsgroup comp.lang.oberon (which requires a Usenet account and a Usenet newsreader, for instance Mozilla Thunderbird).

✅ Javascript free ✅ Cookie free
联系我们 contact @ memedata.com