[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: You missed my later work

From: Jan Nieuwenhuizen
Subject: Re: You missed my later work
Date: Fri, 31 Mar 2017 23:48:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi Jeremiah!

> I had recently watched your FOSDEM talk 
> Which you seem to have confused my hex assembler as an end in itself,
> rather than the first step in Stage0

Ah, that's why you say `You missed.'  Sorry for giving that suggestion.

What I really meant to say I think, is that your self hosting stage0 hex
assembler was one of the things that inspired me to start Mes.  I knew
you planned stage0 as a first step but I could not imagine how the next
steps would work out, at the time.

> Basically, I decided to steal a good idea from the C and pascal
> languages (o-code and p-code specificly)

Aah, okay.  That' smart.  I got questions why I did not start with forth
or brainfuck.

> Define a trivial to implement virtual machine (vm.c vm.h vm_decode.c
> and vm_instructions.c [optionally tty.c and/or
> dynamic_execution_trace.c but neither is required])
> Who's entire instruction set is define in

Found it...

> That way all platforms can independently verify every step
> Looking at your work, I can't help but wonder if we might be making
> that bootstrap step harder than it has to be.


> What if we converted my lisp interpreter into a lisp compiler? Could
> that simplify your initial bootstrap?

Quite possibly...

> Since instead of trying to do the full C compiler in scheme in a
> single step, we could do: Primitive_scheme -> minimal_scheme ->
> full_scheme -> done
> What do you think?

What you describe here makes lots of sense.  It very much resembles
something that I was aiming to do initially.  I wanted to bootstrap my
Scheme from Lisp-1.5 and prototype my Lisp-1.5 interpreter in C, only to
replace that prototype in C later by something in assembly --> and hook
up your stage0 or more.

...however, for the bootstrap problem we need [almost] a full C
compiler, enough to compile Tiny C (tcc).  I found Matt Wette's Nyacc,
which is a full C parser in Guile.

Then I got thinking: It could make sense to start a full C compiler
project in Guile?  That could be useful also outside of the bootstrap
process.  And if we have a full C compiler in Scheme, then maybe having
a Scheme interpreter (or VM?) in C is good enough.

So that's what I have been working towards, I should be quite close to
releasing Mes 0.5 which should be self-hosting: A Scheme interpreter
that can run a C compiler written in Scheme that can compile itself.

On the one hand that would be a very simple bootstrap setup.  On the
other hand this still leaves us with a fairly big bootstrap binary.
Possibly using your work as a front end to this removes that issue?

What do you think?

Greetings, janneke

Jan Nieuwenhuizen <address@hidden> | GNU LilyPond
Freelance IT | AvatarĀ®  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]