... | ... | @@ -7,32 +7,26 @@ This page says how you can load GHC into GHCi for more iterative development. Cs |
|
|
After building GHC, just do the following in the repository root:
|
|
|
|
|
|
```wiki
|
|
|
./utils/ghc-in-ghci/run.sh -fobject-code
|
|
|
./utils/ghc-in-ghci/run.sh
|
|
|
```
|
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
|
- adding `-j4` might speed up the process,
|
|
|
- `-fobject-code` will not be needed once [ D5015](https://phabricator.haskell.org/D5015) is merged.
|
|
|
- This works best on systems with a decent amount of RAM. The GHCi process uses about 3.5GB initially, and the usage sometimes increases during development. So, if you have less than 8GB of RAM, loading GHC into GHCi probably will not aid development efficiency.
|
|
|
|
|
|
### ghcid
|
|
|
- Adding `-j4` might speed up the process. Increasing the number will utilize more cores.
|
|
|
|
|
|
```wiki
|
|
|
ghcid -c "./inplace/bin/ghc-stage2 \
|
|
|
--interactive \
|
|
|
-ghci-script ./utils/ghc-in-ghci/settings.ghci \
|
|
|
-ghci-script ./utils/ghc-in-ghci/load-main.ghci \
|
|
|
-odir ./ghci-tmp \
|
|
|
-hidir ./ghci-tmp \
|
|
|
+RTS -A128m -RTS \
|
|
|
-fobject-code"
|
|
|
```
|
|
|
- The script will also run `:load Main`, to load GHC's main module. After that, running `main` will run an inner GHCi, because there is a default `:set args --interactive ...`. To override this, use `:set args ...` or `:main ...`.
|
|
|
|
|
|
- If you don't want to wait for `:load Main`, since you want to load some other module, then you can use `Ctrl+C` to cancel the initial load.
|
|
|
|
|
|
### ghcid
|
|
|
|
|
|
|
|
|
Once [ D5015](https://phabricator.haskell.org/D5015) is merged, it will be possible to just run `ghcid` directly without arguments.
|
|
|
There is a `.ghcid` file which allows use of Neil Mitchell's handy \[ghcid\]([ https://github.com/ndmitchell/ghcid](https://github.com/ndmitchell/ghcid)) tool directly by just running `ghcid`. This tool drives GHCi to automatically reload when files change.
|
|
|
|
|
|
## Old GHC
|
|
|
## Old GHC source tree
|
|
|
|
|
|
1. Put this .ghci file in compiler/
|
|
|
|
... | ... | |