ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
agarwal1975 has joined #ocaml
rz has joined #ocaml
parcs_ has joined #ocaml
johnnydiabetic has quit [Ping timeout: 252 seconds]
tnguyen has quit [Ping timeout: 252 seconds]
johnnydiabetic has joined #ocaml
philtor has quit [Ping timeout: 276 seconds]
maattdd has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
shinnya has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
alpounet has joined #ocaml
alpounet has quit [Ping timeout: 276 seconds]
shinnya has quit [Ping timeout: 252 seconds]
brendan has joined #ocaml
eikke__ has quit [Ping timeout: 240 seconds]
johnnydiabetic has quit [Ping timeout: 264 seconds]
maattdd has quit [Ping timeout: 276 seconds]
eikke__ has joined #ocaml
iorivur has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
emmanueloga has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest74361
Guest74361 has quit [Ping timeout: 252 seconds]
eikke__ has quit [Ping timeout: 276 seconds]
pyon has joined #ocaml
dotfelix has joined #ocaml
huza has joined #ocaml
dotfelix has quit [Quit: Leaving]
dotfelix has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
emmanueloga has quit []
emmanueloga has joined #ocaml
dotfelix has quit [Quit: Leaving]
studybot_ has quit [Remote host closed the connection]
Eyyub has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
q66 has quit [Quit: Leaving]
ygrek has joined #ocaml
philtor_ has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest49641
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
Guest49641 has quit [Ping timeout: 264 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
shinnya has joined #ocaml
philtor_ has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 252 seconds]
yacks has quit [Quit: Leaving]
yacks has joined #ocaml
boogie has quit [Remote host closed the connection]
johnnydiabetic has joined #ocaml
ygrek has joined #ocaml
johnnydiabetic has quit [Client Quit]
philtor_ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
nk0 has joined #ocaml
nk0_ has quit [Remote host closed the connection]
philtor_ has quit [Ping timeout: 265 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest53627
Guest53627 has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 265 seconds]
_JokerDoom has quit [Read error: Connection reset by peer]
JokerDoom has joined #ocaml
divyanshu has quit [Ping timeout: 252 seconds]
divyanshu has joined #ocaml
philtor has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
<whitequark> I wonder if it's possible to write a bind for an error_or like type that propagates the *rest of possible variants*, not a single fixed error variant
philtor has quit [Ping timeout: 252 seconds]
<whitequark> something like val (>!=) : ([> `Ok of 'a ] as 'c) -> ('a -> [> `Ok of 'b ] as 'd) -> 'd = fun
axiles has joined #ocaml
<whitequark> hm, probably not, since it's not possible to say "all of 'c except `Ok
tlockney_away is now known as tlockney
<whitequark> mk270: you can also get rid of just parens, if you don't want to use pa_lwt
<whitequark> so, foo >>= fun () -> bar
<whitequark> it's still unwieldy
ollehar has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
strobegen has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 240 seconds]
darkf_ is now known as darkf
Gertm has joined #ocaml
racycle_ has quit [Quit: ZZZzzz…]
cesar_ has joined #ocaml
cesar_ is now known as Guest16068
Guest16068 has quit [Ping timeout: 245 seconds]
divyanshu has joined #ocaml
alpounet has joined #ocaml
tlockney is now known as tlockney_away
pgomes has joined #ocaml
Arsenik has joined #ocaml
tane has joined #ocaml
michael_lee has joined #ocaml
<def`> whitequark: you would need a more expressive row polymorphism. this is not possible in ocaml (but possible in theory)
<adrien> (and you can send your wishlist to def` :) )
divyanshu has quit [Quit: Computer has gone to sleep.]
<whitequark> def`: I wish that :p
<whitequark> seems not terribly complex to implement?
<adrien> my rule of thumb
<adrien> if it's not there it's because Jacques hasn't done it
<adrien> if Jacques hasn't done it ...
<adrien> :)
<whitequark> then what?
<adrien> you'll have to enslave def` for a couple years to get it
<adrien> or something like that
* adrien away to the swimming pool
<whitequark> def`: so
<whitequark> would you mind telling me your home address
<whitequark> it's for er... statistics. yes, statistics
<def`> :D
pgomes has quit [Ping timeout: 240 seconds]
pgomes has joined #ocaml
Kakadu has joined #ocaml
divyanshu has joined #ocaml
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
Submarine has joined #ocaml
alpounet has quit [Ping timeout: 240 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest77888
lopex has quit [Quit: Connection closed for inactivity]
Guest77888 has quit [Ping timeout: 240 seconds]
alpounet has joined #ocaml
fantasticsid has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
rand000 has joined #ocaml
huza has joined #ocaml
jlouis has quit [Ping timeout: 240 seconds]
Nuki has quit [Remote host closed the connection]
jlouis has joined #ocaml
Submarine has quit [Remote host closed the connection]
Thooms has joined #ocaml
pminten has joined #ocaml
Phill__ has quit [Quit: Leaving]
cesar_ has joined #ocaml
cesar_ is now known as Guest8851
Nuki has joined #ocaml
Guest8851 has quit [Ping timeout: 252 seconds]
eikke__ has joined #ocaml
divyanshu has joined #ocaml
q66 has joined #ocaml
eikke__ has quit [Ping timeout: 240 seconds]
eikke__ has joined #ocaml
morolin_ has quit [Ping timeout: 240 seconds]
mpmilano has quit [Ping timeout: 276 seconds]
morolin_ has joined #ocaml
q66 has quit [Ping timeout: 252 seconds]
pgomes has quit [Ping timeout: 276 seconds]
<whitequark> Drup: ping
<whitequark> what is the current state of installing C header files with OASIS?
<whitequark> and it seems that it stems from the fact that ocamlfind-installed headers aren't really namespaced
huza has quit [Ping timeout: 264 seconds]
mpmilano has joined #ocaml
q66 has joined #ocaml
pgomes has joined #ocaml
ontologiae has joined #ocaml
Submarine has joined #ocaml
huza has joined #ocaml
Eyyub has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
ygrek has joined #ocaml
studybot_ has joined #ocaml
eikke__ has quit [Ping timeout: 252 seconds]
eikke__ has joined #ocaml
maattdd has joined #ocaml
hhugo has joined #ocaml
eikke__ has quit [Ping timeout: 245 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest63732
Guest63732 has quit [Ping timeout: 276 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
fantasticsid has quit [Remote host closed the connection]
Thooms has joined #ocaml
Hannibal_Smith has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
huza has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
shinnya has joined #ocaml
Nuki has quit [Remote host closed the connection]
alpounet has quit [Remote host closed the connection]
strobegen1 has joined #ocaml
BitPuffin has joined #ocaml
strobegen has quit [Ping timeout: 252 seconds]
Nuki has joined #ocaml
ggole has joined #ocaml
ollehar has joined #ocaml
yacks has quit [Ping timeout: 276 seconds]
pveber has joined #ocaml
<Drup> whitequark: no idea. ping adrien ?
q66 has quit [Ping timeout: 252 seconds]
<orbitz> Ohh I think I'll wrap lsm up in ocaml, possibly with ctypes (seems easiest but performance overhead might be of concern...)
ygrek has joined #ocaml
<Drup> whitequark, adrien : actually, jacques has done it, with an intern. It was a bit invasive and there was multiple compromise (and it was not polished enough) so it was not integrated.
pminten has quit [Quit: Leaving]
hhugo has quit [Quit: Leaving.]
q66 has joined #ocaml
<whitequark> orbitz: there's cstubs
<whitequark> its build process is rather contrived but the perf overhead is almost same to manually written bindings
<whitequark> gasche is not here?!
darkf has quit [Quit: Leaving]
mrvn has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
maattdd has quit [Ping timeout: 252 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest71481
Guest71481 has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
yacks has joined #ocaml
racycle has joined #ocaml
martintrojer has quit [Ping timeout: 252 seconds]
<bernardofpc> Warning: tag "package" does not expect a parameter, but is used with parameter -> wtf ?
<bernardofpc> -package <package> (idem)
<whitequark> bernardofpc: ocamlbuild -use-ocamlfind
<pveber> maybe you forgot -use-ocamlfind when invoking ocamlbuild
<bernardofpc> oh
<bernardofpc> that's strange, though....
<bernardofpc> I mean, the error message is confusing
martintrojer has joined #ocaml
<bernardofpc> and why -package does not imply -use-ocamlfind, since it is equivalent to -pkg that says "Link to this ocaml findlib package" ??
<whitequark> because the UI of ocamlbuild is kind of horrible
<whitequark> and actually more than UI, a lot of things about ocamlbuild are kind of horrible.
<pveber> #bernardofpc: ocamlbuild should have default support for ocamlfind but at the time it was written, I think ocamlfind was not as proeminent as today
<bernardofpc> is it reasonable to have -pkg and siblings imply -use-ocamlfind ?
<whitequark> I don't know, -package x implies a tag package(x)
<whitequark> and I think ocamlbuild can't switch ocamlfind mode based on a tag
<bernardofpc> in other words: is there a way of using -pkg without ocamlfind ?
<pveber> no, unless you write your own myocamlbuildplugin.ml, which is a lot more complicated
<pveber> but why not using ocamlfind?
<bernardofpc> well, if some command-line option can only be used if another one is given, it is clear to me that the first implies the second
<bernardofpc> as many other CLI tools do
<bernardofpc> I have nothing agains using ocmlafind, but this error message is confusing and useless
alpounet has joined #ocaml
<bernardofpc> if I understand you correctly, this can be corrected by making -pkg imply -use-ocamlfind in ocamlbuild's option parsing
<pveber> sure it is. If it's not already there, maybe you can file a bug in mantis?
alpounet has quit [Ping timeout: 264 seconds]
johnnydiabetic has joined #ocaml
pyon has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
alpounet has joined #ocaml
inf-groupoid has joined #ocaml
tnguyen has joined #ocaml
bjorkintosh has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
demonimin_ has quit [Ping timeout: 240 seconds]
johnnydiabetic has quit [Ping timeout: 240 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest97407
Guest97407 has quit [Ping timeout: 252 seconds]
Eyyub has quit [Ping timeout: 260 seconds]
divyanshu has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
Eyyub has joined #ocaml
Hannibal_Smith has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
divyanshu has joined #ocaml
avsm has joined #ocaml
pgomes has quit [Quit: Leaving]
eikke__ has joined #ocaml
avsm has quit [Client Quit]
<companion_cube> whitequark: a friend of mine told me "Thomas W Sederberg and Scott R Parry. Comparison of three curve intersection algorithms" was good for bezier curves
Gertm has left #ocaml ["WeeChat 0.4.3"]
demonimin has joined #ocaml
mcclurmc has joined #ocaml
agarwal1975 has joined #ocaml
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
eikke__ has quit [Ping timeout: 252 seconds]
philtor has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
cesar_ has joined #ocaml
cesar_ is now known as Guest12127
ygrek has quit [Ping timeout: 265 seconds]
agarwal1975 has quit [Quit: agarwal1975]
ontologiae has joined #ocaml
Guest12127 has quit [Ping timeout: 255 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
alpounet has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
<Arthur_Rainbow> Hi
<companion_cube> hi
<Arthur_Rainbow> Never mind, writting down the question, I found the answer
<companion_cube> :)
<Arthur_Rainbow> companion_cube: love your nickname
<companion_cube> thanks!
<companion_cube> what was your question about, out of curiosity?
<Arthur_Rainbow> how to write down in a .mli file
<Arthur_Rainbow> Module m : Make.S with type elt = int
<Arthur_Rainbow> Module M : Make.S with type elt = int
<Arthur_Rainbow> Module M : Map.S with type elt = int
klrr_ has joined #ocaml
<Arthur_Rainbow> Module M : Map.S with type key = int
<Arthur_Rainbow> Ok, last once was correct (I should have copied/pasted)
<klrr_> how similar is ocaml to sml?
<Arthur_Rainbow> But now I've got another question.
<ggole> Fairly. There's a page comparing them if you are interested in the trivial changes.
<Arthur_Rainbow>
<Arthur_Rainbow> intMap.ml is :
<Arthur_Rainbow> module Comp = struct type t = int let compare = (-) end
<Arthur_Rainbow> module M = Map.Make(Comp)
<Arthur_Rainbow> include M
<Arthur_Rainbow> How can I write intMap.mli
<Arthur_Rainbow> I would like something like "include M" but by itself it doesn't work
<klrr_> why im wondering is because im currently reading "Compiling with continuations" and it uses sml, but OCaml seems like a much more used language so if its possible i rather learn it than sml
<companion_cube> Arthur_Rainbow: you may try include Map.S with type key = int
<companion_cube> or something like this
<companion_cube> klrr_: apart from minor syntactic differences, SML is roughly isomorphic to a subset of OCaml
<companion_cube> (the subset without "O" or recent additions)
<ggole> Arthur_Rainbow: btw, you don't need to name all the intermediate bits
<ggole> module IntMap : sig include Map.S with type key = int end = struct include Map.Make(struct type t = int let compare = (-) end) end
<klrr_> companion_cube: okey, that sounds good
<companion_cube> as gasche pointed out, (-) isn't actually a good int comparator because of overflows
<companion_cube> you should use let compare i j = Pervasives.compare i j
<companion_cube> (I hope that is compiled properly into int comparison)
agarwal1975 has joined #ocaml
<whitequark> companion_cube: let compare (i:int) j = ...
<companion_cube> hmm right
<companion_cube> it looks like it works on a small file
<ggole> companion_cube: that's a polymorphic function: the signature only refines the type from 'a -> 'a -> int to int -> int -> int, it doesn't affect the implementation :(
<companion_cube> it uses "ocaml_int_compare"
<Arthur_Rainbow> companion_cube: it works, thank you :)
<companion_cube> ggole: if you specialize it seems to work
<companion_cube> Arthur_Rainbow: cool! :)
<ggole> By specialise do you mean let compare (a:int) b = compare a b?
<ggole> (Because that should work.)
<companion_cube> yes
<ggole> I don't get why it generates a C call, though
<companion_cube> :(
<Arthur_Rainbow> ggole: thanks for the information
<Arthur_Rainbow> Now, I just have to figure out why the algorithm I wrote, which is supposed to be in n log(n); appears to have an exponential time execution time when I mesure it
<ggole> Profile!
Kakadu has quit [Quit: Konversation terminated!]
<whitequark> not enough memoization?
<ggole> ...or trace with printf, which is usually easier
Kakadu has joined #ocaml
<whitequark> not if you use prof!
<whitequark> errr
<whitequark> perf
<ggole> perf is cool
<companion_cube> Arthur_Rainbow: just a guess, you may unecessarily duplicate work (evaluating several times the same expression)?
<Arthur_Rainbow> I've memoized some thing (that's why I've intMap in fact)
<companion_cube> I usually choose a hashtable for memoization, since it's imperative anyway
Submarine has quit [Remote host closed the connection]
<Arthur_Rainbow> I probably will
<companion_cube> still, there must be a problem
<companion_cube> which algorithm are you implementing?
<Arthur_Rainbow> Mine
<companion_cube> oh
<Arthur_Rainbow> I'm a phd student
<companion_cube> what does it do? :)
<Arthur_Rainbow> It takes a finite automaton reading tuples of integers and return a first order formula using < and mod predicates that describe the set of integers accepted by the automaton
Submarine has joined #ocaml
<Arthur_Rainbow> Oh, Bonjour M. Monniaux
<Arthur_Rainbow> or "Hi Submarine " I don't really know
<Arthur_Rainbow> or if such a formula doesn't exists, it explains why.
* companion_cube should setup his irc client so that Submarine appears in yellow
<Arthur_Rainbow> :)
<adrien> :D
* adrien checks the day: sunday, weekend, noone is working
<companion_cube> Arthur_Rainbow: ok, I see why you need memoization, for not duplicating the formula (and possibly fresh identifiers)
<adrien> (except students of course, but definitely not teachers)
<companion_cube> so you can use perf, as ggole said, or printf, or also take a look at the GC usage
<whitequark> weekends are for pussies
<Arthur_Rainbow> Well, I mostly know Submarine by his blog that I read since years
<companion_cube> not everyone has infinite energy, whitequark >:=
<Arthur_Rainbow> companion_cube: I do use the memoization for the formula indeed (hashconsing in fact)
<Arthur_Rainbow> but mostly to have equality in constant time (indeed, with hashconsing I only need the equality of the pointer)
<companion_cube> Arthur_Rainbow: ok, let me ask a question: how do you hash the formulas?
<Arthur_Rainbow> companion_cube: do you know what hash-consing is ?
<companion_cube> indeed
<Submarine> Arthur_Rainbow, How interesting that you mention hash-consing.
<companion_cube> and you need to be careful not to hash the whole subformula
<companion_cube> there is a paper about generic hashconsing in OCaml that can interest you btw
<Submarine> from Filliâtre?
<companion_cube> by Jean-Christophe Filliâtre and others
<companion_cube> yes
<Arthur_Rainbow> I was M. Filliatre student and I did an internship with him, so by luck I know his class
<Arthur_Rainbow> his module
<companion_cube> oh, nice
<Submarine> furthermore there was a paper by T. Braibant, JH Jourdan and myself about how to talk about hash consing in Coq
<Submarine> the answer is: it's awkward
<companion_cube> Submarine: you mean how to represent hashconsing in coq? :D
<companion_cube> sounds more specific
<Submarine> sort of
<Arthur_Rainbow> companion_cube: of course I don't, I use the hash that is associated with the hash-consed value
<Arthur_Rainbow> that's why hashing is constant time
<companion_cube> Arthur_Rainbow: ok, I was just checking ^^
<companion_cube> well then you probably need to profile
<Arthur_Rainbow> You're totally right, I indeed made the mistake first, before correcting it
<Arthur_Rainbow> In my favor, I must state my first two result are about "exp exp exp ... exp n" algorithm and an indecidability result. Which may explain why I'm not really used to program
<companion_cube> don't worry about that, programming is the easiest (although lengthy) part
<Arthur_Rainbow> Submarine: Jacques-Henry was a classmate, Ulm 08
<Arthur_Rainbow> I also had a paper with him, (hence, I just learned or distance is two)
<companion_cube> the world is small...
slash^ has joined #ocaml
<Arthur_Rainbow> By the way, I saw your answer to my comment, and wasn't able to answer your question, to write it down the contradiction I see
<Submarine> actually, I start to wonder whether it's useful to insert unique identifiers in hash-consed values, or whether one can just use their hashes recursively
<companion_cube> isn't the unique identifier used to compute that hash efficiently?
<companion_cube> (also it's good for providing a total order)
<Arthur_Rainbow> companion_cube: there is an identifier and an hashed value
<Submarine> companion_cube, indeed the unique id can provide a total order
<Submarine> but in order to compute the hash of a node, one can use the hash of the sub-nodes
<companion_cube> Submarine: but that would recurse down to the leaves
<Submarine> (context: after hash-consing in Caml and Coq, I did it in Java)
<Submarine> companion_cube, no, one just stores the hash value in the node
<companion_cube> oh, ok
<Submarine> this is, I think, a good idea so as to avoid recomputing it
<companion_cube> sure
<Submarine> which might happen at every hash table resizing
klrr_ has left #ocaml [#ocaml]
<companion_cube> that might be another possibility
<companion_cube> I'd really like someone (wink wink nicoo) to write a hash combinators library, I'm tired of bad hash functions
<Arthur_Rainbow> You shouldn't use the tag (unique id) to hash, because the tag is "n" if it's the nth value added in the hash table; hence it may change
<companion_cube> how could it change?
<Arthur_Rainbow> It use weak hash table (at least for Filliatre's module)
<companion_cube> ah, it may change if the element is lost, GC'd and then built again
<companion_cube> but that's no big deal
<companion_cube> because if the hash changes, every term that used the old version is also dead
<companion_cube> otherwise the old version wouldn't be
<Arthur_Rainbow> Makes sens, ok
<ggole> Interesting how close hashconsing is to value numbering.
<companion_cube> hashconsing is such a good technique
<companion_cube> Arthur_Rainbow: anyway, take a look at the GC stats
<Arthur_Rainbow> companion_cube: I've no idea how to do it
<Arthur_Rainbow> but anyway, I highly doubt this is the problem
<Arthur_Rainbow> Probably hidden somewhere else in the 4.5k lines of code
<companion_cube> hmm don't underestimate the influence of the GC
<ggole> Again: profile
<companion_cube> and +1 for ggole
<companion_cube> ggole: is "perf record foo" then "perf report" a good way to use perf?
<ggole> Well, it gives you information pretty fast
NoNNaN has quit [Remote host closed the connection]
<Arthur_Rainbow> ggole: I need to learn how to profile, but I guess I'll do it
<Arthur_Rainbow> but first, I've got a suspicion of where the problem may be, and take a look at that first
<companion_cube> ggole: is there any resource about using perf with OCaml properly?
<companion_cube> every time I try it looks like the sum of percentages is well under 100% (same with prof), that some functions aren't mentioned... and looking directly at assembly is tough :s
<ggole> Hmm, I'm not aware of something like that specifically for OCaml (but I haven't looked).
NoNNaN has joined #ocaml
avsm has joined #ocaml
<Arthur_Rainbow> ggole: or someone else, would you have any resource for me to read, to learn about profiling ?
<companion_cube> I don't know enough on the topic either, sadly :s
<ggole> Arthur_Rainbow: the manual has a section on using ocamlprof
<ggole> It's a bit clumsy, but works well enough
<adrien> isn't that bytecode?
<ggole> Should be fine for tracking down which code is executing too many times.
<adrien> build with -p, run, have it exit normally, use gprof
<companion_cube> I found gprof not to be very accurate :/
<companion_cube> and sometimes it displays huge "cycles"
<ggole> Hmm, perf tells me that caml_modify is 6% of runtime :/
* ggole looks at all of his mutable data structures and feels bad
<companion_cube> it's weird, for me the highest function is at 8%, then 4%, 3%, 2%...
<companion_cube> it goes quickly under 1%, so the sum can't reach 100%
<companion_cube> ggole: :D
<Arthur_Rainbow> Never hear of ocamlprof, thank you
<Arthur_Rainbow> companion_cube: at least, that's good news, the sequence converge :)
<companion_cube> heh
<companion_cube> looks like unification and hashconsing are the costliest functions in my case
agarwal1975 has quit [Quit: agarwal1975]
struktured has quit [Ping timeout: 265 seconds]
jpeeters has left #ocaml [#ocaml]
cesar_ has joined #ocaml
cesar_ is now known as Guest75756
Anarchos has quit [Ping timeout: 240 seconds]
agarwal1975 has joined #ocaml
Guest75756 has quit [Ping timeout: 240 seconds]
michael_lee has quit [Quit: Ex-Chat]
rgrinberg has joined #ocaml
ontologiae has joined #ocaml
<Submarine> companion_cube, I suggest using oprofile
<Submarine> companion_cube, I used to profile Astrée using oprofile
<companion_cube> is it a frontend to perf?
<adrien> no
<Submarine> Arthur_Rainbow, oh you want the hash value to be reproducible from one run to another?
<adrien> perf is only part of the picture
<Submarine> companion_cube, oprofile is a linux tool that uses a kernel-module to sample the profile
<adrien> I mean, it shows only part of it
<Submarine> companion_cube, in contrast to gprof which needs special instrumentation from the compiler
<Submarine> companion_cube, when I used oprofile on Astrée I discovered that we spent a lot of time in
<Submarine> 1) the garbage collector
<Submarine> 2) the polymorphic Pervasives.compare function
<companion_cube> classic ^^
ontologiae has quit [Ping timeout: 240 seconds]
<ggole> It really is slow :(
<Submarine> 1) was due to memory settings which, at the time, were a bit obsolete - meant for machines with little memory.
<Submarine> I largely fixed it by enlarging the minor heap.
<Submarine> 2) was fixed by using a specific comparison function
ThatTreeOverTher has joined #ocaml
<Submarine> ggole, yes, hash consing is sort of global value numbering
<ThatTreeOverTher> Hey guys, I'm getting a syntax error and don't know why: http://pastebin.ca/raw/2789186
<companion_cube> Submarine: is there an introduction to oprofile you'd recommand?
<companion_cube> ThatTreeOverTher: did you enable the camlp4 extension for streams?
<ThatTreeOverTher> companion_cube, isn't that what the "<*.{byte,native}>: use_camlp4, pp(camlp4of)" line in _tags (line 4) is supposed to do?
<companion_cube> probably
tlockney_away is now known as tlockney
<companion_cube> sorry I can't help you on this, I never used this syntax extension :(
slash^ has quit [Read error: Connection reset by peer]
ontologiae has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
ontologiae has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
Nuki has quit [Ping timeout: 255 seconds]
<Arthur_Rainbow> Array.make d x is in O(d) I guess, right ?
<ggole> Yep
axiles has quit [Remote host closed the connection]
philtor_ has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
alpounet has joined #ocaml
philtor_ has quit [Ping timeout: 276 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
<Arthur_Rainbow> ggole: thanks. Then the creation of some array has been memoized :)
<Arthur_Rainbow> What I find strange is that I fight with an algorithm supposed to be quasilinear, while the second part is a mix of factorial and expontial I never know how to compute
<Arthur_Rainbow> (on the other hand, I almost never use the second part)
<ggole> Er, can you do that (soundly)?
<ggole> Are you using them as immutable vectors?
<Arthur_Rainbow> Yeah
<ggole> Ah, no problem then.
<Arthur_Rainbow> I need O(1) access, but once the array is made, I don't change it
<companion_cube> you may want to write/use a wrapper that hides array and only provide read operations
<Arthur_Rainbow> Why that ?
<Arthur_Rainbow> I mean, I doubt it would improve the computation time at all
<Arthur_Rainbow> and contrary to C where I could write "x = y" instead of "x==y", there is no rik in ocaml
<mrvn> Arthur_Rainbow: you add a term for the extra costs you spend/gain to each operation and then show that the extra term cancels out.
<mrvn> Arthur_Rainbow: you would wrap the array to prevent accidental writes
<ggole> The intent of the code might be made more clear by using a different type.
hhugo has joined #ocaml
<ggole> Although you would lose the nice a.(i) syntax.
<mrvn> ggole: you can overload that
<Arthur_Rainbow> Well, in fact, I already did a wrapper. I just didn't realise it was one
<Arthur_Rainbow> because I have a special use for some array of integer, and I often need the sum of its element
<Arthur_Rainbow> so its a wrapper, as a type (int array *int)
<companion_cube> Arthur_Rainbow: for safety, I meant
Thooms has joined #ocaml
ontologiae has joined #ocaml
tobiasBora has joined #ocaml
rand000 has quit [Quit: leaving]
<tobiasBora> Does anyone knows if it is possible to define in Oasis it's own environment varibles ? (I would like to include them in other files by using FilesAB)
Kakadu has quit [Quit: Konversation terminated!]
<tobiasBora> (How impolite I am... I forgot the traditional "Hello !")
Nuki has joined #ocaml
struktured has joined #ocaml
tane has quit [Quit: Verlassend]
<companion_cube> tobiasBora: no idea, sorry :s
avsm has quit [Quit: Leaving.]
<tobiasBora> companion_cube: Ok thank you
rgrinberg has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest54991
WraithM has joined #ocaml
Guest54991 has quit [Ping timeout: 252 seconds]
hhugo has quit [Quit: Leaving.]
ggole has quit []
Arsenik has quit [Remote host closed the connection]
alpounet has quit [Remote host closed the connection]
hhugo has joined #ocaml
Submarine has quit [Quit: Leaving]
agarwal1975 has joined #ocaml
agarwal1975 has quit [Client Quit]
agarwal1975 has joined #ocaml
agarwal1975 has quit [Client Quit]
<Drup> Arthur_Rainbow, others : if you're using perf, don't forget to use the +fp switch in opam
<Drup> it will add callgraph informations
<Drup> (at the cost of a ~5% performance penalty)
<Arthur_Rainbow> opam ?
<Drup> a package manager for ocaml, that also allows to switch compiler easily
<Arthur_Rainbow> I use ocamlbuild to compile, I don't know opam
<Drup> ocamlbuild is a build system, not really related
shinnya has joined #ocaml
<Arthur_Rainbow> One day, I'll learn how to program
<Arthur_Rainbow> May be.
<Drup> typical phd :D
agarwal1975 has joined #ocaml
<Drup> you might realize that if you learn the tooling, it will make your life easier, but heh, that's up to you ;)
<Arthur_Rainbow> Drup: I learn, little by little. Indeed
Thooms has quit [Read error: No route to host]
<Arthur_Rainbow> I just never thought I would spend so much time programming. I've spent 2 years with latex only
hato11 has joined #ocaml
<hato11> hello!
<hato11> is it possible to retrieve GC statistics from an ocaml program?
<companion_cube> yes it is! use Gc.stat()
frankbro has joined #ocaml
Eyyub has quit [Read error: No route to host]
<hato11> great! thank you :)
tnguyen has quit [Ping timeout: 245 seconds]
pveber has quit [Ping timeout: 240 seconds]
hhugo has quit [Quit: Leaving.]
tlockney is now known as tlockney_away
eikke__ has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
hhugo has joined #ocaml
hhugo has quit [Client Quit]
darkf has joined #ocaml
hato11 has quit [Quit: Page closed]
frankbro has left #ocaml ["But no matter how many fish in the sea, it'd be so empty without me.... "]
cesar_ has joined #ocaml
cesar_ is now known as Guest61023
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
hhugo has joined #ocaml
Guest61023 has quit [Ping timeout: 255 seconds]
Simn has quit [Quit: Leaving]
JokerDoom has quit [Ping timeout: 252 seconds]
hhugo has quit [Quit: Leaving.]
tobiasBora has quit [Quit: Konversation terminated!]
<ThatTreeOverTher> can anyone explain to me how to use the camlp4 parser? it doesn't seem to be working for me
<Drup> the camlp4 parser ?
<ThatTreeOverTher> Like at the bottom of http://llvm.org/docs/tutorial/OCamlLangImpl2.html
<Drup> so, you are talking about the camlp4 syntax extension for streams ?
<ThatTreeOverTher> sure? I don't quite know, just that it doesn't work
<ThatTreeOverTher> the character that my program errors on is the |
<ThatTreeOverTher> which leads me to believe it doesn't understand whatever extension this is
<Drup> for which file ? :)
<ThatTreeOverTher> oh right haven't put the pastebin link, lemme find it
<ThatTreeOverTher> http://pastebin.ca/2789488
<Drup> and you have a parse error on line 18, I presume ?
<ThatTreeOverTher> yeah
maattdd has joined #ocaml
<Drup> how do you compile it ?
<ThatTreeOverTher> ocamlbuild -use-ocamlfind -package llvm dropletc.native
<ThatTreeOverTher> where the file is called dropletc.ml
<Drup> something like "-syntax camlp4o" should make it work
<ThatTreeOverTher> the incantation `ocamlbuild -use-ocamlfind -package llvm -syntax camlp4o dropletc.native` returns ocamlfind: Using -syntax, but no package is selected specifying a preprocessor as required for -syntax
<Drup> ThatTreeOverTher: I have it working with "true : camlp4o" in tags_
alpounet has joined #ocaml
<Drup> btw, except if you are using oasis, you shouldn't have those "use_" in your _tags
<Drup> use "package(foo)"
<ThatTreeOverTher> I am using oasis
<ThatTreeOverTher> and it works! thank you!
<Drup> btw
boogie has joined #ocaml
<Drup> if you want to define a parser, except if you really want to write the parser by yourself, I would advice to use a parser generator
<Drup> (namely, ocamlyacc or menhir)
<ThatTreeOverTher> it's likely gonna be a really tiny parser but thanks, i'll keep that in mind if it ever ends up growing
racycl___ has joined #ocaml
<Drup> even if it's tiny, a parser generator is still a better option most of the time ;)
alpounet has quit [Ping timeout: 252 seconds]
racycle has quit [Ping timeout: 260 seconds]
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
maattdd has quit [Ping timeout: 276 seconds]
ontologiae has quit [Ping timeout: 252 seconds]