tsahyt 2017-02-10 02:45:21
but attoparsec is well suited to the task at hand, and is generally faster than megaparsec, so I'd stick with that
biglama 2017-02-10 02:45:36
tsahyt: my only complaint is the error messages are not helpful
biglama 2017-02-10 02:45:46
they remind me of boost's spirit
tsahyt 2017-02-10 02:46:02
biglama: that's the tradeoff that attoparsec makes
cocreature 2017-02-10 02:46:21
bollu: our support for exceptions in llvm-hs is pretty rudamentary, adding support for the remaining instructions would be great. apart from that orc jit support also needs to be expanded & improved. and finally there is the pass manager stuff we talked about earlier
tsahyt 2017-02-10 02:46:25
it's designed to do things like protocol parsing in a network stack etc, where performance is paramount and the parser is not directly user-facing
bollu 2017-02-10 02:47:03
cocreature: is there a mailing list or something where this is discussed? also, I have both GHC 8 and a new-ish LLVM version on my laptop right now. Do I need to compile GHC to pick this up?
tsahyt 2017-02-10 02:47:11
biglama: but since your output is also generated by some software (from what I can tell), the lack of error messages should be a temporary nuisance until you've got the parser right
cocreature 2017-02-10 02:47:16
bollu: which part? :)
bollu 2017-02-10 02:47:18
cocreature: I'm curious to check if GHC can use the polyhedral optimisations in poly
merijn 2017-02-10 02:47:22
bollu: Yes, the aforementioned ghc-dev mailing list :)
tsahyt 2017-02-10 02:47:22
biglama: remember that you can always test your parser components in ghci using parseTest
bollu 2017-02-10 02:47:23
cocreature: the LLVM :)
bollu 2017-02-10 02:47:27
merijn: oh xD
cocreature 2017-02-10 02:47:31
bollu: in ghc or llvm-hs?
tsahyt 2017-02-10 02:47:39
biglama: make sure that the individual components are well behaved, and the use composition to make sure that the larger ones are
bollu 2017-02-10 02:47:48
cocreature: GHC
biglama 2017-02-10 02:47:51
tsahyt: yeah, I was just thinking from the point of view on an user
biglama 2017-02-10 02:47:55
thanks
tsahyt 2017-02-10 02:48:18
you're welcome. I'm always happy when I can save someone from using C++ :)
merijn 2017-02-10 02:48:39
tsahyt: When are you saving me? :p
cocreature 2017-02-10 02:48:40
bollu: there are probably track issues somewhere and as merijn mentioned there is the mailing list. there is also a #ghc channel
cocreature 2017-02-10 02:48:55
eh *trac
tsahyt 2017-02-10 02:49:24
merijn: first I'll have to understand haskell well enough to get rid of the last usecase for C++
tsahyt 2017-02-10 02:49:41
performance in particular can be a bit tricky at times
merijn 2017-02-10 02:54:53
Any suggestions how I could get rid of evalStateC on line 20 http://lpaste.net/352314 I'd like to see if I can entirely remove the "hoist (lift.lift)" on line 22
BernhardPosselt 2017-02-10 02:57:32
hi, can you define a monoid for maybe?
opqdonut 2017-02-10 02:57:53
yeah, you just need to decide whether to keep the left or the right value
BernhardPosselt 2017-02-10 02:58:18
and the thing inside needs to also have a monoid right?
lieven 2017-02-10 02:58:26
you have Monoid a => Monoid (Maybe a)
BernhardPosselt 2017-02-10 02:58:34
right
cocreature 2017-02-10 02:58:48
BernhardPosselt: not necessarily you can make a monoid that just always uses the left value
opqdonut 2017-02-10 02:59:10
so the default Monoid instance for Maybe is Monoid a => Monoid (Maybe a)
cocreature 2017-02-10 02:59:20
BernhardPosselt: https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Monoid.html#t:First
cocreature 2017-02-10 02:59:28
or https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Monoid.html#t:Last
opqdonut 2017-02-10 02:59:32
then there are Monoid (First a) and Monoid (Last a)
BernhardPosselt 2017-02-10 02:59:41
i see
BernhardPosselt 2017-02-10 02:59:57
so basically you can do what you want as long as the laws match
opqdonut 2017-02-10 03:00:05
yes
opqdonut 2017-02-10 03:00:45
another valid instance would be "instance Monoid (Maybe a) where mempty = Nothing; mappend _ _ = Nothing" :)
opqdonut 2017-02-10 03:00:51
it's a bit boring though
lieven 2017-02-10 03:01:01
the forgetful Monoid
Profpatsch 2017-02-10 03:01:12
The actual Monoid instance for Maybe is interesting, though.
Profpatsch 2017-02-10 03:01:43
It should actually read Semigroup a => Monoid (Maybe a)
Profpatsch 2017-02-10 03:01:57
Somebody should make that breaking change sometime?
merijn 2017-02-10 03:02:32
AFAIK Semigroup is coming into base
Profpatsch 2017-02-10 03:02:43
I thought it was already. Hrm.
bollu 2017-02-10 03:02:46
is it possible to skip the clone of all-cabal-hashes?
BernhardPosselt 2017-02-10 03:02:50
isnt it the same thing?
bollu 2017-02-10 03:02:50
I'm on a shitty network at home
bollu 2017-02-10 03:02:53
it's _going_to break
merijn 2017-02-10 03:02:53
Whether the Monoid for Maybe will change is doubtful
cocreature 2017-02-10 03:02:54
merijn: it already is
merijn 2017-02-10 03:02:57
oh?
BernhardPosselt 2017-02-10 03:02:59
semigroup and monoid?
cocreature 2017-02-10 03:03:01
merijn: https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Semigroup.html
Profpatsch 2017-02-10 03:03:13
BernhardPosselt: Semigroup is monoid without mempty
cocreature 2017-02-10 03:03:23
semigroup being in base not a different monoid instance for maybe
Profpatsch 2017-02-10 03:03:31
And a Magma would be a semigroup with no associativity.
merijn 2017-02-10 03:03:46
cocreature: Not for me, since I'm not on GHC 8 yet :p
Profpatsch 2017-02-10 03:04:01
merijn: y not?
tsahyt 2017-02-10 03:04:08
> (Just 3 <|> Nothing, Nothing <|> Just 3)
lambdabot 2017-02-10 03:04:10
(Just 3,Just 3)
tsahyt 2017-02-10 03:04:13
good
merijn 2017-02-10 03:04:18
Profpatsch: I haven't had a compelling reason to upgrade?
tsahyt 2017-02-10 03:04:24
finally found a use case for <|> with maybes :)
Profpatsch 2017-02-10 03:04:27
Now you have. :P
cocreature 2017-02-10 03:04:34
merijn: don't you know that new is always better? :)
merijn 2017-02-10 03:04:43
cocreature: New is generally worse ;)
merijn 2017-02-10 03:04:47
GHC is the exception :p
bollu 2017-02-10 03:04:53
Profpatsch: who even uses magma? :P
Profpatsch 2017-02-10 03:04:55
tsahyt: Yeah, that's an extremely cool instance.
merijn 2017-02-10 03:04:56
But I like not breaking my code :p
dramforever 2017-02-10 03:05:00
New is better than old
dramforever 2017-02-10 03:05:12
but old is usually better than bleeding-edge new
BernhardPosselt 2017-02-10 03:05:18
ah
bollu 2017-02-10 03:05:25
Profpatsch: I don't think there are any theorems you can write on a magma, are there?
BernhardPosselt 2017-02-10 03:05:28
semigroup is a monoid without neutral element
Profpatsch 2017-02-10 03:06:00
bollu: Well, you know you have a binary operation (a,a) -> a and that's pretty much it.
bollu 2017-02-10 03:06:03
BernhardPosselt: semigroup is atleast useful since you have the notion of a "semigroup action"
Profpatsch 2017-02-10 03:06:37
There's a new article by Bartosz: https://bartoszmilewski.com/2017/02/09/monoids-on-steroids/
Profpatsch 2017-02-10 03:07:30
I've read the first 4 paragraphs and already learned stuff.
BernhardPosselt 2017-02-10 03:07:44
another question: regarding the reader monad: is it just for passing common stuff around?
Profpatsch 2017-02-10 03:07:44
Which is impressive from a density standpoint.
merijn 2017-02-10 03:08:55
Is there any particular difference between a recursive binding in a let vs one using fix?
merijn 2017-02-10 03:09:02
In terms of performance, that is?
Profpatsch 2017-02-10 03:10:57
tsahyt: I'm using the Alternative instance of MaybeT to do type matching in GHCJS:
bollu 2017-02-10 03:11:30
merijn: intuitively, yes, right? because a let is a binding while calling fix is a function call?
bollu 2017-02-10 03:11:43
merijn: I could be dead wrong, I'd like to know myself
merijn 2017-02-10 03:12:05
I ask because conduit seems to prefer fix everywhere
Profpatsch 2017-02-10 03:12:10
tsahyt: (tryT HTMLInputElement >>= \inpEl -> …) <|> (tryT RadioNodeList >>= \rnl -> …) <|> …
Profpatsch 2017-02-10 03:12:31
where tryT t = MaybeT $ node `asTry` t
tsahyt 2017-02-10 03:13:08
I've just used it to try two lookups in a map and return the one that succeeds, so I don't have to store both the positive and negative versions of a literal
Profpatsch 2017-02-10 03:13:09
Took a while to figure out, but works like a charm.
angerman 2017-02-10 03:14:52
cocreature bollu, ha since having irccloud I actually get notifications. :D
bollu 2017-02-10 03:15:12
angerman: hello :) I also sent you an email
bollu 2017-02-10 03:15:33
angerman: so yes, how could I help with Haskell's LLVM story?
angerman 2017-02-10 03:15:41
bollu: I saw it. Yep :)
angerman 2017-02-10 03:16:22
bollu: what I try to do is actually replace the aging existing llvm backend, which heavily relies on the textual llvm ir with a bitcode llvm ir, which would be more resilent to llvm version updates.
angerman 2017-02-10 03:17:27
bollu: to achieve that without having to rebuild ghc each and every time, I extended the plugin interface a bit, so building the whole thing is not trivial. However with nix, you should be able to build and try it out rather easily. The relevant nix expression is provided in https://github.com/angerman/data-bitcode-plugin-env
angerman 2017-02-10 03:21:03
bollu: now, what needs to be done is: a) try to compile some haskell source, see where the llvm code gen plugin breaks, and fix the corresponding code path in the code gen (this basically involved reading the textual code gen in ghc right now, and porting it over to the new code gen in the llvm-plugin). (or just try to port everyting that is missing). b) add
angerman 2017-02-10 03:21:03
support for metadata to the data-bitcode and data-bitcode-llvm, such that data-bitcode-llvm can work with tbaa and function argument metadata. c) Add function level vst (value-symbol-lookup table), those would allow to give the function argument more readable names, instead of being simply enumerated.
angerman 2017-02-10 03:21:45
bollu: And in the end, integrating data-bitcode, data-bitcode-llvm, and data-bitcode-plugin into ghc. Either via an extended plugin system, or hardwiring it to replace the existing code gen.
bollu 2017-02-10 03:23:08
angerman: I usee
bollu 2017-02-10 03:23:11
I see*
bollu 2017-02-10 03:25:33
cocreature: LLVM-hs versus llvm-general?
bollu 2017-02-10 03:25:52
angerman: cool, I shall start playing around with this
angerman 2017-02-10 03:26:20
bollu: try to get the data-bitcode-plugin-env running :)
angerman 2017-02-10 03:26:35
bollu: and file issues, if something doesn't work as expected :D
bollu 2017-02-10 03:26:36
xD sure
bollu 2017-02-10 03:26:44
angerman: I need to install Nix first
cocreature 2017-02-10 03:28:19
bollu: llvm-hs is a fork of llvm-general created by a bunch of people that are a bit annoyed with llvm-general.
lpaste_ 2017-02-10 03:29:08
merijn pasted "One lift left to eliminate..." at http://lpaste.net/7015480017433919488
merijn 2017-02-10 03:29:43
I feel this could be cleaner without the StateT, but I can't really make it work :\
angerman 2017-02-10 03:30:14
cocreature bollu, not sure if this was mentioned already, however the data-bitcode stuff is pure haskell, contrary to what I believe llvm-general and llvm-hs do, by linking against llvm. Please correct me if I'm wrong, cocreature
cocreature 2017-02-10 03:30:27
yep that's correct
bollu 2017-02-10 03:30:35
cocreature: annoyed because of slow development?
bollu 2017-02-10 03:30:40
cocreature: also, llvm-hs is not up on hackage?
cocreature 2017-02-10 03:31:08
bollu: we'll do a release once llvm 4.0 is released which should happen in the next few weeks (rc2 got released today)
bollu 2017-02-10 03:31:37
cocreature: I see. so for now, if I want to pick it up..?
cocreature 2017-02-10 03:31:47
bollu: https://github.com/llvm-hs/llvm-hs
max3 2017-02-10 03:37:04
does anyone here use vscode with the ghc-mod extension? i'm getting `Couldn't start ghc-mod process Error: Command failed: [object Object] version`
max3 2017-02-10 03:37:29
even though i've cabal installed and seemingly set the correct ghcmod executable path
kgadek 2017-02-10 03:40:25
max3: didn't use vscode, but my first guess would be to check the $PATH used by vscode
kgadek 2017-02-10 03:40:45
i.e. are you sure that vscode can /see/ the ghc-mod?
max3 2017-02-10 03:41:31
i think i'm changing settings incorrectly
kgadek 2017-02-10 03:41:51
run `ps -wwE -p PID_OF_VSCODE`
kgadek 2017-02-10 03:42:07
this will show env vars for given process