[Git][ghc/ghc][wip/js-staging] Doc

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Mon Oct 10 13:57:50 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
c089b339 by Sylvain Henry at 2022-10-10T16:01:13+02:00
Doc

- - - - -


3 changed files:

- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/StgToJS.hs


Changes:

=====================================
compiler/GHC/Driver/Backend.hs
=====================================
@@ -280,19 +280,7 @@ llvmBackend = Named LLVM
 
 -- | The JavaScript Backend
 --
--- Compiles Stg code to JS, the relies on the
--- JS toolchain to produce workable code.
---
--- Notable points are:
--- 1. The JS backend /does not/ rely on GHC's native RTS or linker.
--- 2. Instead, the JS backend writes its own RTS. This RTS is split between
--- Haskell (see "GHC.StgToJS.Rts") and JavaScript (see "js" directory in root of
--- GHC project).
--- 3. "Linking" in the JS backend is not actually linking, rather it is merging
--- JS concrete syntax with static guarentees that all symbols used are defined
--- before their call sites (see "GHC.StgToJS.Linker").
---
--- See "GHC.StgToJS"
+-- See documentation in GHC.StgToJS
 jsBackend = Named JavaScript
 
 -- | Via-C ("unregisterised") backend.


=====================================
compiler/GHC/Driver/Pipeline/Execute.hs
=====================================
@@ -348,6 +348,7 @@ runAsPhase with_cpp pipe_env hsc_env location input_fn = do
         return output_fn
 
 
+-- | Embed .js files into .o files
 runJsPhase :: PipeEnv -> HscEnv -> FilePath -> IO FilePath
 runJsPhase pipe_env hsc_env input_fn = do
         let dflags     = hsc_dflags   hsc_env


=====================================
compiler/GHC/StgToJS.hs
=====================================
@@ -18,7 +18,6 @@ import GHC.StgToJS.CodeGen
 --
 -- Tail calls: translated code is tail call optimized through a trampoline,
 -- since JavaScript implementations don't always support tail calls.
---  TODO: add GHCJS optimizer for this to be true
 --
 -- JavaScript ASTs are then optimized. A dataflow analysis is performed and then
 -- dead code and redundant assignments are removed.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c089b339f4a84a7da964ac31e096a5be7fd4e261

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c089b339f4a84a7da964ac31e096a5be7fd4e261
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221010/f8e1bb02/attachment-0001.html>


More information about the ghc-commits mailing list