Understanding STG

后端 未结 4 496
不思量自难忘°
不思量自难忘° 2021-01-30 05:15

The design of GHC is based on something called STG, which stands for \"spineless, tagless G-machine\".

Now G-machine is apparently short for \"graph reduction machine\",

4条回答
  •  梦毁少年i
    2021-01-30 05:57

    GHC wiki contains an introductory article about STG written by Max Bolingbroke:

    I know kung fu: learning STG by example

    The STG machine is an essential part of GHC, the world's leading Haskell compiler. It defines how the Haskell evaluation model should be efficiently implemented on standard hardware. Despite this key role, it is generally poorly understood amongst GHC users. This document aims to provide an overview of the STG machine in its modern, eval/apply-based, pointer-tagged incarnation by a series of simple examples showing how Haskell source code is compiled.

提交回复
热议问题