4 ms·
I think the only way to go is via an interpreter. That interpreter should be written in C, or some language trivially bootstrapped from C (that rules out C++, u
by choeger 5y ago
I think the only way to go is via an interpreter. That interpreter should be written in C, or some language trivially bootstrapped from C (that rules out C++, unfortunately, which has its own bootstrapping problems).
The interpreter could target a much simpler version of Haskell and it could be slow as hell, as it would be used only once.
- yakubin 5y agoWhy an interpreter and not a compiler?
- jlokier 5y agoBecause you only intend to run it once, on one input, and ad-hoc interpreters are usually simpler to write than compilers.
- codeflo 5y agoSuch a one-off Haskell interpreter might even get away without or with less rigorous type checking.
- choeger 5y agoAn interpreter omits the target architecture/format question and thus is more portable than a compiler. Of course, you could compile to a higher-level language, for instance directly to C. But that's usually still a complication that only gives you performance. And performance is something you probably don't need during bootstrapping.
- pjmlp 5y agoThat is how P-Code was born for Pascal, its original purpose was only to help porting Pascal compilers not to become a widespread target format for environments like UCSD Pascal.