upvote
> My compiler targets the 65C816 processor

Of all things...

I also have a (unpublished) '816 focused language and compiler (me and the AI).

I'm keeping it pretty conservative, as the goal is to rewrite the compiler in itself, and have it self-host. But a fellow posted this [1] about "Micron", an Oberon inspired system language.

And I'm giving a keen eye to how it handles Interfaces. I'm not sure if it will really fit, but it's an interesting idea that should be reasonably cheap on the compiler, and have no impact on the runtime.

I must say having an introspective CPU simulator as part of your unit tests can really help with writing a compiler. Not only can you test that the code is generating what it's supposed to, you can test that the code actually does what it’s supposed to.

[1] https://news.ycombinator.com/item?id=50413266

reply
I also had the goal of self hosting, and that is working, although I have made it a little easier on myself by extending the 65C816 in some small ways. The most significant for the compiler is a small extension to the registers so that the direct page and stack can be located anywhere in memory. This is primarily to allow larger operating system and app images, the compiler is quite large now so it needs this. I have a limit of 64k for each module.

One breakthrough in the compiler was when I could start to use AI to interpret instruction traces, before that I was doing it by hand and it took a very long time. Now the AI pinpoints my errors very quickly, although I'm past that stage now and don't often come across compiler errors. I do this with an emulator, also written in Oberon.

reply
Which version though?

While my interest got spiked initially by the original Project Oberon, I was more found of the paths taken by Component Pascal and Active Oberon, as language evolution.

Anyway, it was what initially opened my eyes to systems programming with GC enabled languages, and drew me into the rabbit hole of Cedar, Modula-2+, Modula-3 and co.

reply
Was Active Oberon the foundation of A2/Bluebottle? My memory fails me.

I haven't dug into Oberon, because it's not quite Pascal enough for me to love it, and felt a bit heavier than I had hoped for syntax wise.

I'm enjoying Odin lately, and if I felt i had more time/use for Oberon I'd probably try driving it. But feel that as a "living" project Odin is more usable, it feels more constrained in syntax and concision than the larger Oberon project.

This is similar to like Genera/Lisp Machines, where I'd love to explore more (and even plan9, though that's less related to OS/Language integration in the way Bluebottle/A2 and Genera/Lisp Machines.

reply
[dead]
reply
Oberon is definitely an interesting language, and there's a few self-hosting compilers coded in Oberon itself in under 6 thousand lines of Oberon.
reply
If a language features adds more in complexity than benefits, it doesn't feel very Wirth-ian (Oberon or Pascal.)

What features do you have in mind?

reply
Floating point for GUIs is a rare and important exception. Compilers rarely need floating point.
reply
> indeed he went a little too far in some early versions of Oberon and restored a feature or two in successive versions

Actually the most minimalistic version is the one he made for his retirement project, Oberon-07. Oberon-2 (by Mössenböck et al.) had most features. My Oberon+ is a superset of all (original) Oberon versions.

reply