Fast Haskell Scripts on GitHub Actions
2 points by abhin4v
2 points by abhin4v
"Magix is a neat tool that lets us run Haskell programs as scripts. We put a shebang on top mentioning Magix, list the Haskell packages we need, and ./script.hs just works."
Other tools like the built-in runghc also allow to run Haskell programs as
scripts. And both Cabal and Stack provide shebang ways to declare dependencies
and run. I wonder if Magix could be better defined as offering nix dependencies
and cached compilation on top of that.
So if I understand correctly, the idea is to cache only what's needed from the /nix cache, since caching all of /nix is very slow. Is this in a way like "tree-shaking" the /nix directory?
In an ideal world this kind of functionality would included in nix, although I guess it's very hard to make it work in general (presumably not every run-time dependency is discoverable through ldd).
Yes, that's the idea. Nix does have Nix bundle feature that provides similar functionality, but it results in significantly larger bundles, possibly because it bundles glibc.