31 comments

[ 5.2 ms ] story [ 87.8 ms ] thread
I think Oberon would be a better candidate for this than C. You could get a tiny and extremely fast compiler for a full-featured programming language.
I'm looking into self-hosting compilers, is there a good link for Oberons code that achieves this? Or you just are mentioning that Oberon would probably be able to if one were implemented?
Oberon is implemented in itself: http://www.projectoberon.com

The implementation includes the hardware too.

Taken together, the system including single-tasking OS, windowing system and Oberon takes about 9000 lines of code.

at the bottom of the linked page the author explicitly references oberon as a source of inspiration for this project
(comment deleted)
Wish there was something like this for WebAssembly
In particular, the code for this compiler doesn't use structs. It only works with offsets to memory blocks.
Selfie, hypster, mipster, monster... these names are great.
What drivel. Make an artificial language which nobody uses, with a target architecture=X. Post it pretending that it is relevant. I Call BS on OP
It's a teaching aid for students. It's relevant.
It's not artificial, it is a C subset.
Beautiful, beautiful project. Containing the deepest twists of computation in a single file, and not a single #include. I only missed it including a text editor. Love it!
No boolean operators?! That's an odd choice.
We chose not to include support of Boolean operators and instead ask the students to implement that as part of an assignment. We use a self-grader for that. There is an assignment for bitwise Boolean operators. The assignment for logical Boolean operators with lazy evaluation is work in progress.
It’s a cute little exercise, to implement the three Boolean operations using operations on integers.
I just looked into the project and the slides are incredible. It would be nice if more professors would put so much effort into creating slides and not just take over the previous one and present them.
@all Thanks a lot for your awesome comments and feedback.

Besides compiler, emulator, and hypervisor, there is a symbolic execution engine in selfie that we are working on and would love to get feedback from you. The goal is to teach, eventually, a more formal approach when reasoning about correctness already in undergraduate classes. But the engine is also a research vehicle, especially the bounded model checking part.

Student here, with a question. How does one maintain a 10,000 line source file?
I maintain several such files with emacs. Jump to definition or open it in two windows makes it trivial.