On Thu, Nov 9, 2017, at 05:40 AM, Orians, Jeremiah (DTMB) wrote:
Is your idea with M2-Planet that you write a simple C compile, and thenSimplest C compiler that can compile mes.c or a functional equivalent
implement it in assembly?
Then depending on which group gets their implementation done first, that
will be the language used
(Slow_lisp, FORTH or Assembly)
How many lines of assembly do you estimate that would be to maintain?Given the current level of complexity about ~3000 lines of assembly
One thing is that we can use gcc to generate the assembly and take it asWe are not even going to consider that an option.
our "implementation" and maintain that.
But the assembly will be long, and not really maintainable for me.
If a human doesn't write it, it doesn't count
One idea that I got is that the Forth implementation in assembly is onlyThat requires Bison and GCC (no go)
about ~1000 lines, so that's maintainable.
One could then compile C code to Forth, here is a proof of concept:
https://github.com/dmedinag/C-to-Forth-compiler
I don't know what version of Forth that is using, and how hard it would beGFORTH and stage0 FORTH is approximately 84% there thanks to reepca
to target your assembly Forth implementation.
I also don't know if all the C constructs that are needed for a C compilerWe don't need ALL C constructs, only the minimal subset needed to
can actually be directly translated to Forth.
bootstrap mes.c
Then one can maintain the C code as the implementation, and the Forth codeGenerated code will NOT be used by stage0, only well commented code
will be generated from it.
written by humans will be used
For bootstrapping only the Forth code will be used of course, but if it'sIf you wish to write FORTH code for bootstrapping, it will be
readable and not much longer than the C code,
then I think that would serve the purpose, wouldn't it?
appreciated.
If you wish to simplify MES.c such that the floor for bootstrapping is
lower, we will also appreciate that