[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Dynamic code generation
From: |
q |
Subject: |
Re: [Tinycc-devel] Dynamic code generation |
Date: |
Fri, 23 Aug 2013 20:21:41 +0200 (CEST) |
> >
> > This is *very* interesting. One thing that I have been dreaming about is
> > the ability to have some major module partially compile code once and then
> > allow the "user" to plug in miscellaneous expressions and finish the
> > compilation. It sounds like your patch might allow this sort of
> > functionality, or be the first step towards something like that. :-D
>
> Interesting idea. I think you will be restricted to using one state at a time.
> States with overlapping lifetimes probably not going to work.
> This is just a guess based on whatever I gathered from poking around
> the source, havn't tried it myself.
>
This idea is one of the nicest ideas in the TempleOS
project [1]. If you ignore the religious madness it is an
impressive OS which features a deadly fast "Holy C"
compiler. The system's programming language is the same as
the one used for shell interactions and the whole OS is
basically a compiler which first compiles the kernel, then
waits for input on the shell command line. Each snippet
typed on the command line is executed by instant
compilation+jump. A global hash table stores symbols and
represents the system's state.
As you guessed, the whole thing is obviously bootstrapped.
Well, this is crazy.
[1] http://www.templeos.org/Wb/Doc/Glossary.html#l180