[serene] Re: Bootstrapping the compiler

  • From: Amirreza Ask <raskarpour@xxxxxxxxx>
  • To: serene@xxxxxxxxxxxxx
  • Date: Fri, 30 Oct 2020 02:16:57 +0330

I think it’s a good idea, it will speed up the development, maybe even we can 
use some parser generators to make our progress even faster.

Sent from my iPhone

On Oct 30, 2020, at 01:24, Sameer Rahmani <lxsameer@xxxxxxx> wrote:


Hey folks,
Hope you're doing well. I had to come out of my cave and travel for 5km
to get to a internet cafe in order to send this email :)).

Today I was reading about the principles of computing systems and all of
a suddent a light bulb popped up above my head and a wide smile on my
face. So basically I have to say that I've missed something really
simple  but really important that I worked on it a lot as well and yet
surprising enough I forgot about. Till now, the plan was to create a
compiler for Serene in Rust or C++ and use that compiler to bootstrap a
self hosted compiler for Serene. But why can't we just create an
Interpreter for Serene to bootstrap the compiler ??? After all Serene is
a Lisp and it is in its nature to have an "interpreter" or a JIT.

Many languages are using the same approach (Specially Lisps) to
bootstrap the main compiler and eventually this bootstrap
compiler/interpreter is going to get outdated and replaced by the actual
compiler.

So, I think we have to shift our mindset from writting the compiler in
Rust and start creating the interpreter first. This way, will be closer
to have a working copy of Serene and closer to our far away goal. But in
order to implement this interpreter we have to think about couple of 
important points:

1. Bootstrapping a compiler from the source should be easy. Many experts
say that a C/C++ compiler should be enough to bootstrap a new
language. So in this case Rust might not be the best tool for
us. Personally I think it's fine but we need to think deeper.

2. We need to come up with the spec of Serene (or a minimal version of
it) much earlier.


Please share your feed back and thoughts.

Cheers
Sameer

Other related posts: