Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shakefile.hs should be compiled, not interpreted #396

Open
ndmitchell opened this issue Jan 1, 2016 · 1 comment
Open

Shakefile.hs should be compiled, not interpreted #396

ndmitchell opened this issue Jan 1, 2016 · 1 comment

Comments

@ndmitchell
Copy link
Owner

Shakefile.hs currently has runhaskell applied to it. It should probably compile to somewhere (maybe $TEMP? maybe .shake in the current directory?). Probably best to use ghc --make normally, or ghc-make if it is on the $PATH.

@ndmitchell
Copy link
Owner Author

Copied from #525 (comment):

It seems like there are a bunch of options:

  1. We can write our own ghc -M thing, but that's a lot of fragile code to deal with TemplateHaskell, head files etc. It's basically all of https://github.com/ndmitchell/ghc-make. I think it's too complex to be feasible.
  2. We can do what we do now, and just runhaskell it every time. Using the demo program (on the basis users with huge build scripts are going to do their own thing anyway) it takes 0.6s.
  3. We can runhaskell, but also ask it to compile to object code and store that code somewhere. That segfaults in GHC 8.6.3 on Windows due to https://ghc.haskell.org/trac/ghc/ticket/16057, but with 8.4 it takes 0.75 to build and 0.58 to run.
  4. We can run ghc --make takes 3.52s to compile GHC, 0.154 to do nothing, followed by 0.03s to execute it subsequently.

So only 2 and 4 make sense, and we're trading 0.6s vs 3.5s first and 0.15s subsequently. The other disadvantage of 4 is it writes to the file system. If those numbers are typical, I'd suggest we stick with 2. If those numbers change to be quite large quite rapidly for even moderately sized build systems, I'd go with 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant