Changes between Initial Version and Version 2 of Ticket #7933


Ignore:
Timestamp:
May 27, 2013 9:34:16 AM (2 years ago)
Author:
simonpj
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7933

    • Property Status changed from new to patch
    • Property Difficulty changed from to Unknown
  • Ticket #7933 – Description

    initial v2  
    1 I'd like to RFC on the attached patch implementing JavaScript Cmm backend for GHC.
     1I'd like to RFC on the attached patch implementing !JavaScript Cmm backend for GHC.
    22
    3 It adds -fjavascript compilation option. Calling ghc -fjavascript produces JS in the output file.
    4 Otherwise the ghc binary should be fully functional as a native compiler. Thus -fjavascript is
    5 similar to -fllvm in spirit.
     3It adds `-fjavascript` compilation option. Calling `ghc -fjavascript` produces JS in the output file.
     4Otherwise the ghc binary should be fully functional as a native compiler. Thus `-fjavascript` is
     5similar to `-fllvm` in spirit.
    66
    7 The patch adds HscJavaScript constructor to HscTarget. It is used to dispatch code output to
    8 the new JsCodeGen module.
     7The patch adds `HscJavaScript` constructor to `HscTarget`. It is used to dispatch code output to
     8the new `JsCodeGen` module.
    99
    10 Generated JavaScript code relies on the built-in JS garbage collection. JsTransforms module
     10Generated !JavaScript code relies on the built-in JS garbage collection. `JsTransforms` module
    1111disables GHC Hp and Sp overflow checks.
    1212
    13 As JavaScript has no pointers, we emulate them using JS closures containing arrays and indices.
    14 To distinguish between pointers and scalars we run Hoopl heuristics in PointerMarker module.
     13As !JavaScript has no pointers, we emulate them using JS closures containing arrays and indices.
     14To distinguish between pointers and scalars we run Hoopl heuristics in `PointerMarker` module.
    1515
    1616As in native world, the generated JS object files are to be linked. In order to do this, there is
     
    1818JS object files using function maps provided by GHC.
    1919
    20 The JavaScript RTS has rts/*.cmm compiled to JavaScript almost as is. In addition there is a
     20The !JavaScript RTS has `rts/*.cmm` compiled to !JavaScript almost as is. In addition there is a
    2121handful of handwritten JS code residing in Josh distribution[2].
    2222
     
    3131possible.
    3232
    33 There are plenty caveats to the current patch. It works on 32 bits only. Math is fishy and
    34 Integer support is nonexistant. Lots of tests should be imported from GHC, GHCJS, Fay.
    35 No Handle based IO works at the moment. No performance tests were done.
     33There are plenty caveats to the current patch.
     34 * It works on 32 bits only. Math is fishy and Integer support is nonexistant.
     35 * Lots of tests should be imported from GHC, GHCJS, Fay.
     36 * No Handle based IO works at the moment.
     37 * No performance tests were done.
    3638
    3739Despite its shortcomings, the patch is fairly non-invasive, IMHO. It should be noted, that the
     
    4143Could GHC committers provide any guidance of what should be done in order to merge it?
    4244
    43 [1] https://github.com/bosu/josh
    44 [2] https://github.com/bosu/josh/blob/master/etc/ptr.js
    45 [3] https://github.com/bosu/ghc-prim
    46 [4] https://github.com/bosu/integer-gmp
    47 [5] https://github.com/bosu/base
     45 * [1] https://github.com/bosu/josh
     46 * [2] https://github.com/bosu/josh/blob/master/etc/ptr.js
     47 * [3] https://github.com/bosu/ghc-prim
     48 * [4] https://github.com/bosu/integer-gmp
     49 * [5] https://github.com/bosu/base