adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
scarygelatin has quit [Quit: Leaving]
scarygelatin has joined #ocaml
scarygelatin has quit [Client Quit]
Denommus has quit [Ping timeout: 260 seconds]
darkf has joined #ocaml
rishi has joined #ocaml
rishi is now known as Guest9724
sh0t has quit [Ping timeout: 252 seconds]
Reshi has quit [Ping timeout: 260 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
yegods has quit [Remote host closed the connection]
misterme_ has quit [Remote host closed the connection]
ril has joined #ocaml
yegods has joined #ocaml
ril has quit [Ping timeout: 260 seconds]
psnively has joined #ocaml
walter|r has joined #ocaml
rgrinberg has joined #ocaml
bba has quit [Read error: Connection reset by peer]
bba has joined #ocaml
Denommus has joined #ocaml
<Denommus> hi
<Denommus> is there already an expected release for modular implicits?
<psnively> 4.04, IIRC.
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
psnively has quit [Quit: Textual IRC Client: www.textualapp.com]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
walter|r has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 244 seconds]
_berke_ has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
johnelse has joined #ocaml
Guest9724 has quit [Ping timeout: 260 seconds]
doecnt has joined #ocaml
Guest9724 has joined #ocaml
Guest9724 has quit [Client Quit]
silver has quit [Quit: rakede]
gasche has joined #ocaml
<gasche> hm
<gasche> to my knowledge no release date was given for modular implicits
<cojy> is it possible it could just become a ppx extension or something?
hxegon has joined #ocaml
<gasche> well it is an extension of the type system, so you could technically provide it as a ppx extension (as any language feature) but it's not a purely syntactic macro
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
yegods has quit [Remote host closed the connection]
hcarty has joined #ocaml
sh0t has joined #ocaml
dsheets has joined #ocaml
dsheets_ has joined #ocaml
dsheets_ has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 250 seconds]
garrigue has joined #ocaml
garrigue has quit [Remote host closed the connection]
wolfcore has quit [Ping timeout: 250 seconds]
nicholasf has quit [Ping timeout: 240 seconds]
doecnt has quit [Ping timeout: 246 seconds]
wolfcore has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
wolfcore has quit [Ping timeout: 276 seconds]
kyo9142 has joined #ocaml
noddy has quit [Ping timeout: 268 seconds]
wolfcore has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_berke_ has joined #ocaml
<_berke_> hello
Intensity has quit [Ping timeout: 240 seconds]
cross has quit [Ping timeout: 244 seconds]
Algebr has quit [Ping timeout: 252 seconds]
hxegon has joined #ocaml
hxegon has quit [Client Quit]
kyo9142 has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
hcarty has quit [Ping timeout: 260 seconds]
johnelse has quit [Ping timeout: 276 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
badon has quit [Remote host closed the connection]
badon has joined #ocaml
kushal has joined #ocaml
johnelse has joined #ocaml
kushal has quit [Quit: Leaving]
hxegon has joined #ocaml
Intensity has joined #ocaml
hxegon has quit [Client Quit]
Intensity has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
mistermetaphor has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
arquebus has joined #ocaml
Intensity has joined #ocaml
pierpa has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
hxegon has joined #ocaml
arquebus has quit [Quit: Textual IRC Client: www.textualapp.com]
shinnya has quit [Ping timeout: 276 seconds]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
mistermetaphor has quit [Remote host closed the connection]
nicholasf has quit [Read error: Connection reset by peer]
rgrinberg has quit [Ping timeout: 244 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
nicholasf has joined #ocaml
njrt has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MercurialAlchemi has joined #ocaml
cross has joined #ocaml
cdidd has quit [Ping timeout: 276 seconds]
Simn has joined #ocaml
cdidd has joined #ocaml
Ninja123_ has joined #ocaml
Ninja123 has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
kushal has joined #ocaml
badon has quit [Ping timeout: 244 seconds]
aantron has quit [Remote host closed the connection]
oskarth has quit [Ping timeout: 264 seconds]
oskarth has joined #ocaml
sspi has quit [Ping timeout: 264 seconds]
yminsky has quit [Ping timeout: 264 seconds]
emmanueloga has quit [Ping timeout: 264 seconds]
cojy has quit [Ping timeout: 264 seconds]
caw has quit [Ping timeout: 264 seconds]
Guest33283 has quit [Ping timeout: 264 seconds]
andreypopp__ has quit [Ping timeout: 264 seconds]
parataxis has quit [Ping timeout: 264 seconds]
NhanH has quit [Ping timeout: 264 seconds]
l1x has quit [Ping timeout: 264 seconds]
ggherdov has quit [Ping timeout: 264 seconds]
cdidd has quit [Remote host closed the connection]
myst|fon has quit [Ping timeout: 264 seconds]
emmanueloga has joined #ocaml
Guest33283 has joined #ocaml
cojy has joined #ocaml
yminsky has joined #ocaml
sspi has joined #ocaml
myst|fon has joined #ocaml
caw has joined #ocaml
andreypopp__ has joined #ocaml
parataxis has joined #ocaml
l1x has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
lokien_ has joined #ocaml
MercurialAlchemi has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NhanH has joined #ocaml
mrvn has quit [Ping timeout: 246 seconds]
mrvn has joined #ocaml
ggherdov has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
ygrek has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
nicholasf has quit []
tane has joined #ocaml
Reshi has joined #ocaml
pyon has quit [Ping timeout: 268 seconds]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
please_help has quit [Ping timeout: 268 seconds]
please_help has joined #ocaml
larhat has joined #ocaml
amnn has joined #ocaml
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
Nahra has joined #ocaml
solrize has quit [Ping timeout: 250 seconds]
jwatzman|work has joined #ocaml
solrize has joined #ocaml
A19774941 has quit [Quit: Leaving.]
A1977494 has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
zaquest has quit [Read error: Connection reset by peer]
Reshi has joined #ocaml
rossberg has quit [Ping timeout: 260 seconds]
bba has joined #ocaml
rossberg has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A1977494 has quit [Quit: Leaving.]
anoisz_ has joined #ocaml
Reshi has quit [Ping timeout: 244 seconds]
A1977494 has joined #ocaml
anoisz has quit [Quit: Leaving]
anoisz_ has quit [Client Quit]
anoisz has joined #ocaml
zaquest has joined #ocaml
anoisz has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 268 seconds]
tane has quit [Quit: Verlassend]
dsheets has quit [Remote host closed the connection]
Enjolras has joined #ocaml
dsheets has joined #ocaml
tane has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
A1977494 has quit [Quit: Leaving.]
Reshi has joined #ocaml
A1977494 has joined #ocaml
kalzz has quit [Ping timeout: 264 seconds]
kalzz has joined #ocaml
diphuser has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
silver has joined #ocaml
FreeBird_ has joined #ocaml
bba has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
kakadu has joined #ocaml
cdidd has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux> there is already ppx_implicit doing exactly that
<flux> but I wonder if that's a long-term solution
<Drup> it's also a very brittle hack
mettekou has joined #ocaml
bba has joined #ocaml
badon has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mettekou has joined #ocaml
<flux> but why is it brittle? because it's so tightly bound with the ocaml compiler version?
<Drup> typing-as-a-ppx has various practical issues, and you need to refeed it to the original type checker anyway, so you can't do a lot of things
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
diphuser has quit [Ping timeout: 250 seconds]
sepp2k has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diphuser has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dsheets has quit [Remote host closed the connection]
yegods has joined #ocaml
ggole has joined #ocaml
mettekou has joined #ocaml
BitPuffin has joined #ocaml
dsheets has joined #ocaml
bombastus has joined #ocaml
toolslive has quit [Ping timeout: 250 seconds]
toolslive has joined #ocaml
ggole has quit [Remote host closed the connection]
ggole has joined #ocaml
kushal has quit [Quit: Leaving]
noddy has joined #ocaml
ggole has quit [Client Quit]
ggole has joined #ocaml
kamog has joined #ocaml
tane has quit [Quit: Verlassend]
Reshi has quit [Ping timeout: 250 seconds]
kakadu has quit [Ping timeout: 250 seconds]
jeffmo has quit [Quit: jeffmo]
Reshi has joined #ocaml
hcarty has joined #ocaml
rgrinberg has joined #ocaml
AlexRussia has quit [Ping timeout: 250 seconds]
bombastus has quit [Ping timeout: 276 seconds]
pyon has joined #ocaml
copy` has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
Reshi has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
kakadu has joined #ocaml
aantron has joined #ocaml
cdidd has quit [Ping timeout: 268 seconds]
kakadu has quit [Ping timeout: 250 seconds]
ski has quit [Remote host closed the connection]
cdidd has joined #ocaml
njrt has quit [Quit: Page closed]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
bombastu` has joined #ocaml
bombastu` has quit [Remote host closed the connection]
<dsheets> hmm chan topic is wrong. adrien?
yegods has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 246 seconds]
kakadu has joined #ocaml
<Leonidas> what is wrong?
hxegon has joined #ocaml
<Leonidas> OCaml 4.02.3 is still announced :p
flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
sh0t has joined #ocaml
jeffmo has joined #ocaml
* Leonidas :)
kaustuv has joined #ocaml
kushal has joined #ocaml
hxegon has quit [Max SendQ exceeded]
Mercuria1Alchemi has quit [Ping timeout: 246 seconds]
<kaustuv> Is the .mliv/.mlv hack slated to be removed from Batteries?
yegods has joined #ocaml
leyyin has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tane has joined #ocaml
mettekou has joined #ocaml
<companion_cube> no idea, but why should it be removed now?
mettekou has quit [Client Quit]
hxegon has joined #ocaml
<kaustuv> Because it may be more sensible to do it via ppx? I don't know how far Batteries wants to keep backwards compatibility though so maybe ppx isn't an option.
<companion_cube> probably that
<companion_cube> 3.12 is still alive, I think
<kaustuv> It's kind of unfortunate that the new result type is preventing Batteries from being moved to 4.03.
<flux> ocaml should have better backwards compatibility features.. :)
<flux> such as: constructor aliases!
mettekou has joined #ocaml
octachron has joined #ocaml
<kaustuv> alternatively make multiple definitions of a type not an error if the shadowed types are not exposed by the types of any other value
freehck has joined #ocaml
kamog has quit [Remote host closed the connection]
<flux> I don't think I follow..
<flux> the problem Batteries is that they want to alias their result type to the standard library's result type
<flux> and at the same time use differently named constructors due to backwards compatibility..
<kaustuv> I guess I am arguing for breaking the alias. If batteries wants to be backwards compatible with earlier versions of itself and also "downwards compatible" with the stdlib then this is an impossible conflict
<hcarty> kaustuv: There is preparation work being done for a 3.0 release
<companion_cube> yeah, it's time for a breaking release
<companion_cube> not that I use batteries, but still
<kaustuv> It's looking to me like it's easier and healthier to migrate away from Batteries as well in the projects under my control
MercurialAlchemi has joined #ocaml
<kaustuv> I would really like a kind of two-phase stdlib extension library, where each new data structure (eg. queues) would have a "core" module that just contains the functions relevant to the structure and a "plumbing" module that does all the printing/formatting/sexping/whatevering
<kaustuv> I also want an extension library that goes more in the direction of match with exception than of monadic style
<gasche> kaustuv: the upcoming release of Batteries will use the new result type in place of Batteries.result, so it will be a new major release (3.0)
<flux> wouldn't it be nice to release a maintenance release of 2.x without the Bad-change?
<gasche> (indeed, I would have liked to be able to have constructor aliases, and sent a feature request (#7102) to this effect; did not happen)
tristero has quit [Quit: tristero]
<flux> that way people who want to switch to 4.03 but don't immediately want to write their code to leverage the shared result type can do so
<flux> I mean, they are not worse off than they were before
<gasche> hm
<gasche> that's a good idea
<gasche> I'm not sure I will have time to do that myself
<gasche> (I already don't really have the time to do a Batteries 3.0 release)
<kaustuv> I just tried this and the compiler still rejects it since it has multiple definitions of result
slash^ has joined #ocaml
<gasche> yeah, you need to use destructive substitution to hide result or something
<kaustuv> ParserCo depends on BatPervasives.result, so result needs to be (repeated) in BatPervasives
shinnya has joined #ocaml
<kaustuv> I guess the import line in batteries.ml can be tweaked
<gasche> kaustuv: I just updated the "v2" branch of the upstream repo to point to a known-good recent state
<gasche> (the master has some code-breaking changes that I merged with 3.0 in mind)
<companion_cube> I think a problem with batteries is that it doesn't have many users that are also maintainers :s
<companion_cube> kaustuv: I'd even prefer the type definitions to be in the stdlib, and all the functions around to be in external libraries
<companion_cube> that way we could have compatible definitions among stdlibs
<gasche> 11:19 < companion_cube> I think a problem with batteries is that it doesn't have many users that are also maintainers :s
<gasche> indeed, I would be glad if more people were interested in helping the maintenance
<companion_cube> well that's my feeling
<kaustuv> gasche: I just tried with: opam pin add -kgit batteries 'https://github.com/ocaml-batteries-team/batteries-included#v2'
<kaustuv> doesn't compile in 4.03+flambda -- should it?
<gasche> right now it does not, indeed
<flux> you may be able to use opam pin add batteries https://github.com/ocaml-batteries-team/batteries-included.git#pull/670/head as a stopgap measure
<flux> probably the same thing?
<kaustuv> OK thanks, will watch that PR
<gasche> this PR does not implement flux's proposal, though, it just does away with Batteries.result
<gasche> flux: would you be motivated in sending a PR on top of this one that keeps Batteries.result?
<flux> I might
<flux> I guess it might be just taking kayceesrk series and dropping a patch from it
<flux> didn't look into it.. :)
<gasche> having a branch which does not compile because the result conflict alone would already be helpful
<gasche> flux: unfortunately KC's patches are monolithic
<hcarty> kaustuv: What do you mean by using match-with-exception rather than monadic style? Raising rather than returning option or result types?
bba has joined #ocaml
<flux> that would be my interpretation
<kaustuv> hcarty: yes.
<gasche> well _exn variants provide this, don't they?
<flux> I wonder if there'd be some nice ppx waiting to converting calls to their "dual"
<flux> let find_exn x = [%exn_of find x]
<flux> and vice versa
<kaustuv> as long as the new fancy optimization passes can "deforest" out the intermediate representations
<flux> or the syntax extension is super smart.. :)
<gasche> flux: well just a function would do here
<flux> gasche, don't be such a spoil sport :(
<flux> ppx, ppx, pxx!
mistermetaphor has joined #ocaml
<flux> I guess it doesn't bring anything to it though :)
<flux> not even in any other case?
<kaustuv> When/if I ever get around to updating that "perfect world ocaml" nonsense, I would put in deprecation of try/with in favor of match with exception
<gasche> kaustuv: what's the point of removing try..with? Sometimes it's what you want
<gasche> (when the value clause is just return)
<hcarty> kaustuv: I agree that match .. with exception ... is nice. But I don't see how that's significantly different than returning a result type, aside from the result type being explicit in the type signature
<hcarty> kaustuv: Leading to invisible breakage when moving from stdlib to extlib, for example
freehck has quit [Remote host closed the connection]
mettekou has quit [Quit: Textual IRC Client: www.textualapp.com]
pierpa has joined #ocaml
<flux> I wonder why it was chosen that "match" cannot be used for matching only exceptions
<flux> I mean, it could completely supercede the try-catch structure.
<flux> maybe it would be somehow strange to have match blabla; blolo; blibli; with exception ... ->
<kaustuv> Currently in OCaml and in any impure language there is the problem that every expression evaluation can potentially fail with an exception. This means that a function type t1 -> t2 option doesn't meant that t always returns Some x or None but that it returns Some x, None, or raises some exception. So, if you want to write bulletproof code you just have more failure conditions to check.
<rks`> I believe the same argument holds for a match statement with an empty set of "val" clauses
<kaustuv> Besides, maybe sometimes I don't want ('succ, 'fail) result but ('succ, 'fail1, 'fail2) result. With a blessed result type, you are forcing me to write it as ('succ, ('fail1, 'fail2) either) result. This just feels kind of heavy.
<flux> if the 'either' is replaced with a polymorphic variant then that becomes quite light.
<flux> well, it feels quite light, it maybe isn't.. :
<kaustuv> You still need to name your polymorphic variant constructors...
<flux> isn't that a good thing..
rgrinberg has quit [Ping timeout: 250 seconds]
<gasche> a compromise is to use an externsible type as failure type, typically ('a, exn) result
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hxegon_ has joined #ocaml
larhat has quit [Quit: Leaving.]
<flux> how is that better than simply ('a, 'b) result?
<gasche> orthogonally, people have been thinking about effect typing, and in particular exception typing, for OCaml
<kaustuv> gasche: In my mind, ('a, exn) result and 'a are "the same thing", except the former is uglier
<gasche> there are formal guarantees and there is expression of intent; types can be useful to make the latter concrete even if they don't change the former
<gasche> (and also that correspondence does not hold in call-by-value; so the (_, exn) result can be used to reify computations)
<kaustuv> I can see the value in formal guarantees if ('a, foo) result (where foo is an open variant, maybe even a subtype of exn) guarantees that all possible error conditions are covered by foo. Lacking this guarantee...
<_berke_> good afternoon
<gasche> hi _berke_
hxegon_ has quit [Client Quit]
hxegon_ has joined #ocaml
<_berke_> hi gabriel
<_berke_> do we have oasis already for 4.03?
diphuser has quit [Ping timeout: 250 seconds]
kaustuv has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
hxegon_ has quit [Quit: leaving]
hxegon_ has joined #ocaml
hxegon_ has quit [Client Quit]
hxegon_ has joined #ocaml
kakadu has quit [Quit: Page closed]
dsheets_ has joined #ocaml
<hcarty> _berke_: Not yet, at least not without pinning some packages. I'm not sure which ones.
dsheets has quit [Ping timeout: 276 seconds]
hxegon_ has quit [Quit: leaving]
hxegon_ has joined #ocaml
<_berke_> hcarty: thanks, I'll just wait. besides I have to convert my whole codebase to use ppx_sexpconv it seems.
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
hxegon has quit [Quit: Textual IRC Client: www.textualapp.com]
darkf has quit [Quit: Leaving]
hxegon_ has quit [Client Quit]
jwatzman|work has quit [Quit: jwatzman|work]
hxegon has joined #ocaml
rgrinberg has joined #ocaml
dsheets_ has quit [Remote host closed the connection]
dsheets has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
helpcamllight has joined #ocaml
<helpcamllight> Hello
<helpcamllight> I have been fighting with what appears to be a syntax / voodoo error in my camllight code and would greatly accept some assistance ( the code isn't really long)
<hxegon> helpcamllight: put it in a gist and link it
bba has joined #ocaml
<hcarty> rgrinberg: Do you know which version constraints are required to make opium 0.14.0 build from opam?
<helpcamllight> Everything which is composed of a letter and of a number is a (square) matrix, "plus" sums matrices "moins" substract them
<helpcamllight> My error is at the "else" before all the "let f1 = [|[|a1.(0).(0) * ( b2.(0).(0) - b4.(0).(0)) |]|] and ....."
<hxegon> helpcamllight: This code is super dense. I know this
<hxegon> doesn't sound like great help, but if you extracted some loginc and had better naming/comments, I would be more able to read and help, but you would probably figure it out in the process
<hxegon> s/loginc/logic
<helpcamllight> I'm going to do it right away, sorry
<hxegon> helpcamllight: don't be sorry, code is a process :D
<hxegon> took me longer than I'd like to admit to get SRP through my head.
lokien_ has joined #ocaml
<rgrinberg> hcarty: I expect cohttp/conduit pre ppx. Nothing exact though.
<rgrinberg> hcarty: Let me just release 0.15 into opam
<rgrinberg> I don't know why I've been delaying it for so long.
<rgrinberg> Ah now I remember. I switched laptops and I don't have opam publish installed :/
leyyin is now known as [{leyyin}]
kdas_ has joined #ocaml
[{leyyin}] is now known as [{ley
[{ley is now known as [{leyyin}]
kushal has quit [Disconnected by services]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
<hcarty> rgrinberg: Thanks - the upstream library changes from camlp4 to ppx unfortunately caused an opium-using project to break just as I was convincing a group of colleagues to try it out
<helpcamllight> hxegon: updated Gist https://gist.github.com/anonymous/06092dfeae8a4c15129808726bb1f64a , some lines are weird because they are using a non obvious mathematical method but that's not the issue here
[{leyyin}] is now known as \
\ is now known as Guest57219
Guest57219 has left #ocaml ["So Long, and Thanks for All the Fish"]
<rgrinberg> hcarty: will be released today. There might be some minor breakage wrt some things being renamed after the switch to hmap
<hxegon> helpcamllight: What's the message you're getting?
<helpcamllight> Just a "syntax error" hxegon
<companion_cube> good luck with the release
<hcarty> rgrinberg: Thanks. I've pinned to master so I think I'm caught up with changes locally
<companion_cube> first release without core_kernel, heh?
<flux> hxegon, you have code that looks in principle like: if condition then let a = b else let a = b + 1
<flux> hxegon, but there is not 'let a = b' inside functions, that's a top-level construct
<flux> hxegon, the "let" expression is functions goes like this: let a = b in c
<flux> hxegon, so the key thing here is to pick up that 'let a = b' is not an assignment
<hxegon> flux: that is helpcamllight's :)
<flux> meh :-)
<helpcamllight> flux: how can I do what I want to do ?
<flux> helpcamllight, the question is, what do you want to do with "c1" in let c1 = f1?
<helpcamllight> flux: I can't define a variable inside a function ? That's odd
<flux> do you know C, C++ or Java?
<helpcamllight> flux: In reality c1 looks more like "f1+f2-f4+f7..." , they are the building blocks of my final matrix
<helpcamllight> I used to know C yes
<flux> let a = b in c -> { auto a = b; c }
<flux> so your code is akin to: if (condition) { auto c1 = f1; }
<flux> now you know you cannot access c1 after the } :)
<flux> but to the solution part
<flux> you want to return the values c1, c2, c3, c4 from the if expression
tane has quit [Quit: Verlassend]
<flux> so: let (c1, c2, c3, c4) = if ... then .. let c1 = f1 and c2 = c3 = f4 and c4 = f7 in (c1, c2, c3, c4) else (* same thing here *)
<flux> and then finally 'in', to finish the first part of the let expression
<flux> in fact I notice you have an 'in' at the bottom, but it's not paired with a let
shinnya has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<flux> btw, in this case you can eliminate a lot of repetition by replacing that let.. in.. with just (f1, f2, f4, f7)
<helpcamllight> I can put only one "in" for the if/else right ?
<flux> and then the let before if goes like: let cs = if ..
<flux> if/else is if/else, it's not if/else/in..
<flux> in has nothing to do with if/then/else, in is always paired with a 'let'
<flux> and to continue what I was saying, then your final line becomes "in recombine cs"
<helpcamllight> Yes but I mean I can do a
<helpcamllight> let (c1,c2,c3,c4) = if x then y else z in (f1+f3 , f2+...+f7 , f4 , f7)
<flux> well, no
<helpcamllight> T_T
<flux> so where if f1 defined?
<flux> it's inside the if, isn't it?
ygrek has joined #ocaml
<helpcamllight> inside, I understand
<flux> so what you wrote is like: { auto (c1, c2, c3, c4) = { if x then { auto f1 = 42 } else z }; return (f1 + f3, ..); }
kakadu has joined #ocaml
A19774941 has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<helpcamllight> omfg it compiled
<flux> must mean it works.. :)
<helpcamllight> Yeah
<helpcamllight> Well I don't know yet but at least no more syntax error ;)
A1977494 has quit [Ping timeout: 244 seconds]
<helpcamllight> That you so much to all of you for helping me understand what I couldn't
<flux> I hope it clicked ;). luck with your studies.
<flux> also I gather ocaml development tools are so much nicer than camllight, but I guess you don't have a choice ;)
<hxegon> thanks for taking over flux, gl helpcamllight
copy` has quit [Quit: Connection closed for inactivity]
<helpcamllight> flux: yep, I have to use camllight for my upcoming competitive exams (in one year don't worry, I still have a few months to get better)
TheLemonMan has joined #ocaml
helpcamllight has quit [Ping timeout: 250 seconds]
Algebr has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
<adrien> we should get pitchforks and burn those who still impose caml light
dsheets has quit [Ping timeout: 240 seconds]
<hxegon> when I did cs 135 at my CC, the language was turbo pascal, so I don't think it's the worst option either
octachron has quit [Quit: Page closed]
<adrien> well, for him, pascal is probably the alternate choice
<gasche> adrien: I'm rather confident that people that believe that they have to use Caml Light, at least in France, are wrong
<gasche> as in, the people that grade the exams happily accept OCaml code
<gasche> the problem is that it's too complex to change the text of law (!?) that names the language used for the exams
<gasche> so lazy teachers use that as a pretext not to switch
<gasche> s/pretext/justification/
<Algebr> gasche: where is this? In France?
<adrien> gasche: true, I also believe those who impose it are teachers more than exam graders
<adrien> but you know how it feels: do you play it safe or do you believe random people on the internet? :P
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
<flux> can I interpret a char,char,char,char,.. Bigarray as an int32 array that combine 4 chars into one int32?
dsheets has joined #ocaml
<_berke_> flux: is this a file-mapped array?
<flux> no
copy` has joined #ocaml
<_berke_> then I don't think there's an "automatic" solution
<hcarty> flux: ocplib-endian has some functions which may help. I wrote Lwt_binio on top of it
<_berke_> you'll have to shift and or things to make an int32
<flux> well, I was hoping to have some cast approach due to performance reasons, but I guess not
<_berke_> if it's really performance critical you could always write a c function that hits the bigarray directly
<flux> sure..
<flux> I wonder when Ctypes learns to generate C from ocaml fragments.. :)
<flux> or even inline C. that would be something.
<_berke_> well you want to discourage that
dsheets has quit [Ping timeout: 250 seconds]
<_berke_> how ineffient would unpacking/packing an int32 to four chars from ocaml be anyway?
ggole has quit [Ping timeout: 260 seconds]
<flux> well, the function can be seen here: http://www.modeemi.fi/~flux/ocaml/reordered.ml
<flux> in fact some SIMD support in OCaml would be of course be preferable :)
NingaLeaf has joined #ocaml
<flux> reminds me of the patch to integrate inline assembler to ocaml
<hcarty> flux: ocplib-endian uses some efficient externals
<Drup> adrien: at least for ENS, OCaml is officially accepted (and has been for .. quite few years)
<flux> hcarty, cool, seems like it fits the bill exactly!
<Algebr> hcarty: is Lwt_binio in lwt itself?
jonasac has joined #ocaml
jonasac has quit [Client Quit]
neddhelpcamlligh has joined #ocaml
malc_ has joined #ocaml
<flux> well, I'm not 100% sure if my replacement works the same, but I think it's good enough for benchmarking.. and the int32-version beats the crap out of the int8-version :).
<flux> 700% faster
<flux> updated the .ml
<neddhelpcamlligh> flux, I had to afk, did I do correctly what you explained me ? ( https://gist.github.com/anonymous/3062c5aa3f8627cf579206f7c0e88227 ) I have a "Invalid_argument "vect_assign" " exception and I don't know if it is because of this or not
<flux> no it's not because of that.. sounds like you have function vect_assign that calls invalid_arg "vect_assign", if it's anything like ocaml
sh0t has quit [Ping timeout: 268 seconds]
<gasche> vect_assign is the exception raised when (a.(i) <- v) does an out-of-bound array access
<neddhelpcamlligh> I have no function called like that
shinnya has joined #ocaml
<gasche> check that, for all a.(i) expressions in your program, i is between 0 and (vect_length a - 1) included
<flux> camllight doesn't do back traces?
<gasche> I don't think so
<flux> hcarty, so the performance benefits were great, but sadly my data is (int, int8_unsigned_elt, c_layout) not (char, int8_unsigned_elt, c_layout) :-)
<flux> but I wonder if I could just change the library do work with (_, int8_unsigned_elt, c_layout) instead?
<flux> or actually
<flux> I can just use the primitives directly..
<flux> actually no, I need to have it in the platform-independent way like the library does
<gasche> you could just use ocp-bigendian
<flux> oh :)
<gasche> hm
<gasche> (it's not the actual name)
<gasche> I guess ocplib-endian
<gasche> oh
<gasche> you are already using that, I guess
<flux> but it comes with modules for bigstrings, strings and bytes
<gasche> apologies
<gasche> flux: but don't all (_, int8_unsigned_elt, c_layout) t have the same physical representation?
<flux> yes
<gasche> so you could file a feature request for a
<gasche> convert : ('a1, 'b, 'c) t -> ('a2, 'b, 'c) t noop function
doecnt has joined #ocaml
<flux> to ocaml or ocplib-endian?
<gasche> well
<gasche> OCaml would be the obvious place
<gasche> in that it would benefit other people
<gasche> if you want fast availability of the feature, I would suggest *also* sending it to ocplib-endian (and getting them to release right after), so that you can use it from current OCaml versions as well
<flux> well, I guess I can write that function just myself
<gasche> indeed
sh0t has joined #ocaml
<gasche> that's the individualist approach :-'
<gasche> also, then the unsafe code will be *on your hands*
kushal has quit [Quit: Leaving]
toolslive has quit [Ping timeout: 240 seconds]
lizzin has joined #ocaml
<flux> the pain, teh agony
lizzin_ has joined #ocaml
lizzin is now known as Guest15830
lizzin_ has quit [Changing host]
lizzin_ has joined #ocaml
lizzin_ is now known as lizzin
<flux> still perf shows caml_ba_get_N taking 8% of cpu :)
<flux> but I guess I use it elsewhere as well
Guest15830 has quit [Ping timeout: 268 seconds]
<Drup> flux: with +fp, you could check :D
<flux> well I do have +fp.. and there I found another loop iterating all pixels :)
axiles has quit [Ping timeout: 260 seconds]
<flux> in fact I must wonder if it's doing the same transformation but in reverse.. :)
<flux> seems a lot like it does :-)
<flux> actually not really in reverse, but doing the first part of the thing and then doing the second part differently. but I think this too could see a 700% speedup.
<flux> sadly that part is only taking 5% of the total cpu :)
<flux> hmm, no, 10%!
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lokien_ has quit [Quit: Connection closed for inactivity]
neddhelpcamlligh has quit [Ping timeout: 250 seconds]
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
octachron has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
<gasche> 15:23 < Drup> flux: with +fp, you could check :D
<gasche> that's wrong
<gasche> perf works well without +fp
<gasche> I'm surprised by the amount of misinformation that we read about frame pointers these days; maybe Damien shouldn't have mentioned them in the release
<Drup> gasche: absolutely, but I was answering "but I guess I use it elsewhere as well"
<Drup> with +fp, you get the % of the call stacks too
<gasche> without +fp, you get call stacks too
<Drup> Oh ? Not last time I tried
<Drup> "with old versions of perf" <- how old ?
pierpa` has joined #ocaml
<Drup> Anyway, if so, that's good! No need for frame pointers anymore.
pierpa has quit [Ping timeout: 276 seconds]
<gasche> Drup: so dwarf support was added in Linux 3.7, released on December 11th, 2012
sh0t has quit [Ping timeout: 276 seconds]
doecnt has quit [Ping timeout: 260 seconds]
<flux> all in all these int32-changes reduced the webcam-monitoring scenario from consuming 70% to 45% cpu :-o
<malc_> flux: how do you measure the load?
<flux> just 'top'
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<malc_> flux: don't rely on top
<malc_> unless you are using solaris
<flux> well, why not? the workload is quite similar, the only thing that changes is that transformation.
<edwin> there is this interesting concept that you can profile a program and find out which function you need to speed up by X% to speed up your entire program by Y%: https://github.com/bitemyapp/coz (it finds that out by slowing down different parts of your program to simulate the equivalent effect of a speedup) I haven't tried it with OCaml, to use it you need to add some 'progress points' that you want to measure, and that would require some C stubs.
MercurialAlchemi has joined #ocaml
sh0t has joined #ocaml
<flux> well, I kinda doubt I have such a bad case here that my results would be that significantly skewed..
<malc_> flux: i was hit by it the hardest when working with video acquisition
<malc_> but it can sneak in virtually any secnario
MercurialAlchemi has quit [Ping timeout: 246 seconds]
thibm has joined #ocaml
SomeDamnBody has joined #ocaml
<SomeDamnBody> Is there a tail recursive way to build a list
<ousado> sure
pierpa` is now known as pierpa
kalzz has quit [Ping timeout: 250 seconds]
<SomeDamnBody> ousado: so, basically, I have something like this:
<gasche> SomeDamnBody: typically you'll accumulate the reversed list, then List.rev at the end
<SomeDamnBody> oh!
<SomeDamnBody> I have to retain the result of the last computation in the argument to the function
<SomeDamnBody> and default it to empty
<SomeDamnBody> so, just making it otherwise tail recursive and returning the value out isn't enough
<SomeDamnBody> I think I get it now
<SomeDamnBody> Cool that worked :D
snhmib has joined #ocaml
thibm has quit [Quit: WeeChat 1.4]
kalzz has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
SomeDamnBody has quit [Ping timeout: 246 seconds]
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
douglascorrea has quit []
<malc_> anyone familiar with Warning 58?
<Drup> What about it ? It's quite clear
<malc_> Drup: a user just wrote that he hit it, we are using different build procedures so i've never seen it myself
A19774941 has quit [Quit: Leaving.]
<hcarty> Algebr: No, it's something I wrote and packaged separately a while ago
sepp2k has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 260 seconds]
<hcarty> Algebr: The implementation is pretty bare-bones. At the time I wanted bigarray mmap-like data access from Lwt
toolslive has joined #ocaml
tane has joined #ocaml
toolslive has quit [Ping timeout: 246 seconds]
kakadu has quit [Ping timeout: 276 seconds]
toolslive has joined #ocaml
kakadu has joined #ocaml
rgrinberg has joined #ocaml
axiles has joined #ocaml
Anarchos has joined #ocaml
hcarty has quit [Ping timeout: 276 seconds]
tane has quit [Quit: Verlassend]
dexterph has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
kyo9142 has joined #ocaml
dexterph has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
dexterph has joined #ocaml
dexterph has quit [Remote host closed the connection]
mehdib has quit [Ping timeout: 250 seconds]
pierpa` has joined #ocaml
Simn has quit [Quit: Leaving]
pierpa has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
twobitsprite has joined #ocaml
<twobitsprite> If I use a module alias in a .ml file, can I use that module alias in the .mli file without exposing the alias in the interface?
silver has quit [Quit: rakede]
dsheets has quit [Ping timeout: 276 seconds]
<gasche> twobitsprite: no
pyon has quit [Ping timeout: 240 seconds]
<twobitsprite> I.e., if in my .ml file, I'm using a module that has it's own type Module.t, and I alias with "module M = Module", and functions in my .ml return objects of type M.t... in my .mli, can I define the type of my functions as returning M.t, or do I have to specify Module.t?
<gasche> it is possible to do what you want if the signature is defined with "module type S = ...", and then included from the .mli
<gasche> for example ocamlbuild has a "signatures" file which define many module signatures, and mli files of the form "include Signatures.Foo"
pierpa` is now known as pierpa
<gasche> then you can have (module M = Module;; module type Foo = sig val t : M.t end) in signatures.mli
<twobitsprite> gasche: "module type" is something that makes my brain hurt... :P
<twobitsprite> oh, it's just a way to have the signature without a seperate .mli, right?
<twobitsprite> i.e., "module type M = ..." is the same as having a module.ml and module.mli, right?
<twobitsprite> sorry, I know, I'm a bit of a newb :P
<gasche> no worries, but I'm not sure whether the answer to your question is "yes"
mehdib has joined #ocaml
<gasche> what goes in a .mli is a module signature
<gasche> you can also define module signatures as part of usual .ml files, give them names and then manipulate them
<gasche> (including reusing them from .mli files using 'include')
<twobitsprite> ok... but the *kind* of stuff that goes in a .mli, is the same *kind* of stuff that goes in "module type ___ = sig ... end", right?
<gasche> yep
<gasche> have a look at http://caml.inria.fr/pub/docs/manual-ocaml/moduleexamples.html, sections 2.2 and 2.5
<twobitsprite> i.e., the .mli is the "module type" of the module defined in the .ml
<twobitsprite> I've read all of the module docs :P It's just something I haven't quite fully grokked yet... but I think I'm getting closer
<twobitsprite> It's not quite as hard as Haskell's monads, but it's still complex enough that it takes a while to really get the idea
dexterph has joined #ocaml
dexterph has quit [Remote host closed the connection]
<twobitsprite> so, here's my module: http://dpaste.com/2TN3GKC
<twobitsprite> and my .mli : http://dpaste.com/28J23CK
<twobitsprite> you're saying, instead I should have a "module type log = Logging.log" in the .mli, and then in my .ml, do "include log.mli"?
<twobitsprite> er... "module type L = sig t = Logging.log end"
<twobitsprite> and then change all of the function types to use "L.t" instead of "L.log" or "Logging.log"?
<twobitsprite> sorry, I know, I don't actually expect you to hold my hand... mostly I'm just thinking out loud :P
<twobitsprite> I'll give it a try
<gasche> no
<gasche> first, to be clear, I think that just writing Logging instead of L in the .mli is the most convenient solution
<gasche> but then, what I'm suggesting is to have something like
<twobitsprite> yeah, as I was looking at it, I realized the same thing
<twobitsprite> but for the sake of education, I'd still like to know how to do it that way
<gasche> a third module implemented in types.ml (or types.mli, or signatures.{ml,mli}, etc.)
<gasche> which defines an alias (module L = Logging) and a signature (module type Foo = sig <whatever you had in logging.mli> end)
<gasche> err s/logging.mli/foo.mli/
<gasche> and then in foo.mli, just put "include Types.Foo"
<twobitsprite> I see
<gasche> now that I think of it
<gasche> it would probably also work to have just "module L = Logging" in types.ml
<gasche> and then start logging.mli with "open Types"
<gasche> (and have the rest of the content)
<twobitsprite> but then in types.mli, <whatever you had in [foo.mli]> would have to include type signatures for every type and function in Logging that I use in foo.ml, right?
<gasche> and that solution is lighter and more convenient, so it makes sense to you it
<gasche> yes, but you don't have to duplicate this in foo.mli
<twobitsprite> right... I see
<twobitsprite> I think it's starting to make sense
mehdib has quit [Ping timeout: 276 seconds]
kyo9142 has quit [Ping timeout: 260 seconds]
lizzin has quit [Ping timeout: 244 seconds]
mehdib has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
kakadu has quit [Remote host closed the connection]
Denommus has quit [Remote host closed the connection]
Denommus has joined #ocaml
hxegon is now known as hxegon_afk
Nahra` has joined #ocaml
Nahra has quit [Remote host closed the connection]
Denommus has quit [Read error: Connection reset by peer]
pyon has joined #ocaml
octachron has quit [Quit: Leaving]
_berke_ has quit [Remote host closed the connection]