4 ms·
> The way GHC currently compiles is to first reduce Haskell to a Core language, which is a minimal subset of Haskell, in some sense. GHC Core is not a subset o
by runeks 9y ago
> The way GHC currently compiles is to first reduce Haskell to a Core language, which is a minimal subset of Haskell, in some sense.
GHC Core is not a subset of Haskell, it's just a simplification of it. The same thing but explained with fewer words (constructors).
That being said, we completely agree that Spineless Tagless G-Machine is full of badassery. Just imagine being able to reduce any Haskell app to, like, 8 different instructions. Something about that fascinates me, even though I'm not quite sure what it is.
- chrisseaton 9y ago> Just imagine being able to reduce any Haskell app to, like, 8 different instructions. It's a universal property of all programming languages that they can be reduced to a language with just one instruction, so it isn't a surprising result.
- aisofteng 9y agoCompiling C to assembly code that uses only one instruction, namely mov: https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator
- kobeya 9y agoCalling 'mov' on x86 one instruction is a bit of a fiction to begin with though.
- chrisseaton 9y agoThere are other, more straight-forward, one-instruction instruction-sets, such as subtract-and-branch-if-less-than-or-equal-to-zero.
- tome 9y agoBut the point is that STG preserves[1] the operational semantics of the program, not just the final calculated value. [1] Indeed it defines the operational semantics