[Yhc] hugs + Yhc, or similar...

Isaac isaacdupree at charter.net
Sun Jul 9 17:46:59 EDT 2006


Warning: Potentially useless (but then again potentially interesting or
useful) musing ahead

It occured to me that if we're going to be compilable with GHC and Yhc,
we might as well eventually make sure to work with other Haskell
implementations as well, like hugs.  Of course running Yhc under hugs
normally would be a bit stupid because of the speed.  And I realized
that, since portable Yhc bytecode of Yhc can be distributed,
self-compiling Yhc using hugs would not be necessary for bootstrapping
from no initial haskell implementation (Hugs is written in C, not
haskell as most haskell implementations are) (either way requires that
the Yhc-bytecode interpreter be compilable; I'm assuming it's in C).
However there are some interesting properties of such a thing:
* Every additional compiler Yhc works with helps ensures the code's
portability/standardness.
* It works for someone who really wants to compile things only from
their original sources.  Likewise, it helps to cure the property of a
program only being defined in terms of itself (and fixability if it's
buggy).  All known Haskell implementations directly depend at some point
on a C implementation, which is probably written in C, so there's no
getting around that (although C-- looks interesting; GHC still has a
substantial RTS(run-time system) written in C I believe, but jhc
deliberately doesn't). Of course this is irrelevant in practice, as gcc
and ghc are both heavily tested and have versions that work quite well
enough.
* Understandability, related to how much it is defined in terms of
itself (to someone who knows C and good programming but can't understand
natural-language explanations for some mysterious reason).I presume that
C-running-Haskell is still a higher level than C-running-Yhc-bytecode,
and thus more comprehensible. Now, as to the "mysterious reason": maybe
this "someone" is a powerful computer analysing (parts of) a computer
system. Perhaps for bugs or properties of it. Perhaps it's some
Martians, some space-aliens, some automated code audits, whatever. To
me, all this stuff (in part deliberately) sounds like science fiction
that could come true in some years.  Actually, it could be a paranoid
human looking through all code for actions it takes that are undesired
(rather than (or in addition to!) using the system's security measures
well).

Any thoughts? (Any mistaken assumptions?) Basically the summary is:
practically useless, but cool.

Isaac


More information about the Yhc mailing list