8000 Architecture · ghcjs/ghcjs Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dan edited this page Aug 21, 2013 · 2 revisions

GHC JS Architecture

Assorted notes on the GHC/JS architecture and inner workings. Hopefully will grow into a concise description.

High level workflow

GHC/JS compiles Haskell modules to JavaScript by, first, invoking the GHC API to compile haskell to the STG representation, then it translates this representation into JavaScript code. Each module is compiled in a different JavaScript object file (.js_o). The JavaScript modules are then linked as .jsexe files (JavaScript) and minified using the Google Closure Compiler.

Relevant pointers to the source code

  • Compiler/Variants.hs
  • Gen2/Generator.hs
  • Gen2/Linker.hs
  • Gen2/Object.hs - description of the js_o format
  • GHCJS.hs
0