[<<][staapl][>>][..]
Sat Jul 12 12:24:01 CEST 2008

writing C

Funny, how i've been disgusted by C to then move on to a higher level
of abstraction, only to find that i'm actually enjoying writing C
quite a bit because I'm getting better at writing properly factored
code.

Maybe the trick is really to define an s-expression based language
that can do anything C can do, so the compilation becomes incremental
rewriting?

The approach in ip.ss should maybe be a bit more factored + expose
lowlevel constructs?

How to make a better C?

    -> type inference + polymorphy
    -> local functions (macros): maybe like purrr: manual inlining?
    -> 2 stacks? would make downward-only local functions easier


My intuition says that it really can't be too hard to do this in a
proper, not too ad-hoc way, but any time i dive into it, it seems as
if i don't understand the problem fully. It does look like types are
the essential part. Maybe it's best to look at C without the
polymorphism of the math operators?

Another thing that might help is to simplify the control flow
constructs. Maybe only 'if and 'goto should be kept? Or 'if and
'while(1)? The 'for loop is at least better replaced with a 'while
loop.

With SSA and CPS being equivalent, how to generate C code such that
the SSA form that the compiler sees is actually the one we intend?




[Reply][About]
[<<][staapl][>>][..]