flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
watermind has quit [Quit: Konversation terminated!]
zRecursive has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
ben_zen has joined #ocaml
csakatoku has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
walter has joined #ocaml
madroach has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
arquebus has joined #ocaml
skchrko has joined #ocaml
Neros has joined #ocaml
q66 has quit [Quit: Leaving]
arquebus has quit [Quit: Konversation terminated!]
ygrek has joined #ocaml
walter|r has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
darkf has joined #ocaml
weie has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]]
shinnya has quit [Ping timeout: 245 seconds]
alang has quit [Ping timeout: 240 seconds]
alang has joined #ocaml
<technomancy> http://p.hagelb.org/uuid.html <- I'm using this to get a string out of core's Uuid, but I feel like there must be a better way
<technomancy> in particular having to include a match clause against Sexp.List when I know it's going to return a Sexp.Atom
mrpantoufle has quit [Ping timeout: 264 seconds]
mrpantoufle has joined #ocaml
Snark has joined #ocaml
Neros has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
csakatoku has quit [Remote host closed the connection]
ggole has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
Yoric has joined #ocaml
csakatoku has joined #ocaml
yacks has quit [Ping timeout: 264 seconds]
yacks has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 246 seconds]
djcoin has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
thomasga has joined #ocaml
ggole has quit [Read error: Connection reset by peer]
csakatoku has quit [Remote host closed the connection]
ggole has joined #ocaml
zRecursive has left #ocaml []
Simn has joined #ocaml
ygrek has joined #ocaml
walter|r has quit [Quit: This computer has gone to sleep]
yacks has joined #ocaml
csakatoku has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
ben_zen has quit [Ping timeout: 264 seconds]
chambart has joined #ocaml
mcclurmc has joined #ocaml
ontologiae has joined #ocaml
ocp has joined #ocaml
ontologi1e has joined #ocaml
skchrko has quit [Quit: Leaving]
ontologi1e has quit [Quit: leaving]
eikke has joined #ocaml
mika1 has joined #ocaml
ontologi1e has joined #ocaml
ontologi1e has quit [Client Quit]
mcclurmc has quit [Quit: Leaving.]
yacks has joined #ocaml
Kakadu has joined #ocaml
skchrko has joined #ocaml
Yoric has joined #ocaml
mfp has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
<gasche> pippijn: are you there?
<gasche> I just discussed parsing error reporting with jjourdan and he had a nice idea
<rks`> gasche: and?
chambart has quit [Ping timeout: 249 seconds]
<rks`> guess we'll never know.
q66 has joined #ocaml
<gasche> I was still discussing, you're too impatient rks`
<gasche> what I discussed with pippijn , and I believe "all" he has implemented, is that the "syntax error" exception raised by the parser generator should also give the number of the automate state at the failure point
<gasche> a nice thing with that idea (also discussed by Russ Cox and others, see http://lambda-the-ultimate.org/node/4781#comment-76724 )
<gasche> is that it supports a nice interface that is non-invasive with respect to the parser generator: nearly nothing to change on the parser generator side
<rks`> (gasche: I don't deny it :))
<gasche> the nice interface is that on the side you write a list of pairs ("fragment of code that causes the same error", "nice error message that we should print in such cases")
<gasche> then you can call the parser on the fragment of code, get the automaton state, and use that to build a mapping (state -> nice error message) to use when doing error reporting
<gasche> jjourdan's idea is that we could add to the "syntax error" exception the list of locations of the parser stack at the error point
<gasche> (in fact you can only do that for a "safe suffix" of the stack that is guaranteed to be present in any path that leads to this state)
ocp has quit [Ping timeout: 264 seconds]
<gasche> then in the "fragment of code that causes the same error", you can mark some parts as "I want to get this location"
<gasche> eg. the opening parenthesis in a "missing closing parenthesis" sample
<gasche> and then get that location passed in the code producing the error message
<gasche> (what you do is that you look at the position of this location, for that precise code sample, in the list returned by the syntax error exception; and then for any error with the same automaton state you look at the same position in the list)
Simn has quit [Ping timeout: 240 seconds]
<gasche> rks`: I heard Yann Régis-Gianas did some work of that with a student recently, but I haven't seen him in a while so I haven't asked him about it
<rks`> so gasche, as I was saying on #oca
<rks`> ml-fr before you ran
<rks`> I believe there wasn't any interesting result
<gasche> you mean they couldn't get it done, or they got it done and it didn't work well?
<rks`> from what I remember, it was gruesomely slow
<rks`> (more than expected that is)
mcclurmc has joined #ocaml
<rks`> you could try to talk with Yann, or I might be able to have his student come here
<rks`> he might have something to say about it
<rks`> (that is, in opposition to me)
<gasche> well, why not
ocp has joined #ocaml
gereedy has quit [Ping timeout: 240 seconds]
<avsm> orbitz: was it you that was complaining about the icfp/cufp registration interface?
<avsm> because i'm sitting in front of it utterly baffled right now :)
gereedy has joined #ocaml
<rks`> avsm: while you're here, do you have any input on https://github.com/OCamlPro/opam-repository/pull/994 ?
ThibG has joined #ocaml
<rks`> or rather: why don't you like the suffix?
<rks`> ( gasche: meet ThibG )
<ThibG> _o/
eikke has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
<gasche> rks`: could you paste a history of the discussion so far for ThibG ?
ocp has quit [Ping timeout: 268 seconds]
<gasche> ThibG: I'm interested in better syntax error reporting for OCaml
<gasche> pippijn here has a small fork of Menhir that implement returning the automaton state number in the raised exception
<gasche> I was discussing extensions of this idea, and rks` mentioned that you did something similar with YRG
<ThibG> yeah, I did
<orbitz> avsm: yes it was :)
<orbitz> avsm: I *think* i registered proeprly, but i'm not exactly sure
<orbitz> avsm: I'll come crying to you when they turn me away on the first day :)
<gasche> ThibG: so what worked and didn't?
<ThibG> wait a bit, I'll rebuild and upload my report somewhere
<gasche> that'd be nice
<ThibG> anyway, the idea was to expand on Jeffery's paper to describe not one particular example of an error, but a set of those examples
<rks`> (I guess you don't need the log anymore?)
<gasche> rks`: there would be more details in the log
<ThibG> We've specified a small language for that, and I wrote a pretty simple algorithm to find (state, lookahead) sets matching it... well... a subset...
<adrien> gasche: thanks for the ocamlbuild bootstrap =)
vpit3833 has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
<ThibG> honestly, that's completely unusable for real-world grammars such as OCaml's, but it's probably still better than writing hundreds of thousands of examples by hand
<gasche> ThibG: thanks for writing your report in english
<gasche> more people should do that
<whitequark> you may or may not remember my recent troubles with trying to put a hash table keyed by a type into the same type.
<whitequark> so, it turns out that mutually recursive modules solve this like a charm: https://gist.github.com/whitequark/7c4aa2f79f35f76672bc
<gasche> beware of mutually recursive modules, they have a tendency to grow into problems
<gasche> my recommendation is to keep it as small as possible
<gasche> (that is, add the rest of your stuff outside it)
<whitequark> yes, it's kept inside implementation; they are invisible outside .ml file
<whitequark> and the Nametbl here is abstracted away.
<whitequark> well, `type overloads', rather
<whitequark> is it safe to mutate a Hashtbl while iterating it?
<whitequark> I don't see any warnings in the docs, but this operation has a history of not working properly in different languages.
csakatoku has quit [Remote host closed the connection]
<whitequark> specifically, I want to remove elements.
Simn has joined #ocaml
<gasche> (time for lunch)
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
ocp has joined #ocaml
ygrek has joined #ocaml
void64 has joined #ocaml
<pippijn> ThibG: interesting paper
ygrek has quit [Ping timeout: 276 seconds]
void64 is now known as void16
yacks has quit [Quit: Leaving]
ollehar has quit [Read error: Operation timed out]
beginner42 has joined #ocaml
ontologiae has quit [Ping timeout: 276 seconds]
Neros has joined #ocaml
eikke has joined #ocaml
walter|r has joined #ocaml
ontologiae has joined #ocaml
<kerneis> why are -dtypes and -annot in the man page ocamlopt(1), but not -bin-annot?
justdit has joined #ocaml
<flux> new (experimental?) features typically lag in the documentation..
<kerneis> this will be the second release with it
<kerneis> is it worth a patch?
<rks`> kerneis: definitly
<rks`> kerneis: by "experimental" flux meant everything since 3.10
<rks`> (#troll)
breakds has joined #ocaml
void16 has quit [Quit: Leaving]
_andre has joined #ocaml
* kerneis just lost 5 minutes making a patch
<rks`> :D
Drup has joined #ocaml
<ThibG> pippijn, thanks
jayprich has joined #ocaml
yakov has joined #ocaml
jayprich has quit [Ping timeout: 268 seconds]
yakov has quit [Client Quit]
yakov has joined #ocaml
ThibG has quit [Read error: Connection reset by peer]
justdit has quit [Ping timeout: 245 seconds]
balouis has quit [Ping timeout: 248 seconds]
balouis has joined #ocaml
adrien has quit [Ping timeout: 248 seconds]
ThibG has joined #ocaml
adrien has joined #ocaml
beginner42 has quit [Quit: Leaving]
chambart has joined #ocaml
dezzy has quit [Ping timeout: 248 seconds]
Anarchos has joined #ocaml
dezzy has joined #ocaml
<Anarchos> whitequark could you look at my pastebin code from yesterday ?
<whitequark> Anarchos: if you repost it
<Anarchos> http://www.pastebin.com/vGHHj4Yb with a modification : the recursive call line 10 is now terminal (i added an accumulator in the parameters since this version)
<whitequark> terminal? you mean tail?
<Anarchos> yes
<whitequark> hm, I'm not sure
<whitequark> I think that changing List.mem to Hashtbl.mem (and keeping an additional hash table) would lower algorithmic complexity
<whitequark> but that won't necessarily make it faster on small inputs
<Anarchos> whitequark sure i would go from linear complexity in the size of the list to a logarithmic one due to hashtable
<eikke> is there any way to combine variants & phantom types? e.g. type 'a t = int; val make_a : int -> `A t; val int_of_a_or_b : [`A or `B] t -> int
<Anarchos> whitequark thanks for the help i will consider replacing all my lists by hashtable if i have performance problems
<eikke> (with type 'a t being int "hidden" using modules)
<Anarchos> eikke just try in toplevel !
<eikke> I tried a couple of things, but didnt work out
<Anarchos> type 'a t = | `A| `B doesn't work ?
<eikke> that's not what I need :)
<gasche> eikke: yes, it's possible
<gasche> that said, nowadays I use GADTs instead of phantom types in these situations
<eikke> well, I tried using gadts, but couldnt get that to work either
<gasche> it is possible to combine GADTs and polymorphic variants as type indices, but I prefer pure GADT-based solutions which are simpler
<gasche> well
Anarchos has quit [Quit: tondeuse....]
<gasche> you could show us the code
<eikke> use-case: I want to tag Ssl.context's with `Client, `Server or `Both, and have some utilities which work on `Client or `Both context, and others only on `Server and `Both contexts
ocp has quit [Ping timeout: 264 seconds]
<gasche> you could also have two parameters, one for client and one for server (with both when they are both set)
<eikke> heh, interesting thought
<eikke> somewhat less 'nice', but should work indeed
<gasche> well
<gasche> if you use polymorphic variants
<gasche> you can have a [ `Client ] case, a [ `Server ] case, and a [ `Client | `Server ] case for "both"
<gasche> and you can write polymorphic functions that take something that has "at least `Client"
<gasche> if you use GADTs without variants, this kind of merging is harder to achieve, so the "product of type-level boolean" may end up being easier to use
<gasche> *booleans
<eikke> whoa
<eikke> I guess I was mostly using bad syntax
<eikke> thanks for that blog-post link, it's pretty much what I was intending to do :)
<gasche> it's a case where GADTs may not add that much values
<pippijn> is anybody here going to CC?
<gasche> GADTs are really useful when you want not only to produce safe values ('a t), but also destruct them and extract fine-grained typing information from the index
<eikke> gasche: yup, which I don't need (nor want, no need to introduce tagging overhead)
<gasche> in my own phantom type project (macaque, a type-safe database query library), I realized that I actually needed that late in the project
<gasche> and I had to use Obj.magic; in fact I was emulating GADTs
<gasche> in a sense GADTs allow you to have no "unsafe zone", such as what happens inside your phantom-type module... if your problem can be expressed not-too-hardly with GADTs
<gasche> pippijn: I may go to ETAPS since it's close geographically
<pippijn> nice
<kerneis> where is it this year?
<pippijn> grenoble
<gasche> Grenoble
<kerneis> ha
<kerneis> I need to submit a paper then
<gasche> deadline is October 4
<gasche> so hurry up
<gasche> hm
<kerneis> as usual
<gasche> October 11
<kerneis> I need my students to finish his benchmarks
<pippijn> oct 4 is abstract deadline
<kerneis> it will probably be too late
<kerneis> student*
<gasche> I was at ESOP last year, but I don't remember CC also being there
<kerneis> Compiler Construction certainly was at ETAPS last year
<kerneis> I got a paper rejected
<pippijn> what was it about?
<pippijn> did they say why it was rejected?
<eikke> gasche: this works out, thanks a bunch
<gasche> you're welcome
<gasche> kerneis: Robert Krebbers had a paper about formalizing C in fossacs last year
<gasche> if your paper was about approaches to compilation using "usual transformations from lambda-calculi", it may be a possible audience
<kerneis> no, anyway what I have in mind is more a tool report
<kerneis> we have been applying cpc to compile QEMU this summer (in the context of a GSoC)
chambart has quit [Ping timeout: 245 seconds]
<kerneis> if you are interested in the details, we can move on to #cpc
<kerneis> #cpc-lang sorry
<gasche> there is a workshop about "Programming Languages Approaches to Concurrency and Communication-Centric Software"
<ggole> <gasche> it is possible to combine GADTs and polymorphic variants as type indices
<ggole> Has that changed?
<gasche> bnwr should send something there
<gasche> (or whoever in the Mirage team is currently working on your linear-types language)
<gasche> ggole: we discussed doing *without*, but I don't know if it ever was impossible
<gasche> but yes, Jacques has improved the interaction between GADTs and variants a bit in trunk (will be in 4.01)
<ggole> Hmm, interesting
<pippijn> is cpc something like Lwt for C?
<gasche> in a sense, yes, except it is a compiler that handles the program transformation, instead of library-level monadification
<kerneis> pippijn: in CPC, you do not see the continuations
<kerneis> you see threads
<kerneis> in an actual, honnest imperative style
<kerneis> (cooperative threads more precisely)
<flux> 2/6
<flux> (oops)
<jpdeplaix> oh, gasche, sine it's the subject, is there a way to do a function of type « [< `A | `B ] t -> unit » with « type t = A : [`A] t | B : [`B] t | C : int t » ?
<kerneis> instead of a monadic style like Lwt
<pippijn> ok
beginnner42 has joined #ocaml
<jpdeplaix> (I tried but I failed, but maybe there is a way that I do not know)
<kerneis> File "myocamlbuild.ml", line 1:
<kerneis> Error: Files /home/gabriel/.opam/4.01.0beta1/lib/ocaml/unix.cmxa and /home/gabriel/.opam/4.01.0beta1/lib/ocaml/unix.cmxa
<gasche> jpdeplaix:
<kerneis> any hint?
<gasche> let ignore : type a . a t -> unit = function A -> () | B -> () | C -> ();;
<gasche> kerneis: yes: don't add package(unix)
<gasche> ocamlbuild is already linked with unix.cm(x)a by default
<kerneis> it's not me but opam install merlin with 4.01beta
<gasche> ah
<gasche> hmm
<gasche> I sense the regression falling on me
<gasche> would "true: package(unix)" prevent myocamlbuild's compilation?
<gasche> (or use_unix)
<kerneis> hmm
<kerneis> myocamlbuild.ml does not contain the package stuff
<kerneis> but _tags does
<jpdeplaix> gasche: no, that's not what I want. I want to match only on A and B but not on C
<gasche> ah
<kerneis> true: use_menhir, use_menhir_table
<kerneis> true: package(menhirLib), package(yojson), package(unix), package(findlib)
<kerneis> <src/outline_parser.*>: ext_tokens
<gasche> yeah
<gasche> I need to push a fix before release to avoid linking unix twice
<gasche> it's a bit sad kerneis that you're the first to report this, though
<gasche> ( dsheets : we need ocaml-ot ! )
letoh has quit [Read error: Connection reset by peer]
chambart has joined #ocaml
letoh has joined #ocaml
<gasche> kerneis:
<gasche> I could simply make sure not to link unix twice
<gasche> or I could also remove the "true: " tags from the one I used for myocamlbuild
<gasche> (extending the hack I did for Param_tags.init() warning)
chambart has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
<gasche> so kerneis I can confirm that this is a regression
<kerneis> I'm not sure what the best fix is, but it surely needs to land before release
<kerneis> thanks
<gasche> you just made my day much worse :D
<gasche> I'll first solve the double-linking issue
<gasche> then we can wonder about ruling out (true: foo) (which may be a good way to avoid other potential regressions)
<jpdeplaix> gasche: is it the same type of issue than this one https://github.com/def-lkb/merlin/commit/fef38bdf2633535aa1df6dbf984f299e7ce5d960 ?
<def-lkb> jpdeplaix: yes
<gasche> indeed
<gasche> but the Merlin authors changed their _tags instead of reporting a bug
<gasche> so I didn't hear about it
<def-lkb> those guys show really no respect for the community
<jpdeplaix> :D :D
* kerneis slaps def-lkb around with a large bug report
<rks`> :')
<kerneis> on the other hand, issue #44 was reported by… https://github.com/def-lkb/merlin/issues/44
<gasche> haha
<jpdeplaix> :D I didn't see it
ocp has joined #ocaml
<def-lkb> kerneis: shhh, you really are a trouble maker
<gasche> I also didn't look at the failure reported by avsm
<gasche> I guess I was too busy hacking on ocamlbuild :D
n06rin has joined #ocaml
ocp has quit [Ping timeout: 245 seconds]
<gasche> so I have a bugfix for the double-linking issue
<gasche> I'll also write a test for the testsuite, and we're set for a commit
ocp has joined #ocaml
<gasche> I think it would also be good to ignore the "true: ..." tags when compiling myocamlbuild
chambart has quit [Ping timeout: 245 seconds]
<kerneis> gasche: another use case I forgot by the way in the mllib-stuff: mllib -> mldylib (but this needs some more thinking, I just realised that I need it now)
ygrek has joined #ocaml
<gasche> kerneis: isn't that already present?
<gasche> hm
<gasche> I thought it was, but apparently not
<gasche> I don't know why I'd remember that
<gasche> ah
ocp has quit [Read error: No route to host]
ocp1 has joined #ocaml
<gasche> kerneis: there is a rule .cmxa -> .cmxs
<gasche> which is why I remembered something like this
ben_zen has joined #ocaml
yakov has quit [Ping timeout: 245 seconds]
<kerneis> gasche: yes, that's what I meant
<kerneis> this rule covers it right now
<kerneis> but we need to remember that case if we remove it (as another example of "mldylib do not always come from ml")
<rks`> kerneis: hello!
<rks`> (yes, hello is my introduction word)
<rks`> (even if you weren't talking to me)
<rks`> I was just reading the backlog
<rks`> and I noticed you were trying to use merlin with 4.01beta
<rks`> well, the opam version of merlin
<rks`> the thing is : you probably don't want to
<rks`> the version of merlin currently in opam won't work with 4.01
<rks`> I've created a pull request for a new package but it isn't accepted yet
<rks`> (that's all, you can now go back to your discussion)
<rks`> (:-')
<kerneis> rks`: I have a patch in my local copy of opam fixing it
<rks`> kerneis: I'm not talking about the compilation
<rks`> merlin should compile fine with 4.01 (well, it apparently doesn't for you but that's another issue)
<rks`> but merlin, in its actual state on opam, won't work properly with 4.01, because the format of the cmi and cmt files has changed
<kerneis> ah
<rks`> and the actual version of merlin doesn't know how to read them
<kerneis> got it
ocp1 has quit [Ping timeout: 256 seconds]
<kerneis> this "transitive by default" for cma is so annoying
* kerneis is writing a dozen trivial .mllib
<rks`> :/
<kerneis> we need a cms extension
<gasche> Damien suggested .shared.cma instead
<kerneis> why not
<gasche> and .inferred.mllib would also be nice :)
* kerneis goes back to work before starting hacking on ocamlbuild again
ocp has joined #ocaml
shinnya has joined #ocaml
Yoric has quit [Ping timeout: 268 seconds]
chambart has joined #ocaml
yakov has joined #ocaml
mika1 has quit [Quit: Leaving.]
void64 has joined #ocaml
yakov has quit [Ping timeout: 256 seconds]
yakov has joined #ocaml
<jpdeplaix> so gasche, about my question before ? Is it possible ?
chambart has quit [Ping timeout: 245 seconds]
ben_zen has quit [Ping timeout: 245 seconds]
<gasche> jpdeplaix: ah, I forgot about this one
<gasche> I don't think it is possible
Kakadu has quit [Quit: Konversation terminated!]
<jpdeplaix> gasche: too bad :/ It would be great. Is there some research about combining GADT with subtyping like that ?
<gasche> there is no subtyping involved here
<gasche> the problem is that you cannot make the row variable rigid
<ggole> You can do it with one type variable per "subtype", but it becomes a mess very, very fast.
Neros has quit [Read error: Operation timed out]
Guest7870 is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
<jpdeplaix> gasche: mmmh yes I see. I tried « type a. ([< `A | `B ] as a) … » but it's not really clever since a is a type and not a polymorphic type like 'a.
chambart has joined #ocaml
<jpdeplaix> I mean by subtyping the inference of [< `A | `B ] (especially the « < »)
<gasche> that would be a bit clearer if we could mention the row variable directly
<gasche> hm
<jpdeplaix> you mean like « type 'a. ([< `A | `B ] as 'a) … » ?
<gasche> no
<ggole> To substantiate my "one type argument per subtype" comment http://ocaml.nopaste.dk/p58905
<ggole> (Though I guess this is not really subtyping.)
Neros has joined #ocaml
introom has joined #ocaml
darkf has quit [Quit: Leaving]
<gasche> ggole: there actually is a paper about how arbitrary "finite" subtyping relations can be encoded that way
<ggole> Mmm, not surprised that it has been discovered already.
<ggole> I took a crack at using that trick to solve that operand problem I kept bugging you about.
<ggole> But I ended up with a type with 6 arguments and wasn't prepared to continue.
<gasche> :p
<ggole> gasche: what's the name of that paper?
<gasche> printf formats have 6 arguments and they're fine, aren't they? :-'
<gasche> it is quite aptly named "Phantom types and Subtyping"
<gasche> of course, the encoding is rather horrible
<ggole> Thanks, I'll check that out.
introom has quit [Remote host closed the connection]
<ggole> I keep wondering what direct support for such an apporach would look like.
<gasche> well
<ggole> It seems natural to want to be able to say "these legs of an ADT are impossible here".
<ggole> (Possibly at the expense of inference.)
<gasche> it wouldn't be unlike polymorphic variants or extensible record types, in fact
<ggole> Polymorphic variants are entirely open, though
<gasche> I'm not sure what you mean
<ggole> So you could expect at least some additional checking.
<gasche> ah
<gasche> you mean they are structural?
<ggole> Yes.
<ggole> There's also no, uh, transfer of knowledge with polymorphic variants.
<ggole> I mean: if you match foo with `Foo x -> ..., there is no knowledge in ... that things are restricted to the `Foo case.
<gasche> in fact there is
<gasche> # fun x -> match x with `Foo -> (x : [ `Foo ]);;
<gasche> - : [ `Foo ] -> [ `Foo ] = <fun>
<gasche> # fun x -> match x with `Foo as x -> (x : [ `Foo ]);;
<gasche> - : [< `Foo ] -> [ `Foo ] = <fun>
<gasche> the "as x" rebinds x with finer-grained local knowledge
<gasche> which I think is what you want
<gasche>
<gasche> so kerneis
<kerneis> yes?
<gasche> there is no good way to avoid double-linking unix.cma as long as someone applies any tag that links unix.cma to myocamlbuild
<gasche> so I have three choices
<gasche> (1) going out of my way to rule out (true: foo) tags from those considered for plugin building, which is an invasive change
<jpdeplaix> gasche: Is it possible (on a theoretical side) to soften the row variable ? can I do a feature request on mantis for that ?
ollehar has joined #ocaml
<gasche> (2) revert the modular-ocamlbuild work entirely, because it's not ready
<ggole> gasche: hmm
<gasche> (3) take tags from a command-line options and a _plugin_tags file only
<ggole> I wasn't aware of that use of as.
yakov has quit [Ping timeout: 260 seconds]
<gasche> I'm hesitating between (2) and (3)
<gasche> I'll probably implement (3) and then discuss with Damien whether we should also do (2)
<rks`> gasche: does the « _plugin_tags » already exist?
<gasche> no it doesn't
<rks`> then I'm against 3.
<rks`> (well, I'm against introducing the file)
<gasche> well
<rks`> and well, we'll just have to wait if you decide to revert
<ggole> gasche: that does seem to be very close to what I had in mind.
<gasche> the (true: foo) tags infecting plugin-compilation tags has always been something ugly
<ggole> Just a bit more explicit.
<gasche> the unix double-linking problem makes it a no-go from my point of view
<kerneis> gasche: I have another way
<gasche> (before I thought "well those added tags are harmless", but breaking compilation is not harmless at all)
<gasche> I'm all ears
<kerneis> why not ignore every line in _tags except those being exactly <myocamlbuild.ml> in the first step?
<kerneis> or <myocamlbuild.*>
<gasche> so
<ggole> And now that I think about it, the rebinding is necessary for soundness since the matched expression could be an array element or some other mutable structure that is changed in the match expression.
<gasche> this is more or less (1)
<kerneis> hmm, it doesn't work if you want your own plugin to build your stuff
<ggole> The copying of the rebinding protects against such shenanigans.
<rks`> (I like (1) better, of the 3 options btw)
<gasche> kerneis: I don't think you can have that anyway
<gasche> hm
<gasche> I can have a go at implementing (1)
<kerneis> I though dbunzli argued about it on mantis
yakov has joined #ocaml
<gasche> Daniel argues a lot :p
<gasche> ok
<kerneis> he's still in Cambridge if you want me to slap him ;-)
<gasche> let's go for (1) for now
<gasche> I'll still discuss (2) because I'm not happy with having to make changes after the beta release
<rks`> understandable.
zpe has quit [Remote host closed the connection]
yakov has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 276 seconds]
ocp has quit [Ping timeout: 264 seconds]
jpdeplaix has quit [Read error: Operation timed out]
<kerneis> gasche: crazy idea: could ocamlbuild dynamically load unix.cma with load_private?
<kerneis> hmm, no, I'm stupid
<kerneis> grr
<kerneis> hmm, yes in fact it could
<kerneis> but than it couldn't access it which is pointless
jpdeplaix has joined #ocaml
chambart has quit [Ping timeout: 260 seconds]
ollehar has quit [Ping timeout: 246 seconds]
<gasche> kerneis: so I have a patch for (1)
<gasche> I'm not fond of it
<gasche> (and will leave for dinner anyway)
<gasche> I'll think about it a bit more, and discuss it tomorrow
<gasche> maybe it'll get in, maybe I'll pull the whole thing out
<kerneis> ok
<kerneis> pulling out is a hard decision to make, but maybe better than being cursed for 10 generations^Wreleases
Neros has quit [Ping timeout: 248 seconds]
<kerneis> despite all its flaws, I'm still amazed by how convenient ocamlbuild is when it works
<rks`> if you're amazed, it must not be working that often.
<rks`> you should maybe consider trying something else.
<kerneis> no, I'm just performing massive refactoring and moving files around in a large code base
<kerneis> and it just works
eikke has quit [Read error: Operation timed out]
ben_zen has joined #ocaml
introom has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
Xom has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
introom has quit [Ping timeout: 248 seconds]
beginnner42 has quit [Quit: Leaving]
<kerneis> arg
<kerneis> directories are not allowed as rule dependencies
<kerneis> I guess I need a phony target, that's what I would do with a makefile
introom has joined #ocaml
ocp has joined #ocaml
skchrko has quit [Remote host closed the connection]
mcclurmc has quit [Quit: Leaving.]
Drup has quit [Ping timeout: 246 seconds]
introom has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
n06rin has quit [Quit: Leaving.]
void64 has quit [Read error: Operation timed out]
luke_ has joined #ocaml
Neros has joined #ocaml
Drup has joined #ocaml
dfan has quit [Read error: Connection reset by peer]
dfan has joined #ocaml
<technomancy> http://p.hagelb.org/never_reads.ml.html I'm using Async Readers to send a message and print the response, but the reader never calls the function I've bound to it
<technomancy> I know there are bytes being written in response
watermind has joined #ocaml
luke__ has joined #ocaml
luke_ has quit [Ping timeout: 245 seconds]
<watermind> what do you call taking an x and producing function () -> x
<watermind> thunking? lifting?
<watermind> something else?
<watermind> moving from a to unit -> a is lifting the type, but I'm unsure of the terminology at the value level
oriba has joined #ocaml
ocp has quit [Quit: Leaving.]
Yoric has joined #ocaml
dsamarin has quit [Ping timeout: 268 seconds]
Snark has quit [Quit: leaving]
ben_zen has joined #ocaml
eikke has joined #ocaml
ben_zen has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 245 seconds]
<technomancy> http://p.hagelb.org/never_reads.ml.html <- simplified version where a function bound to a Reader deferred never fires
ggole has quit []
<whitequark> watermind: thunking
dsamarin has joined #ocaml
ollehar has joined #ocaml
Yoric has joined #ocaml
<kerneis> watermind: not lifting
<kerneis> watermind: lifting is making free variable explicit, eg. let x = 1 in let f () = x+1 in f() => let x = 1 in let f x' () = x'+1 in f x ()
<kerneis> thunking seems a good name if your goal is to delay evaluation
<kerneis> but there is implicitly the idea of memoization associated with thunking
ollehar has quit [Ping timeout: 259 seconds]
<watermind> kerneis: oh, I had no idea that was called lifting
<technomancy> hm; maybe I should be using Async Rpc for this. I'm not finding much by way of examples for using Tcp directly
<watermind> kerneis: why memoization by the way? I'm not seeing the connection
<rks`> ping def-lkb
<technomancy> I like the RWO book pretty well, but the Async chapter way is too brief =\
<watermind> kerneis: memoization, in a call-by-need language is obtained by keeping (local) terms alive which won't have to be reavaluated... functions and therefore thunking are what I'm used to see being used to avoid memoization
<levi> thunking tends to refer to an implementation technique that happens under the covers to implement lazy evaluation. But you can emulate it by returning unit-param lambdas and then applying unit to them when you need to get the value.
<levi> From a user-level perspective, that operation is usually called 'delay' and applying () to it is then called 'force'
<def-lkb> technomancy: did you already wrote working async programs?
<technomancy> def-lkb: no, I've just copied the one from RWO
<technomancy> it looks like actually it's not the Reader; the Writer.write call is blocking forever
<technomancy> the write is going through and is flushed, but the call never returns
<technomancy> http://p.hagelb.org/nrepl.ml.html <- never prints "written"
<def-lkb> technomancy: a write call never blocks
jpdeplaix has quit [Ping timeout: 240 seconds]
<technomancy> def-lkb: hm; yeah just realized that it's actually printf that is broken =\
<def-lkb> try stracing your program
<technomancy> even a printf before the write call never prints
<technomancy> ugh
<technomancy> is this because Async redefines printf?
<technomancy> how can I call the original non-BS printf?
<def-lkb> Async doesn't redefine printf
<def-lkb> I doubt that a bug successively jumped from read to write to printf (both three are known to work)
<def-lkb> 1. are you running the scheduler?
<technomancy> RWO says "the version of printf that’s called here is actually Async’s specialized printf that goes through the Async scheduler rather than printing directly."
<technomancy> yeah, the write succeeds
<technomancy> the read might be succeeding too, but without printf I'll never know
<def-lkb> so use strace :)
Yoric has quit [Ping timeout: 246 seconds]
<technomancy> seriously? =\
Yoric has joined #ocaml
<def-lkb> at least you will have insight on what is really happening
<technomancy> where is that documented?
<levi> strace is your go-to tool for seeing what system calls your program is making.
<levi> Also great for discovering what insufficiently informative file IO errors are failing at.
jayprich has joined #ocaml
<def-lkb> (technomancy: btw, you're right, this is async version of printf, sorry)
<technomancy> an error would be nice
<technomancy> def-lkb: that only applies to unqualified printf though, right? Printf.printf is unaffected?
<def-lkb> yep
<technomancy> http://p.hagelb.org/traced.html <- I can see where it's trying to read and timing out
jpdeplaix has joined #ocaml
<technomancy> but the rest is gibberish to me
<technomancy> are there any guides to reading this output?
<ousado> manpages, mainly
<ousado> there's no write
<ousado> looks like your printf isn't flushed or something
<technomancy> you do that with \!, right?
<ousado> I don't know core async
<ousado> never used it
<technomancy> oh geez
<ousado> it seems to use select by default, is that configurable?
<levi> technomancy: Well, a printf would manifest as a write() call.
<technomancy> it's %!, not \!
<levi> I don't see any in that trace.
<technomancy> there we go
<technomancy> I was using the wrong escape for flushing
_andre has quit [Quit: leaving]
<technomancy> thanks everyone
<levi> strace is pretty spammy, as it includes all the filesystem access for shared library loading and whatnot.
thomasga1 has quit [Ping timeout: 256 seconds]
walter|r has quit [Quit: This computer has gone to sleep]
ontologiae has joined #ocaml
ollehar has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
Simn has quit [Quit: Leaving]
Yoric has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
<gasche> kerneis: you have probably found that out by now, but if you want to depend on a lot of stuff at the same time, ocamlbuild's solution is to use "stamps"
<gasche> (you can have a rule foo produce a stamp on the side, that is a digest of its dependencies, and then if you want to depend on all the stuff produced by foo, just depend on the stamp)
<gasche> (this is used in the .docdir/index.html rule for example)
ThibG has quit [Quit: ThibG]
ben_zen has joined #ocaml
dfan has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ulfdoz has quit [Ping timeout: 248 seconds]
ben_zen has quit [Ping timeout: 240 seconds]
luke_ has joined #ocaml
luke__ has quit [Ping timeout: 248 seconds]
dsheets has quit [Ping timeout: 276 seconds]
jayprich has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 246 seconds]
yacks has joined #ocaml
gnuvince has quit [Remote host closed the connection]
maurer has left #ocaml []
jayprich has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
transfinite has quit [Read error: Connection reset by peer]
ontologiae has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
dfan has joined #ocaml
<dfan> I'm having trouble getting merlin to recognize Core.Std libraries, can anyone assist?
<dfan> I get told that HashTbl.Poly, for example, is an unbound module
<dfan> I tried adding lines to .merlin such as
<dfan> PKG core
<dfan> and
<dfan> S ~/.opam/4.00.1/lib/core_kernel
<dfan> to no avail
<def-lkb> dfan: are you using vim ?
<dfan> emacs, sorry
<def-lkb> ok
<def-lkb> can you paste your code ?
<dfan> Sure, it's just cut and pasted from Real World OCaml
skchrko has joined #ocaml
<def-lkb> Did you "open Core.Std" at the beginning of the file ?
<dfan> No, but it's in my .ocamlinit
<dfan> Do I need it here too for merlin to see it?
<def-lkb> you still have to "open Core.Std" in every caml file
<def-lkb> yes
<dfan> Working! Thank you
<dfan> Is .ocamlinit just for the toplevel?
<def-lkb> (that applies both to merlin and ocaml compiler)
<def-lkb> yes
<def-lkb> ocamlinit is just for the toplevel
<dfan> Yeah, I would probably would have realized this as soon as I tried actually compiling (I've just been evaluating the file from Emacs)
<def-lkb> :)
pango has quit [Read error: Operation timed out]
<dfan> Beautiful, thanks again
<def-lkb> np, enjoy reading RWO
<def-lkb> j merlin
<def-lkb> (oops, sorry)
<dfan> I've been enjoying it so far. I have the feeling it might be a little fast for people without previous FP experience
djcoin has quit [Quit: WeeChat 0.4.0]
q66 has quit [Quit: Leaving]
ontologiae has joined #ocaml
jayprich has quit [Ping timeout: 240 seconds]
ontologiae has quit [Quit: WeeChat 0.4.0]
ontologiae has joined #ocaml
pango has joined #ocaml
ontologiae has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
Yoric has quit [Quit: Instantbird 1.5a1pre -- http://www.instantbird.com]
Yoric has joined #ocaml
zRecursive has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
yacks has quit [Quit: Leaving]
testcocoon has quit [Ping timeout: 264 seconds]
Yoric has quit [Ping timeout: 246 seconds]
Drup has quit [Quit: Leaving.]
Yoric has joined #ocaml
testcocoon has joined #ocaml
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 246 seconds]
yacks has joined #ocaml
dfan has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Neros has quit [Ping timeout: 246 seconds]
demonimin has joined #ocaml
<whitequark> is there a function like: Num.times 5 (fun i -> ...) ?
ollehar has quit [Ping timeout: 264 seconds]
<whitequark> doesn't seem so
mfp has quit [Ping timeout: 256 seconds]