athan 2017-02-18 02:51:19
edwardk should rename microlens to lentils, because it's small enough to digest :v
jmnoz 2017-02-18 02:54:44
Is there a way to avoid out of memory death on systems without swap? and low memory. docker.
sm 2017-02-18 03:01:40
jmnoz: if systems means gnu/linux, there's https://github.com/rfjakob/earlyoom
jmnoz 2017-02-18 03:05:57
it's linux. alpine for now. on a low mem server with no swap
cocreature 2017-02-18 03:08:11
jmnoz: there is some way to limit the max amount of ram which will cause the GC to be more aggressive but in the end, when the memory is needed, there is nothing you can do
c_wraith 2017-02-18 03:09:09
jmnoz: if the out of memory is during compilation, you can try using gold instead of ld as your linker
jmnoz 2017-02-18 03:09:19
it's runtime
c_wraith 2017-02-18 03:09:34
Then.. yeah. No good answer.
sternmull 2017-02-18 03:11:15
jmnoz: You could limit the maximum memory usage of a haskell process with the -M runtime option. See here https://downloads.haskell.org/~ghc/7.0.1/docs/html/users_guide/runtime-control.html
jmnoz 2017-02-18 03:12:21
sternmull: interesting, thanks
cocreature 2017-02-18 03:12:39
yeah that's the option I was referring to
cocreature 2017-02-18 03:12:58
I would be surprised if you get anything more than a decrease by a factor of 2 using this
jmnoz 2017-02-18 03:13:20
currently my entire machine gets killed off so the process dying would be a step up... I think
jmnoz 2017-02-18 03:13:57
Oh no I guess when the docker CMD ends the container ends
lordcirth 2017-02-18 03:16:46
jmnoz, yes it does. There's a flag that changes that, which I forget
Squarism 2017-02-18 03:17:56
theres no testframework in haskell that lets you pick a test in a suite from the commandline?
cocreature 2017-02-18 03:19:14
Squarism: I'm pretty sure hspec and hunit both let you do that
Squarism 2017-02-18 03:19:23
oh ok
cocreature 2017-02-18 03:19:51
hspec has a --match=PATTERN option and then it will only run tests that match that pattern
vaibhavsagar 2017-02-18 03:21:00
is there a way to use that command line option with `stack test`?
vaibhavsagar 2017-02-18 03:22:04
I've resorted to building an executable that is essentially my test suite and using -m there
Squarism 2017-02-18 03:22:04
im using hunit and stack btw
cocreature 2017-02-18 03:22:04
vaibhavsagar: there is a --test-arguments option or something like that that you can use to pass arguments to your test suite via "stack test"
vaibhavsagar 2017-02-18 03:25:12
cool, thanks for letting me know!
orion 2017-02-18 03:28:04
If I require a single function from a massive library, is GHC able to strip out all the unused code associated with that library?
Squarism 2017-02-18 03:30:36
cocreature, thanks for hinting! stack test --test-arguments "-t pattern" works perfectly for the combo stack/hunit/testframework
athan 2017-02-18 03:30:38
orion: I'm not precisely sure, but I've heard that doing sparse imports like `import Foo (foo)` helps the object file size
athan 2017-02-18 03:30:51
I'm sure there's a lot of dead code elimination though
athan 2017-02-18 03:31:02
I think what I noted was just for interface files or something though :s
athan 2017-02-18 03:31:20
you may find better answers on #ghc
ClaudiusMaximus 2017-02-18 03:35:57
orion: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#ghc-flag--split-objs and -split-sections seem relevant
orion 2017-02-18 03:38:32
ClaudiusMaximus: Thanks.
orion 2017-02-18 03:40:52
Why don't people use -split-sections all the time then?