Re:C compiler with support for structs written in Assembly
by mmastrac on Monday August 27, 2018 @12:02PM
(#17852251)
Very cool. If I could port your G compiler to my VM that would basically get me where I wanted to be. I'll take a look at it!
[ Parent
| on HN ]
Re:C compiler with support for structs written in Assembly
by giomasce on Monday August 27, 2018 @12:17PM
(#17852336)
In theory yes, but at the moment my C compiler is very tied to the x86 platform (there is no separated code generation module, emit calls are directly in the code). Since the compiler is very simple, though, it should not be difficult factor out the handful of machine code gadgets that need to be implemented and add support for other back ends, I think. Or you might also other consider other ways, like using the toolchain in OP's repository.
If you want to have some brainstorming on #bootstrappable at freenode, there are often interesting discussions on these things.
Re:C compiler with support for structs written in Assembly
by akkartik on Monday August 27, 2018 @01:32PM
(#17852900)
Wow, great to meet both of you. I've been chasing bootstrapping as well. My approach has been to make programming in raw machine code more ergonomic with some simple text-based tools (that should in principle be easy to write in machine code)
My repo is at https://github.com/akkartik/mu/tree/master/subx#readme
Re:C compiler with support for structs written in Assembly
by akavel on Monday August 27, 2018 @01:51PM
(#17853009)
Did you consider Oberon?
Re:C compiler with support for structs written in Assembly
by lboasso on Monday August 27, 2018 @04:29PM
(#17854229)
as mentioned in another comment, an example of bootstrapping compiler for Oberon on the JVM is: https://github.com/lboasso/oberonc