You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After considerable agonizing over it, I've pretty much decided to start self hosting work from scratch.
The initial self hosted compiler did what it was supposed to do, but since it was a direct AST to C translator the resulting code quality was terrible, and any improvements were bound to be limited to hacks.
This was very obvious in how slow the self-hosted parser ran: I didn't expect it to be a speed daemon, but it turned out to be a real bottleneck that made iterating on things unbearably slow.
I was also hankering to get started on a proper optimizing compiler that could support delimited continuations, and finally implementing actors.
I started with a new runtime design, with an explicit stack and a trampoline executor: there's overhead there that could be avoided, but unlike other solutions it should be portable with no architecture specific code.
Then I sketched out a sea of nodes CPS IR along the lines of Thorin, and started playing with it.
These approaches together seemed so promising that I've decided to forge ahead with them: for now they remain largely isolated from the old codebase, with new compiler in foo/impl/cps.foo, and new runtime in runtime/.
They're not really connected yet, but if things proceed apace I expect to be compiling a factorial program or the like in a week or few - and finally getting decent code and performance out! 🚀
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
After considerable agonizing over it, I've pretty much decided to start self hosting work from scratch.
The initial self hosted compiler did what it was supposed to do, but since it was a direct AST to C translator the resulting code quality was terrible, and any improvements were bound to be limited to hacks.
This was very obvious in how slow the self-hosted parser ran: I didn't expect it to be a speed daemon, but it turned out to be a real bottleneck that made iterating on things unbearably slow.
I was also hankering to get started on a proper optimizing compiler that could support delimited continuations, and finally implementing actors.
I started with a new runtime design, with an explicit stack and a trampoline executor: there's overhead there that could be avoided, but unlike other solutions it should be portable with no architecture specific code.
Then I sketched out a sea of nodes CPS IR along the lines of Thorin, and started playing with it.
These approaches together seemed so promising that I've decided to forge ahead with them: for now they remain largely isolated from the old codebase, with new compiler in
foo/impl/cps.foo
, and new runtime inruntime/
.They're not really connected yet, but if things proceed apace I expect to be compiling a factorial program or the like in a week or few - and finally getting decent code and performance out! 🚀
Beta Was this translation helpful? Give feedback.
All reactions