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/
amirmc has quit [Ping timeout: 256 seconds]
chrisdotcode has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
mfp has quit [Ping timeout: 246 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
darkf has joined #ocaml
mort___ has quit [Quit: Leaving.]
zRecursive has joined #ocaml
turnersr has joined #ocaml
hinayana has quit [Quit: Quitte]
<turnersr> Hi, I am working through examples of Okasaki's book on data structures. I am looking at the module for StackList https://bitbucket.org/mmottl/pure-fun/src/744d85f5220565e95c4f56688e1f2ef7e7095190/chp2.ml?at=default . And I do not understand how to evoke the append operator for the module's implementation. Also, is let (++) = (@), the example I am confused about, point free notation for OCaml?
<turnersr> nvm
<turnersr> I just got it. :)
<turnersr> Why the parentheses around ++?
<turnersr> And @?
ben_zen has joined #ocaml
Neros has joined #ocaml
<turnersr> Is it standard practice to mix the infix and prefix notation for operators in OCaml?
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
chrisdotcode has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
Xom has joined #ocaml
<Drup> turnersr: ( xxx ) is the notation to turn the "xxx" infix operator into the associated function.
<Drup> It's also this way you declare them
<turnersr> Yep, makes sense. Making operators standard prefix standard practice? I error if I try to do let ++ = @.
<turnersr> Although I can let x = [1; 2; 3] @ [1;2;4;5];;
<Drup> turnersr: you need the paranthesis to use infix operators as function, yes
<turnersr> Drup: Thank you. I am curious why the change and if regular OCaml coders prefer one style over the other. In LISP, for example, it's clear. OCaml can go either way and do projects tend you use one over the other?
<Drup> Not sure to see what style you are referring to. It's late for me, you will need to be a bit precise :D
<turnersr> let x = [1; 2; 3] @ [1;2;4;5];;
<turnersr> vs
<turnersr> let x = (@) [1; 2; 3] [1;2;4;5];;
<Drup> The syntax with paranthesis is not exactly making them prefix (you can also use prefix operators, starting with a ! character), they are plain real function than you can pass as argument
<Drup> However, I never saw anyone use infix operators like the second way :)
<turnersr> But does seem natural in this example
<turnersr> let y = ListStack.cons 1 ListStack.empty in let x = ListStack.cons 2 ListStack.empty in let h = (ListStack.(++) y x) in ListStack.tail h;;
<Drup> or ListStack.( y ++ x)
<Drup> wich is clearer, IMO
<turnersr> Yea, I like that better!
<Drup> which*
<Drup> "ModuleFoo.( bla )" is exactly like "let open Module Foo in bla"
<Drup> ModuleFoo*
<turnersr> And we need the parens in order make ++ act like first-class function?
<Drup> no, we need parens to delimit the local open
<Drup> you could also write "ListStack.( cons 1 empty )", for example
<turnersr> uhm, that makes sense given how you expand ModuleFoo.( bla ). Now I am still confused why the person needed to write let (++) = (@).
<turnersr> let ++ = @ ought work, too?
<turnersr> If does not of course.
<turnersr> It*
<turnersr> Because in ListStack.( y ++ x) we showed that ++ could be infix.
<Drup> the transformation from infix operator to "function" with the parens notation is done at the *parser* level, in the expression "let ++ = @", from the parser point of view, ++ and @ are obviously not infix operator, hence syntax error
<Drup> turnersr: look here http://caml.inria.fr/pub/docs/manual-ocaml/expr.html for some details
Neros has quit [Ping timeout: 264 seconds]
<turnersr> But parser is cool to treat ListStack.( y ++ x) as if ++ is infix.
<Drup> sure, it's in an infix position, there is a left and right operand
<turnersr> But let (++) = (@) is not in an infix position!
<turnersr> Hence the parens
<Drup> indeed
<turnersr> Is that example point free notion in OCaml?
<turnersr> like fact = foldr (*) 1
<turnersr> in Haskell ^
<Drup> let fact = fold_left ( * ) 1
<turnersr> Oh, cool. I think I understand now.
<turnersr> Thanks for the link and the help. :)
<Drup> (you need to be carefull with operator containg *, since it mix badly with ocaml's comments)
<turnersr> hahah
<Drup> (well, not badly, just suround them by spaces)
<turnersr> yeah, I can see that making the IDE tense up.
<whitequark> IDE? (*) is parsed as beginning of comment and ")" inside by ocaml
<turnersr> I where to write
<turnersr> let fact = fold_left (*) 1
<turnersr> in ocaml-top
<turnersr> It comments in a funny way
<turnersr> were*
<Drup> also, priority and associtivity of operators are syntax-defined in ocaml (just look at the table I linked)
pkrnj has joined #ocaml
<turnersr> Drup: I see the associtivity table. What do you mean by priority is syntax-defined in ocaml?
<Drup> for example, operators beginning by + will always have precedence over operator beginning by | (+ is higher in the table than |)
<turnersr> Ok, that's what I thought.
<turnersr> That could be made more explicit for the tired and dense people like me. :0
<turnersr> But I guess " The constructions with higher precedence come first. "
<turnersr> should be enough :/
<turnersr> Later, Drup! Thanks again.
turnersr has quit [Quit: Page closed]
test__ has joined #ocaml
test__ has quit [Client Quit]
shinnya has quit [Ping timeout: 240 seconds]
clog has joined #ocaml
mort___ has joined #ocaml
watermind has quit [Ping timeout: 276 seconds]
yezariaely has joined #ocaml
manud has quit [Quit: manud]
ulfdoz has joined #ocaml
yacks has quit [Quit: Leaving]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
francis has left #ocaml []
cdidd has quit [Ping timeout: 264 seconds]
bernardofpc has quit [Ping timeout: 260 seconds]
bernardofpc has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 264 seconds]
ben_zen has quit [Quit: sleeeeeeeep]
Simn has joined #ocaml
cdidd has joined #ocaml
hkBst has joined #ocaml
djcoin has joined #ocaml
ollehar has joined #ocaml
zRecursive has left #ocaml []
Snark has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
chambart has joined #ocaml
bernardofpc has quit [Ping timeout: 240 seconds]
bernardofpc has joined #ocaml
<yezariaely> is there some tool showing unused functions within a module?
zpe has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
<sgnb> yezariaely: oug
<sgnb> (I never used it myself)
<yezariaely> thx.
bernardofpc has quit [Ping timeout: 240 seconds]
bernardofpc has joined #ocaml
bernardofpc has quit [Ping timeout: 240 seconds]
bernardofpc has joined #ocaml
joostvb_ is now known as joostvb
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
<yezariaely> opam didn't generate documentation for a package after upgrading. How do I regenerate them?
<yezariaely> I can call opam install -d batteries
thomasga has quit [Read error: Connection reset by peer]
<yezariaely> but this says "already installed"
thomasga1 has joined #ocaml
<yezariaely> Can I force it to reinstall somehow?
weie has joined #ocaml
chambart has joined #ocaml
mfp has joined #ocaml
yacks has joined #ocaml
<yezariaely> found opam reinstall, never mind ...
mort___ has quit [Remote host closed the connection]
<yezariaely> but it does not install the docs :/ opam reinstall -d batteries does not create docs. :/
<gasche> kerneis: where are you on .mllib?
<gasche> (thanks for the whining on the testsuite, that's helpful)
<gasche> yezariaely: do you have experience with opam installing docs for batteries before?
<gasche> building Batteries doc is slow and a bit painful; I wouldn't be highly surprised if the opam packages had disabled that part
<yezariaely> gasche: I just ran a opam upgrade which installed batteries-2.1.0. Before, there was batteries-2.0.0 which automatically had docs installed. Now I installed docs manually from the build directory of opam by executing make doc which simply worked out of the box.
<yezariaely> though neither opam install -d nor opam reinstall -d installs batteries' docs
<gasche> I can't help you much, I know little about the batteries opam packaging
<gasche> hm
<gasche> do you often use the local html documentation?
<yezariaely> regularly, I work on my laptop
<gasche> I'm not trying to help but genuinely curious; I assumed most people either browsed the web online, or looked at the .mli files directly
<yezariaely> and I know that the docs I use match the version I use ;)
<gasche> does Batteries install its .mli in the relevant place?
<yezariaely> emh, probably.
<yezariaely> yes, it does.
<yezariaely> but I rather look at a properly formatted html doc with links than in a mli file.
<gasche> ok
<yezariaely> anyway, thx
weie_ has joined #ocaml
vpit3833 has joined #ocaml
weie has quit [Ping timeout: 245 seconds]
vpit3833 has quit [Client Quit]
osa1 has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
<kerneis> gasche: ok, the ml -> mllib approach is broken I think
skchrko has joined #ocaml
<gasche> :'(
<kerneis> there is simply no way to take into account every possible dynamic dep
<kerneis> if the user has a custom myocamlbuild.ml
<kerneis> but I'm quite sure of the semantics of those rules in fact
<gasche> +not?
<kerneis> +not
contempt has joined #ocaml
<gasche> one thing I noticed is that when you have a rule foo -> bar
<gasche> ocamlbuild is a bit ad-hoc in adding the tags of "foo", or of "bar", to the compilation command
<kerneis> too bad you're so far away, we badly need a whiteboard :-(
<gasche> :D
<gasche> Rocquencourt certainly is in the country, but I don't feel like I'm the one that got the farthest away :-'
<gasche> I don't understand what the problem with dynamic dependencies are, do you have an example ?
<kerneis> yes
<gasche> *problems
<kerneis> let me think 2 sec
<kerneis> there are 2 issues I think
<kerneis> 1/ to generate a static library (.cma, since cma must act as both static and dynamic, or .cmxa)
<kerneis> you need to know the complete list of dependencies
<kerneis> you cannot derive that from the ml file alone
<kerneis> because of ocamlbuild's dynamic rules
<kerneis> this is a particular instance of the more general problem that there is no way to get the list of depencies of a target
<kerneis> 2/ to generate a dynamic library (.cmxs)
<kerneis> there, a single call to ocamlopt -shared -linkall is enough
<kerneis> that's the current cmx -> cmxs rule
<kerneis> the problem is... no maybe there is no problem in that case
<gasche> the confusing between static and dynamic linking for cma and is the subject of a PR by Daniel
<gasche> *confusion
<kerneis> yes
<kerneis> it's extremely annoying
<kerneis> but it wouldn't solve this issue, only make it possible to generate "cms" easily
<kerneis> the problem remains for cmxa and "actual cma"
<gasche> I've actually been thinking of adding a .cmos target
<gasche> but let's not digress
<kerneis> so let's backtrack to the root of the issue:
<kerneis> if you have an mllib and it fails for some reason, but is named similarly to an ml, then cmo -> cma kicks in
<kerneis> and produces something incomplete (the transitive closure of your cmo)
ollehar has quit [Ping timeout: 246 seconds]
<gasche> I think what you're saying is that with .cmo -> .cma (or .cmo -> .mllib) one has access to the dependencies of the module, from the .cmo, while they're missing from the .ml file alone
<kerneis> yes
<kerneis> (although with cmo -> mllib I don't know how to get them in fact)
<gasche> well
<gasche> hm
<gasche> but do we really need to write those deps in the .mllib file?
darkf_ has joined #ocaml
<kerneis> yes
<gasche> I thought the .mllib -> .cma rule would take care of including the dependencies from the listed modules
darkf has quit [Ping timeout: 264 seconds]
<kerneis> ha, maybe…
<gasche> (contrarily to .mldylib)
<kerneis> hmm
<kerneis> interesting
<kerneis> so maybe it works after all
<gasche> hm
<gasche> kerneis: I will push some other changes to ocamlbuild today
<kerneis> no problem
<kerneis> does it change behaviour?
<gasche> but probably not risky changes in after that
<gasche> so I think we have three options
<kerneis> I'm fine with waiting for 4.01.1
<gasche> ok
<gasche> the options where more or less
<kerneis> this is an important issue, so let's fix it correctly directly
Yoric has joined #ocaml
<gasche> push it today, only have it in trunk (when it's ready), or devise a less invasive fix for now and do the rest later
<gasche> (eg. we could have various .foo.cmo -> .mllib for now, and do the factorization only in trunk)
<kerneis> (or you can apply my "works maybe current patch" and wait for screaming users to fix in next release or force people to write explicit mllib and mldylib :-)
<gasche> that's more or less option (1), "push it today", except I would require unit tests (instead of future screaming users)
<gasche> if you are willing to wait, I won't press you
<kerneis> I'll try and write some now anyway
<kerneis> that's while doing it that I realized this potential issue
<kerneis> so let's actually try it
<kerneis> gasche: btw, have you seen http://caml.inria.fr/mantis/view.php?id=6128
<kerneis> trivial patch
<gasche> yes, I'll merge it
<kerneis> thanks
<gasche> have you seen the "composable myocamlbuild.ml" patch I posted a week ago or so?
<gasche> it's totally unrelated but after discussion with Damien, I may include it in 4.01
<kerneis> no
<gasche> sadly, it hasn't had much feedback yet
<kerneis> PR?
<yezariaely> pull request?
<gasche> yezariaely: problem report
<yezariaely> ah :)
<gasche> if you want some reading and thinking in between the .mllib stuff, I'll welcome any comment
<yezariaely> hmm I expected a != b to be the same as: not (a = b) though I have a counter example :/
<gasche> (my goal is to do something minimally invasive, and still providing the basic brick for a *possible* plugin ecosystem after 4.01)
<yezariaely> what is the semantics of both
<yezariaely> ?
<gasche> yezariaely: you want to use (<>)
<kerneis> yezariaely: not (a==b) ~ a!=b
<yezariaely> ah!
<yezariaely> so != corresponds to == ?
<kerneis> yes
<yezariaely> grml :/
<gasche> it would be nice if we had docstrings for OCaml
<gasche> it may be possible in the extension-points branch
<kerneis> docstrings?
<gasche> a special comment on each signature item
<gasche> as in Python or Emacs
<gasche> users could ask "#doc (!=);;" in the toplevel
<yezariaely> yes, that would be indeed nice.
<kerneis> gasche: couldn't you (ab)use ocamldoc for this?
<kerneis> ah, you want to preserve it in the bytecode
<gasche> not necessarily, querying .cmti files would be an obvious choice
<gasche> OCamlbuild produces .odoc files, I don't know exactly what they have inside but that could be possible as well
mort___ has joined #ocaml
<gasche> so yes, it may be possible to implement it today already
mcclurmc has joined #ocaml
q66 has joined #ocaml
<kerneis> no idea, it just sounds like something ocamldoc has been designed for
<kerneis> (documenting interfaces)
<kerneis> gasche: there is a problem with "failing_msg"
<kerneis> if one is provided, we should check that the execution fails indeed
<kerneis> if you agree, I'll make a patch
<kerneis> (I need it right now anyway)
darkf_ is now known as darkf
<kerneis> (oh, or I can add a "not file" to check that a file is not here, works too)
Yoric has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
chris2_ has joined #ocaml
NaCl_ has joined #ocaml
mort___ has quit [*.net *.split]
zpe has quit [*.net *.split]
milosn_ has quit [*.net *.split]
asmanur has quit [*.net *.split]
fds has quit [*.net *.split]
IbnFirnas has quit [*.net *.split]
ggherdov has quit [*.net *.split]
chris2 has quit [*.net *.split]
Jenza has quit [*.net *.split]
NaCl has quit [*.net *.split]
mort___ has joined #ocaml
zpe has joined #ocaml
asmanur has joined #ocaml
fds has joined #ocaml
Jenza has joined #ocaml
<kerneis> hmm, it's already the case in fact
bernardofpc has quit [Quit: leaving]
bernardofpc has joined #ocaml
ggherdov has joined #ocaml
yezariaely has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
bernardofpc has quit [Quit: Changing server]
yezariaely has joined #ocaml
bernardofpc has joined #ocaml
<Kakadu> hi!
<Kakadu> Can u tell me if concept of virtual machine's "warm-up" is applyable to OCaml native code runtime?
<gasche> I don't think so Kakadu
<gasche> well
Xom has joined #ocaml
<Kakadu> I ask mecause my parser combinators runs seriously faster if I execute yacc parser before combinators
<Kakadu> because*
<gasche> it's probably an IO issue
<gasche> like you parse a file, the first batch is from the disk, the second batch has the file in the filesystem memory cache
<gasche> (in the general case as well there are various caching factors that may make hot code faster: the code is in cache, the memory is in the TLB cache, etc.)
<Kakadu> Any ideas how to verify your assumption?
<Kakadu> copy input file with a different name and parse two identical input files?
_andre has joined #ocaml
<gasche> Kakadu: well first try using yacc t wice, or using your parsing combinators twice, and see if the second run is faster
<ggole> Virtual machines have a "warm up" period because they are busy compiling code as it becomes hot enough
<ggole> OCaml definitely doesn't do that.
<Kakadu> If I use combinators twice than second time is 50% faster than 1st one
<ggole> Is this after compiling that binary?
<ggole> It's probably just the OS caching things.
<Kakadu> ggole: don't get your question...
<ggole> If you see that behaviour immediately after compiling, that might indicate that it is not a paging issue
<ggole> (Since that content is likely to be in the page cache.)
<gasche> you can probably test this assumption by measuring the time for "cat theinputfile" as well
chambart has quit [Ping timeout: 246 seconds]
<Kakadu> yeah , I have executed just after compiling
<ggole> IIRC there is a way to ask Linux to drop certain bits of the page cache, so you might be able to test it.
<ggole> If you are on Linux.
<gasche> (and you can probably remove the overhead of the first version by adding a "cat theinputfile > /dev/null" before launching your program)
<Kakadu> cat gives the same time
<Kakadu> but my files is nt very big, 4.6M
<ggole> sync && echo 3 > /proc/sys/vm/drop_caches
<ggole> Probably easier just to run it a few times and take the later readings as more accurage.
<ggole> *accurate.
<pippijn> adrien: where's wmeyer?
<gasche> I think he's in holidays
<pippijn> oh
<gasche> hm
<gasche> I have no idea in fact
<gasche> but that would be a good reason not to be very present, in the middle of August
<pippijn> right, august
mort___ has quit [Quit: Leaving.]
introom has joined #ocaml
<Kakadu> heh, `echo 3` really changes time results for cat
<Kakadu> ggole: thanks
walter has joined #ocaml
<gasche> I just pushed the "composable-ocamlbuild" patchset in trunk and version/4.01
<gasche> this might introduce regressions (which will hopefully be catched when 4.01 beta is released and tested), but it should also have very positive effects on the ocamlbuild plugin ecosystem after 4.01 is released
<kerneis> ack
<kerneis> gasche: writing unit tests, seems to work so far
chris2_ is now known as chris2
<kerneis> hmm, no
<kerneis> what was I thinking?
yezariaely has quit [Quit: Leaving.]
<kerneis> gasche: so I confirm that if you have a mllib, ocamlbuild does *not* take it's transitive closure for cma/cmx
<kerneis> (cmxa/cmx I meant)
osa1 has quit [Ping timeout: 256 seconds]
<pippijn> gasche: great
<pippijn> gasche: composable ocamlbuild is what I need
<kerneis> pippijn: check the current definition of "composable" here http://caml.inria.fr/mantis/view.php?id=5680#c10124
<kerneis> and comment if you don't like it
<kerneis> (or even if you do)
<gasche> yeah, the patch only does a very minimal job so far
<pippijn> what I have right now is a "pbuild" project (pippijn's ocamlbuild)
<pippijn> which contains a number of files with ocamlbuild rules
Neros has joined #ocaml
<pippijn> like this: https://paste.xinu.at/NSAhJZ/
chambart has joined #ocaml
<pippijn> and a pbuildise program that edits myocamlbuild.ml and replaces PBUILD_START/PBUILD_END sections with the text in that file
<pippijn> oasis style
<gasche> yeah, so you should be able to distribute each as an ocamlfind package
<pippijn> that's great
<gasche> and them from your ocamlbuild call, say, Noweb_ocamlbuild_plugin.init ();
<pippijn> eh
<pippijn> ok.. whatever
<pippijn> it doesn't really matter what it looks like
<gasche> Daniel Bünzli would like to be able to put nothing at all in the myocamlbuild.ml, and have it magically work anyway
<companion_cube> that would be nice, I second him
<gasche> for now you have to be a bit more explicit, and I think that it's best (at least while we don't know exactly what we want)
<pippijn> that would be possible, either by enumerating all packages and importing all $packagename.ocamlbuild
<pippijn> or by installing rules into $ocamllibdir/ocamlbuild/rules or something
<gasche> hm
<pippijn> but what about conflicts?
<gasche> what I don't like is the idea that those plugins turn into programs that do side-effects at initialization time
<gasche> (observable side-effects)
<pippijn> if one package produces .ml from .foo with fooprog, and another produces .ml from .foo with foobarprog
<pippijn> I don't think that's good :)
<gasche> indeed
<pippijn> better be explicit about which packages to import
<gasche> that is my opinion
<pippijn> perhaps with a non-.ml config file, if he doesn't want to write a myocamlbuild.ml
<pippijn> but personally, I don't see a problem with that
<pippijn> something like this, but for ocamlbuild
<pippijn> and then just import the ones you need
<gasche> people have been pushing to put this information in tags
<gasche> something like
<pippijn> rules in tags?
<gasche> "true: plugin(noweb)"
<pippijn> oh
<gasche> but I don't really like that
<pippijn> hmm
<pippijn> I don't object to that idea
<gasche> something we could consider is to have a header/body separation, as in say yacc/menhir
<pippijn> why don't you like it?
<gasche> some new declarative language, then %%, then tags as usual
<gasche> well
<gasche> the semantics of _tags is well-defined: it applies tags conditionally to some targets
<pippijn> ah, yes
<gasche> putting in this file global information that is not tag-related feels wrong
<pippijn> makes sense
<pippijn> I don't like the %% stuff
<pippijn> for the reason you just explained
<gasche> (my personal criterion for whether something should go in _tags is whether it makes sense to apply it to some targets only, or whether its very semantics is naturally global or already conditional)
<pippijn> hmm
<pippijn> actually
<gasche> (eg. I don't think a cflags(foo) tag would make sense, because "cflags" already embodies a conditional meaning that is not tag-related)
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
<pippijn> target-specific plugins do make sense
<pippijn> but are probably not easy to implement in the current ocamlbuild code
<pippijn> remember the conflict issue
<pippijn> if you have one directory where fooprog needs to run to get .ml from .foo
<pippijn> and another directory that needs foobarprog
<gasche> you can write a plugin such that the precise program to be called is the parameter of a parametric tag
<pippijn> you could load fooprog plugin in one directory, and foobarprog in another
<pippijn> no, that's not what I mean
<pippijn> I mean: you write a fooprog, and a .foo -> .ml rule
<gasche> I see what you mean
<pippijn> and I write a foobarprog, and a .foo -> .ml rule
<pippijn> they are in conflict
<gasche> but indeed I don't know how to have rules applied conditionally to some subtargets only
<pippijn> right
<pippijn> because myocamlbuild is global
<gasche> yes
<pippijn> that's a bit poor
<gasche> I agree, but currently a lot of things are higher priority that trying to change that
<pippijn> yes
<pippijn> and I imagine that change would be non-trivial
IbnFirnas has joined #ocaml
<gasche> kerneis: if you manage to get a good comprehension of some piece of code in ocamlbuild, patches to add comments are welcome
<kerneis> ok
<kerneis> gasche: what does for-pack do?
<gasche> as a compilation option for the OCaml compiler itself?
<kerneis> ah, I thought it was only an ocamlbuild flag
<gasche> -for-pack blah marks the resulting .cmo as intended for packing into a larger module Blah
<kerneis> ok
<kerneis> this is not done automatically when you write mlpack files
osa1 has joined #ocaml
<kerneis> is it?
<gasche> I don't know, but I would suppose it is
<kerneis> looks like it doesn't
<gasche> hm
<gasche> you're right, it doesn't, as documented in http://brion.inria.fr/gallium/index.php/Ocamlbuild_and_module_packs
<gasche> hm
<kerneis> this is so wrong
<kerneis> my next question was about mlpack taking the transitive closure or not, but I guess I'll stop here
<gasche> we could probably add the for-pack argument when going through a .mlpack file
<gasche> but it means that "ocamlbuild foo.cmx" and building Foo from bar.mlpack wouldn't produce the same result
<kerneis> yes
<gasche> (if the we don't have an explicit for-pack(bar) on Foo)
<kerneis> and also, does ocamlbuild cache the tags?
<pippijn> gasche: no
<pippijn> that would be garbage
<pippijn> that wouldn't work at all
<pippijn> .mlpack should implicitly add for-pack
<kerneis> we would need a target .pack.cmx
<pippijn> and ocamlbuild foo.cmx would simply make a for-pack'd module
<kerneis> hmm, no
<gasche> pippijn: but you cannot guess that foo.cmx is meant for inclusion in bar.mlpack without reading bar.mlpack
<pippijn> kerneis: it would need to be a .for-pack(Bar).cmx or so
<pippijn> gasche: ah
<pippijn> right
<kerneis> indeed
<pippijn> and it won't read that unless instructed
<gasche> I think having for-pack implicitly added would work, in the sense that foo.cmx would be recompiled with the right options
<kerneis> hence my .pack.P.cmx proposal
osa1 has quit [Ping timeout: 240 seconds]
<gasche> well
<kerneis> so ugly
<gasche> I'm not very happy with the .foo.bar targets
<gasche> they raise more problems than they solve
<kerneis> neither am I
<pippijn> I use that way in obuild
<pippijn> .pic.o and .o
<gasche> I prefer "ocamlbuild -tag debug foo.cmx" to "ocamlbuild foo.d.cmx"
<pippijn> hm
<pippijn> yes
<pippijn> with debug, that makes sense
<gasche> I agree that ocamlbuild -tag "for-pack(blah)" foo.cmx wouldn't make sense
<pippijn> but in my opinion, "ocamlbuild everything..." should be able to build everything
<kerneis> the fact that cmxa and cma take the transitive closure, but that mllib does not violates principle of least surprise
<pippijn> all the foos in and out of packs
<kerneis> it's as if the former is a shortcut for your convenience
<kerneis> and the latter the "all manual, expert" version
<gasche> I agree
<kerneis> but then, there is no easy way to build a cma/cmxa packing several cmo without figuring out their deps by hand
<kerneis> and when I say packing, I mean grouping in fact
<gasche> hm
<kerneis> then, mlpack add another layer of surprises, with for-pack()
<gasche> to be fair, the reason why for-pack is needed is itself a compatibility hack that doesn't make anyone's life easy
<kerneis> is there really a single use-case where you want an mllib *not* pulling the transitive closure?
<kerneis> for people in this situation, they can write their own myocamlbuild
<kerneis> with ocaml_lib
<kerneis> but I think mllib should do "the right thing" by default
<kerneis> okay, my ideal world would be this:
<Kakadu> If I have an algebraic datatype and do many matching expressions Can tagging/untagging be a performace issue? What can I read about that?
<gasche> Kakadu: I don't think it can
<kerneis> 1/ mllib -> cma and mllib -> cmxa, with transitive closure of listed modules
<gasche> the non-transitive-closure should be reserved to mldylib
<kerneis> 2/ mldylib -> cms and mldylib -> cmxs, without transitive closure
<kerneis> (yeah, I know cms doesn't exist)
<kerneis> (it would be just like cma)
<gasche> indeed
<kerneis> 3/ with that in place, my patch for ml -> mllib and ml -> mldylib works automagically
<pippijn> why is for-pack needed?
<kerneis> 4/ people with very very special need (cmxa without transitive closure) write their own myocamlbuild
<pippijn> why can't ocamlc translate the module names appropriately?
<pippijn> ok, I can imagine many reasons for that..
<kerneis> 5/ mlpack -> apply for-pack automagically (no idea how)
<gasche> pippijn: ocamlc can, ocamlopt cannot on platforms that do not distribute a good binutils
<gasche> that is, MacOS (and possibly Windows)
<pippijn> oh
<gasche> -for-pack is stricly a native issue
<pippijn> I see
<kerneis> 6/ mlpack -> mllib and mlpack -> mldylib rule, with precedence over ml -> ml*lib
<kerneis> (easy, I have a patch for this)
<gasche> why would you want mlpack -> ml*lib?
<kerneis> 7/ I'm done, shall I open a ticket? :-)
<kerneis> gasche: to get rid of cmx -> cmxs rule
<pippijn> oh
<gasche> but cmxs doesn't use .mlpack, does it?
<pippijn> why do you want to get rid of the cmx -> cmxs rule?
<pippijn> and how? can you build cmx and cmxs at the same time?
<kerneis> pippijn: because cmxs must be produced my mldylib
<gasche> pippijn: the idea is to go through the .ml{lib,dylib,pack} files each time, but implicitly generate them when they don't exist
<kerneis> pippijn: so I add a ml -> mldylib rule
<gasche> look at PR#5185 for the context
<kerneis> gasche: no, mlpack is not used for cmxs
<kerneis> but:
<kerneis> cmx -> cmxs has to go
<gasche> ah
<kerneis> the chain ml -> mldylib doesn't work here
<gasche> I see, there is no ml when there is a mlpack
<kerneis> or, if there is one, mlpack has the priority
<kerneis> (just like an mllib has the priority over an ml)
<gasche> this itches wrongly
<kerneis> (but whereas having a.ml and a.mllib is ok in most cases, having a.ml and a.mlpack looks really really odd)
<kerneis> (so it shouldn't happen very often)
<kerneis> (I hope)
<gasche> the original point of .cmo -> .mllib was to avoid any priority considerations, except "use the file if present in the source directory"
<gasche> (so no priority between two rules)
<gasche> you're reintroducing priorities here
<gasche> you could apply the same treatment than we did, that is
<gasche> ml -> mlpack and mlpack -> mllib | mldylib
<kerneis> aaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhh
<kerneis> why not, yes
<gasche> I suspect that this means that moving from cmo -> mllib to ml -> mllib was not such a good idea after all
<kerneis> the difference is that the rule mlpack -> mllib cannot fail
thomasga1 has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<kerneis> but I get your point
<kerneis> btw, ml -> mlpack is simply not possible
<gasche> I assumed that lifting along the axis ml -> cmo was safe as all modules are manifested by a .ml files, but .mlpack is a counterexample
<gasche> -s
<kerneis> yeah
<kerneis> so let's remove all these .d.cmo, .p.cmx then (I know it's not possible)
<kerneis> (but
<kerneis> I really hate them)
<gasche> I have mixed feelings about ".mllib obviously should take the transitive closure"
<kerneis> yeah, so do I
osa1 has joined #ocaml
<gasche> we should at least cut from this closure all the modules that are provided by another .cma
<gasche> (I think this is already done)
<kerneis> hu?
<kerneis> if I have no mllib, and I build a.cma and b.cma which both depend on c.cmo, you expect c.cmo to be in only one of them?
<gasche> no
<kerneis> so I don't get your point
<gasche> I was saying the obvious thing that if A depends on B provided by lib1.cma, then a.cma should not include a compilation unit for the B module
<kerneis> ok
<gasche> (nor try to include lib1.cma as a whole as a substructure, which would work in bytecode but not in native)
<gasche> note that with .cmo -> .mllib we can compute the transitive closure (we need to for backwards-compatibility in fact)
<kerneis> yes
<gasche> and that in the general case we can fire a warning if a transitively-needed module is not mentioned in .mllib, warning silencable by a tag
osa1 has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
<gasche> but I suspect finding about the transitive closure in .cmo -> .mllib will be longer to implement than you planned to, kerneis
<kerneis> yeah, I'll give up on that right now
<kerneis> and come back to it in a few weeks I think
<kerneis> with a fresh mind
<Kakadu> what should I write in _tags to pass -S option to ocamlopt? `ocamlbuild -use-ocamlfind -cflags -S TestHack.native` doesn't help me
<Kakadu> true: S doesn't help too
<gasche> kerneis: if you just read the code around caml_transitive_closure and link_gen, link_modules, I think now would be a good time to write a few comments explaining what they do
<gasche> I'll happily include them upstream
<Kakadu> TT
Neros has quit [Ping timeout: 248 seconds]
hyperboreean has quit [Read error: Operation timed out]
hyperboreean has joined #ocaml
smondet has joined #ocaml
osa1 has joined #ocaml
Yoric has joined #ocaml
yacks has quit [Read error: Operation timed out]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 264 seconds]
travisbrady has joined #ocaml
wwilly has joined #ocaml
<wwilly> bonjour
darkf has quit [Quit: Leaving]
introom has quit [Remote host closed the connection]
PM has quit [Ping timeout: 264 seconds]
<gasche> kerneis: what about a target foo.inferred.mllib?
PM has joined #ocaml
<gasche> I think that could solve our dilemma
tlockney has quit [Excess Flood]
<gasche> we'd keep both .mllib and .mldylib strict in their listing of modules
<gasche> but let users get the complete closure (re)computed for their convenience with .inferred.mllib
tlockney has joined #ocaml
tane has joined #ocaml
wwilly has quit [Quit: This computer has gone to sleep]
introom has joined #ocaml
osa1__ has joined #ocaml
osa1__ is now known as osa1
osa1_ has quit [Ping timeout: 245 seconds]
tlockney has left #ocaml []
hkBst has quit [Quit: Konversation terminated!]
yacks has joined #ocaml
dsheets has joined #ocaml
travisbrady has quit [Quit: travisbrady]
mort___ has joined #ocaml
watermind has joined #ocaml
<watermind> are tuples always evaluated right to left?
<watermind> or is it implementation dependent?
skchrko has quit [Quit: Leaving]
<ggole> The manual says order of evaluation is undefined, iirc.
<kerneis> gasche: that would definitely make sens
travisbrady has joined #ocaml
<gasche> watermind: it is implementation depend, and may change in practice depending on whether you use the bytecode or native compiler
<gasche> (I know one of the unspecified orders (arguments, tuples, let-and...) does change, but I'm very careful to forget which one, as it keeps me honest on the others as well)
Arsenik has joined #ocaml
introom has quit [Remote host closed the connection]
<kerneis> gasche: I noticed today that trunk allows me to have several types with the same constructor
ygrek has joined #ocaml
<kerneis> like type t = A | B; type u = A of int | B of float ;
<kerneis> are you aware of it? is it really a new feature (as opposed to a strange bug)?
<gasche> it is indeed a new feature
<gasche> it has been discussed to death
<gasche> ask Leo White
walter has quit [Quit: This computer has gone to sleep]
<kerneis> oh, I just didn't follow the discussion
<kerneis> thanks
<gasche> it's possibly around the time of your PhD defense
<kerneis> quite precisely indeed :-)
<gasche> a good time to live under a rock
<jpdeplaix> does someone knows how to build in parallel with ocamlbuild ? Or first is it working ? I heard it's in progress.
mort___ has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 276 seconds]
gnuvince- has joined #ocaml
<mrvn> doesn't work too well unless you have mli files
Kakadu has quit [Quit: Konversation terminated!]
<kerneis> you can always try ocamlbuild -j and see if it speeds things up for you
<watermind> gasche: I see, thanks!
<jpdeplaix> kerneis: it doesn't seems to :/
Anarchos has joined #ocaml
ollehar has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
<jpdeplaix> does someone has already done an OASIS plugin ?
<jpdeplaix> s/does someone has already/has somebody/
ollehar has quit [Ping timeout: 245 seconds]
<mrvn> somebody has for sure
<jpdeplaix> -_- Sorry for my bad English, but someone _in the channel_ would be great :/
morolin has quit [Ping timeout: 240 seconds]
zpe has quit [Remote host closed the connection]
dsheets has joined #ocaml
chambart has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
morolin has joined #ocaml
ggole has quit []
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
<orbitz> Froc is cool, but i feel like the Rx model doesn't warp your brain as much. But i'm guessing they are the same thing in the end
<def-lkb_> Rx?
troydm has joined #ocaml
chrisdotcode has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
ollehar has joined #ocaml
gnuvince- has quit [Changing host]
gnuvince- has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Client Quit]
wwilly has joined #ocaml
Snark has quit [Ping timeout: 264 seconds]
Snark has joined #ocaml
Nahra has quit [Read error: Operation timed out]
mort___ has joined #ocaml
<orbitz> def-lkb_: Rx isthe C# (and copied in other languages) FRP library from Erik Meijer
<def-lkb_> ok, interesting, thanks
<orbitz> the difference is it is more like you subscribe to a stream of values rather than just being a calculation
<fds> I'm trying to adapt this tutorial to propositional logic: http://brion.inria.fr/gallium/index.php/OCaml_code_generation_tutorial and I'm stuck at what to replace the $flo:s$ bits with to represent booleans. I've looked at http://caml.inria.fr/pub/old_caml_site/camlp4/manual/manual010.html#toc36 but I can't see anything likely.
<fds> Perhaps I should note (if it's not obvious) that I don't really know what I'm doing and I'm just trying to learn stuff as I go along.
<fds> Maybe I just want <:expr< true >> and <:expr< false >>?
mort___ has quit [Quit: Leaving.]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
<thomasga> fds: or <:expr< True >> and <:expr< False >> if you use the revised syntax inside quotations (as it's usually the case)
Yoric has joined #ocaml
Arsenik has quit [Remote host closed the connection]
Yoric has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
<fds> thomasga: Hrm, well, at the moment I'm using the original syntax, since that's what he has in the tutorial. I think I'm closer to getting something working, but now I have "Error: The type of this expression, '_a formula Camlp4.PreCast.Gram.Entry.t, contains type variables that cannot be generalized". Do you think it's worth pastebinning my code here?
<thomasga> don't have much time to help you know unfortunately
<thomasga> (sorry)
thomasga has quit [Quit: Leaving.]
<fds> ...Too late, but thanks anyway. :-)
thomasga has joined #ocaml
<fds> thomasga: I understand; thanks anyway.
_andre has quit [Quit: leaving]
djcoin has quit [Quit: WeeChat 0.4.0]
tlockney has joined #ocaml
mort___ has joined #ocaml
manud has joined #ocaml
wwilly has quit [Quit: This computer has gone to sleep]
mort___ has quit [Quit: Leaving.]
joostvb has quit [Ping timeout: 246 seconds]
joostvb has joined #ocaml
joostvb is now known as Guest76158
vpm has quit [Ping timeout: 246 seconds]
Snark has quit [Quit: leaving]
ollehar has quit [Ping timeout: 264 seconds]
vpm has joined #ocaml
<gasche> fds: still have your camlp4 problem?
<gasche> the "contains type variables that cannot be generalized" probably means that you have an unused grammar entry lying around
q66 has quit [Quit: Leaving]
q66 has joined #ocaml
Neros has quit [Ping timeout: 276 seconds]
contempt has quit [Ping timeout: 240 seconds]
pango has quit [Remote host closed the connection]
contempt has joined #ocaml
travisbrady has quit [Quit: travisbrady]
pango has joined #ocaml
Simn has quit [Quit: Leaving]
<whitequark> can I disable a warning using ocamlbuild tags?
<whitequark> pippijn: ping
PM has quit [Ping timeout: 246 seconds]
belaid has joined #ocaml
<pippijn> whitequark: pong
<pippijn> hmm
smondet has quit [Quit: gotta go home]
<pippijn> odd
<whitequark> oh ?
<pippijn> not you
Anarchos has quit [Quit: time to sleep , l'heure du dodo , eur mont da kousk]
<pippijn> neither clahub nor travis did anything with your pull request
<pippijn> I guess travis didn't, because it can't be automatically merged
<pippijn> but clahub doesn't work, either
<pippijn> so it seems clahub isn't really working
PM has joined #ocaml
belaid has quit [Quit: Quitte]
belaid has joined #ocaml
belaid has quit [Client Quit]
<whitequark> pippijn: ok
<whitequark> something about the PR itself?
frankjeager has joined #ocaml
frankjeager has quit [Read error: Connection reset by peer]
<pippijn> whitequark: seems fine
<pippijn> what actually changed?
<whitequark> I added Libmerr.mlpack
<pippijn> ok
<pippijn> me too
<pippijn> about a month ago
<whitequark> oh
<whitequark> that's really weird
<whitequark> because it's not in my tree...
frankjeager has joined #ocaml
<whitequark> also, Error: File libmerr/levenshtein.cmx
<whitequark> was not compiled with the `-for-pack Libmerr.Libmerr' option
<pippijn> ok
<pippijn> it worked for me :)
<pippijn> as you can see from the travis build
frankjeager has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
<whitequark> so, I had to move libmerr.mlpack to the root
<pippijn> I'm not really happy with 3 _tags files
<whitequark> hm
<pippijn> whitequark: I'll merge it
<whitequark> pippijn: wait
<whitequark> I rebase it on top of your tree
<pippijn> ok
<whitequark> talking about _tags files. according to Jane Street this is a sort of best practice
<pippijn> fine
<whitequark> I find it very clear
<pippijn> do it then :)
<whitequark> ok
<pippijn> it's just that I don't really use ocamlbuild
<pippijn> I'm using obuild
<pippijn> so littering the tree with lots of small files isn't nice
<pippijn> but, fine
<whitequark> well, you do have OMakefiles in each directory ?
<pippijn> yes
<whitequark> I've also updated the PR
<pippijn> that's also not so nice
<pippijn> but omake is scoped
<pippijn> so it makes a lot of sense to do that
<whitequark> I see
<pippijn> ok, good
<pippijn> travis still doesn't do anything.. weird
<pippijn> ah it does
<pippijn> it will probably fail
<whitequark> interesting
<pippijn> I had to do ocamlbuild -use-ocamlfind merr/merr.native merr/merr.byte after merging your changes
<pippijn> instead of merr.native
<whitequark> oh
<pippijn> that's ok, I'll change the travis config
<pippijn> whitequark: merged
<pippijn> whitequark: the whitespace change is out?
<whitequark> pippijn: I sort of lost it while rebasing
<pippijn> oh
<whitequark> figured it wasn't so important anyway
<pippijn> and there was a myocamlbuild.ml comment change
<pippijn> ok
<whitequark> oh, right, I remember that
<whitequark> remove the second sentence from line 48, it's not true anymore
<pippijn> you can do it
<pippijn> and I'll pull
<whitequark> ok
<pippijn> no need for a pull request
<whitequark> done
<pippijn> hm
<whitequark> oh. rebased it on top of your tree, and re-pushed.
<pippijn> ok
<pippijn> you were quick with that
<pippijn> I was going to cherry-pick it
<pippijn> then I found that it fast-forwarded on my second pull
<whitequark> nice, thanks
osa1 has quit [Quit: Konversation terminated!]
tianon has quit [Ping timeout: 248 seconds]
tianon has joined #ocaml