Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by Koshkin on Wednesday February 26, 2020 @04:26PM
(#22427523)
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.
[ Parent
| on HN ]
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by z29LiTp5qUC30n on Thursday February 27, 2020 @08:08AM
(#22432873)
You can get a proper C compiler in 2KLOC [or under 5Kloc of assembly https://github.com/oriansj/mescc-tools-seed/blob/master/x86/... | https://github.com/oriansj/mescc-tools-seed/blob/master/x86/...]
Covering things like gotos, inline assembly, structs, unions, arrays and dozens of types and primitives.
Oberon doesn't provide much advantage over that.
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by sitkack on Wednesday February 26, 2020 @09:45PM
(#22429895)
Funny because Selfie reminds me of a maximally compact version of http://www.projectoberon.com/
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by southpawflo on Wednesday February 26, 2020 @05:01PM
(#22427840)
at the bottom of the linked page the author explicitly references oberon as a source of inspiration for this project
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by giancarlostoro on Wednesday February 26, 2020 @04:27PM
(#22427532)
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?
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by kryptiskt on Wednesday February 26, 2020 @04:53PM
(#22427770)
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.
Re:Selfie – Tiny self-compiling C compiler, RISC-V emulator ...
by alexisread on Thursday February 27, 2020 @05:45AM
(#22432211)
Even better, A2/bluebottle is multithreaded with a ZUI and runs faster than Linux:
https://www.research-collection.ethz.ch/bitstream/handle/20....
Also, following on from A2, Composita introduces a component architecture to allow managed memory without GC, and contextless switches (IMHO better than Rust):
http://concurrency.ch/Content/publications/Blaeser_Component...