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
Eyyub has quit [Ping timeout: 245 seconds]
struktured has quit [Remote host closed the connection]
struktured has joined #ocaml
dant3_ has joined #ocaml
jbrown has joined #ocaml
Eyyub has joined #ocaml
divyanshu has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
philtor_ has joined #ocaml
Eyyub has quit [Ping timeout: 240 seconds]
PM has quit [Ping timeout: 276 seconds]
Eyyub has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
typedlambda has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
PM has joined #ocaml
shinnya has joined #ocaml
racycle has quit [Quit: ZZZzzz…]
nikki93 has joined #ocaml
philtor_ has quit [Ping timeout: 245 seconds]
shinnya has quit [Ping timeout: 272 seconds]
nikki93 has quit [Ping timeout: 244 seconds]
claudiuc has quit [Remote host closed the connection]
shinnya has joined #ocaml
gnuvince- has joined #ocaml
gnuvince- has quit [Changing host]
gnuvince- has joined #ocaml
gnuvince- is now known as vfoley
penryu has quit [Ping timeout: 260 seconds]
runT1ME has quit [Quit: runT1ME]
penryu has joined #ocaml
SethTisue has joined #ocaml
Eyyub has quit [Ping timeout: 244 seconds]
<_habnabit> is there a way with Lwt to say "wait until all of these threads have terminated and give me their results"? effectively 'a Lwt.t list -> 'a list Lwt.t. Lwt.nchoose is close, but it doesn't wait for all threads to terminate
<Drup> _habnabit: unit
<Drup> grmbl
<Drup> Lwt.join
<_habnabit> Drup, i could construct something out of Lwt.join, but that's only for unit Lwt.t list
Eyyub has joined #ocaml
<Drup> _habnabit: you could use Lwt_list and map with the identity :p
<_habnabit> Drup, that's what i came up with
<Drup> too complicated :D
<Drup> "Lwt_list.map_p (fun x -> x)" should do the trick
tlockney_away is now known as tlockney
runT1ME has joined #ocaml
runT1ME has quit [Client Quit]
cesar_ has joined #ocaml
cesar_ is now known as Guest64027
runT1ME has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
runT1ME has quit [Quit: runT1ME]
philtor_ has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
nikki93 has joined #ocaml
typedlambda has joined #ocaml
Guest64027 has quit [Remote host closed the connection]
philtor_ has quit [Ping timeout: 240 seconds]
martinsk has quit [Quit: This computer has gone to sleep]
nikki93 has quit [Ping timeout: 264 seconds]
philtor_ has joined #ocaml
penryu has left #ocaml ["WeeChat 0.4.4-dev"]
q66 has quit [Quit: Leaving]
dant3_ has quit [Remote host closed the connection]
philtor_ has quit [Ping timeout: 255 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
<_habnabit> Drup, i wouldn't have known; Lwt_list is completely undocumented
divyanshu has joined #ocaml
struktured has joined #ocaml
<Drup> _habnabit: undocumented ? it's exactly the same function than in normal List with _p and _s, prefix which are, as indicated at the top of the module, explained it Lwt_stream
<Drup> I'm not sure what more documentation you want
johnnydiabetic has quit [Ping timeout: 252 seconds]
<smondet> Drup: maybe the behavior in case of exception?
PM has quit [Ping timeout: 276 seconds]
<smondet> (in the case of Lwt_list.map_p)
PM has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<Drup> hum, indeed, that would deserve documentation
<Drup> (I have no idea)
SethTisue has quit [Quit: SethTisue]
PM has quit [Ping timeout: 276 seconds]
nikki93 has joined #ocaml
johnnydiabetic has joined #ocaml
nikki93 has quit [Ping timeout: 252 seconds]
struktured has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
racycle has joined #ocaml
struktured has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
typedlambda has joined #ocaml
PM has joined #ocaml
dant3_ has joined #ocaml
dant3_ has quit [Ping timeout: 255 seconds]
johnnydiabetic has quit [Quit: Leaving]
vfoley has quit [Ping timeout: 240 seconds]
maattdd_ has quit [Ping timeout: 240 seconds]
struktured has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
venk has joined #ocaml
nikki93 has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: Leaving.]
axiles has joined #ocaml
dant3_ has joined #ocaml
dant3_ has quit [Read error: Connection reset by peer]
dant3_ has joined #ocaml
dant3_ has quit [Ping timeout: 252 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
ustunozgur has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
racycle has quit [Quit: ZZZzzz…]
philtor_ has joined #ocaml
ggole has joined #ocaml
dant3_ has joined #ocaml
rgrinberg has joined #ocaml
dant3_ has quit [Ping timeout: 255 seconds]
mal`` has quit [Ping timeout: 240 seconds]
mal`` has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
typedlambda has joined #ocaml
paolooo has joined #ocaml
philtor_ has quit [Ping timeout: 240 seconds]
manizzle has joined #ocaml
paolooo has quit [Ping timeout: 246 seconds]
nikki93 has joined #ocaml
studybot_ has joined #ocaml
nikki93 has quit [Ping timeout: 244 seconds]
studybo__ has joined #ocaml
BitPuffin has joined #ocaml
studybot_ has quit [Ping timeout: 264 seconds]
studybo__ has quit [Remote host closed the connection]
Kakadu has joined #ocaml
ygrek has joined #ocaml
dant3_ has joined #ocaml
dant3_ has quit [Ping timeout: 252 seconds]
huza has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
martinsk has joined #ocaml
divyanshu has joined #ocaml
rgrinberg has joined #ocaml
Eyyub has quit [Ping timeout: 272 seconds]
<BitPuffin> realworldocaml.org is down
<BitPuffin> who is responsible for this xD
<whitequark> node.js
nikki93 has joined #ocaml
<BitPuffin> that is not unlikely
<BitPuffin> however isn't the website hosted by github?
<BitPuffin> and github is a rails app last time I checked
<whitequark> nope, 50.97.232.128.in-addr.arpa name = ocaml-www1.ocamllabs.cl.cam.ac.uk.
<whitequark> and that host is down
nikki93 has quit [Ping timeout: 244 seconds]
<BitPuffin> dayumboih hax
<BitPuffin> but I have to read this weekend ;_;
<BitPuffin> like a lot
<BitPuffin> xD
<BitPuffin> maybe I can compile the book locally
mfp has quit [Read error: Connection reset by peer]
Eyyub has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
martinsk has quit [Quit: This computer has gone to sleep]
dant3_ has joined #ocaml
<BitPuffin> that'll work
<BitPuffin> thanks
<BitPuffin> is it up to date?
<whitequark> no clue
<BitPuffin> 4.01 at least
tlockney is now known as tlockney_away
rgrinberg has joined #ocaml
dant3_ has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
Arsenik has joined #ocaml
dant3_ has joined #ocaml
slash^ has joined #ocaml
lordkryss has joined #ocaml
dant3_ has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 255 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 272 seconds]
Eyyub has quit [Ping timeout: 245 seconds]
dant3_ has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
dant3_ has quit [Ping timeout: 245 seconds]
hhugo has joined #ocaml
venk has quit [Remote host closed the connection]
venk has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
lordkryss has quit [Read error: Connection reset by peer]
lordkryss has joined #ocaml
demonimin has quit [Ping timeout: 240 seconds]
<def`> /window 25
<def`> ...
rand000 has joined #ocaml
<adrien> Drup: Unix.file_descr: int
<adrien> and you can assume it fits in 31 bits
<adrien> Drup: :)
<adrien> erf, that was for def` ; I'm not smiling to Drup
<adrien> (not until he works for me for free)
demonimin has joined #ocaml
mfp_ has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
nikki93 has joined #ocaml
testcocoon has joined #ocaml
wwilly has joined #ocaml
ggole has quit [Ping timeout: 272 seconds]
nikki93 has quit [Ping timeout: 252 seconds]
araujo has quit [Quit: Leaving]
dant3_ has joined #ocaml
ggole has joined #ocaml
rand000 has quit [Quit: leaving]
dant3_ has quit [Ping timeout: 244 seconds]
pminten has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
Kakadu has joined #ocaml
divyanshu has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
jao has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
pminten_ has joined #ocaml
pminten has quit [Ping timeout: 244 seconds]
nikki93 has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
yacks has quit [Ping timeout: 252 seconds]
yacks has joined #ocaml
dant3_ has joined #ocaml
dant3_ has quit [Ping timeout: 252 seconds]
pminten_ has quit [Remote host closed the connection]
maattdd_ has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
avsm has quit [Client Quit]
lordkryss has quit [Read error: Connection reset by peer]
ikaros has joined #ocaml
lordkryss has joined #ocaml
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
jbrown has quit [Read error: Connection reset by peer]
nikki93 has quit [Ping timeout: 252 seconds]
alpounet has joined #ocaml
maattdd_ has joined #ocaml
q66 has joined #ocaml
dant3_ has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
dant3_ has quit [Ping timeout: 244 seconds]
pminten has joined #ocaml
maattdd_ has quit [Ping timeout: 240 seconds]
pminten has quit [Quit: Leaving]
BitPuffin has quit [Ping timeout: 264 seconds]
struktured has joined #ocaml
araujo has joined #ocaml
nikki93 has joined #ocaml
BitPuffin has joined #ocaml
nikki93 has quit [Ping timeout: 245 seconds]
dant3_ has joined #ocaml
maattdd_ has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
dant3_ has quit [Ping timeout: 264 seconds]
bjorkintosh has quit [Ping timeout: 240 seconds]
jbrown has joined #ocaml
shinnya has joined #ocaml
alpounet has quit [Remote host closed the connection]
lordkryss has quit [Ping timeout: 244 seconds]
alpounet has joined #ocaml
alpounet has quit [Read error: Connection reset by peer]
alpounet has joined #ocaml
ustunozgur has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
_5kg has quit [Ping timeout: 272 seconds]
SethTisue has joined #ocaml
SethTisue has quit [Client Quit]
SethTisue has joined #ocaml
vfoley has joined #ocaml
vfoley has joined #ocaml
vfoley has quit [Changing host]
<adrien> :)
dant3_ has joined #ocaml
<adrien> (I remember it because it's still in my list of stuff to read)
<gasche> I haven't been able to come much on IRC lately
<gasche> so indeed there was the risk of being scooped
<adrien> I know :P
<gasche> (also I'm reading my syndication feeds for the first time in a week)
<adrien> but I've been doing HTML, CSS and content for almost 8 hours so I'm feel like being a bit mean
dant3_ has quit [Ping timeout: 264 seconds]
lordkryss has joined #ocaml
darkf has quit [Quit: Leaving]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
lordkryss_ has joined #ocaml
lordkryss has quit [Ping timeout: 244 seconds]
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
tobiasBora has joined #ocaml
hhugo has quit [Quit: Leaving.]
alpounet has quit [Ping timeout: 252 seconds]
hhugo has joined #ocaml
dant3_ has joined #ocaml
dant3_ has quit [Read error: Connection reset by peer]
dant3_ has joined #ocaml
Hannibal_Smith has joined #ocaml
huza has joined #ocaml
dant3__ has joined #ocaml
dant3_ has quit [Read error: Connection reset by peer]
dant3__ has quit [Ping timeout: 240 seconds]
keen________ has quit [Read error: Connection reset by peer]
keen________ has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
<whitequark> gasche: adrien: yes, I've seen it
<whitequark> it pretty much invalidated what I have already written of the blog post :D
<whitequark> but in a good way; a backend is quite well possible now, rather than "maybe it'll work"
divyanshu has quit [Ping timeout: 240 seconds]
ustunozgur has quit [Remote host closed the connection]
martinsk has joined #ocaml
divyanshu has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
<ggole> Hmm, this new better behaved merlin is quite good
<def`> ggole: sorry I went away yesterday
<def`> how did you solve your problem?
dant3_ has joined #ocaml
<ggole> Rebuilt everything
<ggole> opam from source, opam switch 4.01.0, opam install blah blah blah
<adrien> unix' equivalent to windows' reboots
<def`> ok, just rebuilding :) fine
<ggole> The yak didn't seem to mind
<ggole> I'm still not sure what the original problem was: I pulled down merlin-master and ./configure went ok but make told me to run configure
<def`> we changed the build system slightly… If you made a previous built in the same directory, some leftover files may have confused it
<ggole> Not in the same directory, no
<ggole> I still had the old merlin sitting around under whatever directory (the outdated version of) opam puts it in
<def`> Then I don't know what happened :)
<ggole> Anyway, problem solved for now.
dant3_ has quit [Ping timeout: 245 seconds]
martinsk has quit [Quit: This computer has gone to sleep]
Moataz-E has joined #ocaml
philtor_ has joined #ocaml
Eyyub has joined #ocaml
alpounet has joined #ocaml
martinsk has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
martinsk has quit [Client Quit]
bjorkintosh has joined #ocaml
<jpdeplaix> whitequark: did you received my cc
<jpdeplaix> ?
<whitequark> yes
<jpdeplaix> ok
philtor_ has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Ex-Chat]
hhugo has quit [Quit: Leaving.]
racycle has joined #ocaml
ygrek has joined #ocaml
Moataz-E has quit [Quit: Leaving]
martinsk has joined #ocaml
<ggole> def`: hmm, finding definitions seems to be a bit sluggish. I stepped through a few things (on the emacs side) and it looks like merlin-rewind is being called every time because merlin-process-last-user is always nil.
<def`> ping asmanur
<def`> ggole: I don't know much about the emacs bindings, but we'll take a look at that
alpounet has quit [Read error: Connection reset by peer]
alpounet has joined #ocaml
sheijk has joined #ocaml
martinsk has quit [Quit: Leaving]
<ggole> merlin-process-last-user's docstring claims "only valid in a process buffer" but isn't accessed in that buffer within merlin-is-last-user-p
<ggole> I suspect that's the bug: let's see
<ggole> Hmm, that does happen, but fixing it doesn't change things much...
Eyyub has quit [Ping timeout: 252 seconds]
<orbitz> What do fun's looklike in gprof output?
maattdd_ has joined #ocaml
<orbitz> I have something like camlKnn_new__iter_1031
<Drup> then it's Knn.new_iter, probably
<orbitz> ah wit, that actually is the fun name
<orbitz> hat about
<orbitz> camlKnn_new__fun_1094
* Drup gain 5 experience points in divination.
<ggole> Those are the actual symbol names
<ggole> (OCaml numbers them because multiple bindings may have the same name.)
<Drup> orbitz: can't you tell ? :)
<orbitz> but 'fun' can't be a function anme, so hwo do I kow which fun it is? :)
<Drup> Knn.new_fun ?
<ggole> ...name it :E
<ggole> Or look at the assembly and see where it's being called from *cough*
<Drup> and yeah, name the anonymous functions.
<orbitz> it's Knn_new.blah btw :)
<Drup> ah !
<orbitz> I'm in someone elses code unfortuantely
<ggole> (I can't recall whether -dlambda contains the same numbers: if so, that might be easier to follow.)
dant3_ has joined #ocaml
<orbitz> Someoen posted ocaml vs java code online and I'm seeing if I can do anything to speed up the ocaml
<orbitz> Oh rust too
lordkryss_ has quit [Ping timeout: 244 seconds]
dant3_ has quit [Ping timeout: 252 seconds]
<def`> orbitz: where?
<ggole> Hmm, free variable warning in merlin.el too - looks like a cut'n'paste job gone wrong.
<ggole> Guess I should send some patches
<orbitz> I don't know much about performance tuning Ocaml
<orbitz> def`: i get ~12 seconds for my ocaml run, so I assume the java and rust are about the same on my machine
Arsenik has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
shinnya has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
<adrien> this code reminds me of something...
<adrien> it might already be the optimized version
BitPuffin has quit [Ping timeout: 244 seconds]
<orbitz> nah, it does all these maps
<orbitz> and wahtnot
<orbitz> the java versio ndoesn't
<adrien> that's only a small part of the total runtime iirc
<adrien> time the stuff roughly with printfs
<adrien> like
<adrien> parsing of input done
<adrien> stuff lik that
<adrien> closer to logging than debugging
martinsk has joined #ocaml
<def`> it's the optimized version
<def`> and file reading, even though not optimal, is negligible
<def`> on my computer, it takes 12 seconds, 3 for reading, 9 for computing distance
<martinsk> soo... dabbled a bit with ocaml... did my cs compiler course in sml - is it realy the case that I can't do pattern matching in function heads in ocaml?
<ggole> You could try to manually inline + lambda lift + type annotate so that classify doesn't build any closures, array_fold_left2 doesn't have to treat two different array layouts, etc
<ggole> Dunno if that would be worthwhile
<orbitz> so is the cost that arithmetic is just so expensive in ocaml?
<def`> no, I can't tell what is wrong
<ggole> martinsk: not sure what you mean by "function heads". You can do irrefutable pattern matching on arguments, or use the usual pattern for matching multiple arguments if that isn't enough (eg, let f x y = match x, y with ...)
<orbitz> as far as gprof says, all the time is spent in the 'iter' function
<orbitz> and under that the distance caluclaing funcitno
<orbitz> It's 6x slower than Java and Rust
<orbitz> seems too much
<sheijk> martinsk: you can write let foo = function 1 -> 0 | 2 -> 1 | ...
<Drup> orbitz: did you removed the float_of_int + sqrt at the end that is only in the ocaml version ?
<orbitz> i'll try
<martinsk> sheijk: that was exactly what I was thinking, but will "foo" be available inside the function?
<martinsk> sheijk: in other words, will foo be recursive?
Kakadu has quit [Quit: Page closed]
<ggole> orbitz: try moving len to an argument of iter, and ascribing a (concrete) type to the acc argument
<orbitz> ggole: it's an array though, isn't len cheap?
<ggole> That's not the problem: the problem is that len is a free variable in iter, causing a closure to be (uselessly) constructed
<martinsk> sheijk: I tried... the answer is no..
<martinsk> :(
<ggole> The concrete type is because if OCaml thinks the array is polymorphic, it will check on access to see if it is a float array
<orbitz> ggole: ah good to know, thanks
<ggole> orbitz: the argument trick is essentially manual lambda lifting.
<orbitz> (no difference so far)
<ggole> Hmm, let's see
<ggole> Urg, missing a .csv?
<ggole> Oh, it's in the source
<orbitz> so
<orbitz> the ocaml and java ones defintil ydon't do nearly the same thing
<orbitz> no sqrt line java, aslike Drup poitned out
<ggole> Failure("int_of_string")
<orbitz> ggole: did you modify the input code at all?
<ggole> Not yet
<orbitz> hrm
<orbitz> all the input works for me
<ggole> Does this contain values that wouldn't fit in a tagged 31-bit int?
<sheijk> martinsk: let rec foo ... to make it recursive
<martinsk> sheijk: I'm an idiot ;)
<sheijk> martinsk: maybe this is a good place to start http://ocaml.org/learn/tutorials/
<sheijk> hehe
<ggole> Does seem that's the case.
<orbitz> ggole: how'd you figure that out?
<orbitz> oh, are you on a 32 bit machine?
<orbitz> I'm running on a 64bit vm
<martinsk> on a scale ... any scale... how good is the "Real World Ocaml" book?
<ggole> I'm on a 64-bit machine, but running a 32-bit OS
<orbitz> ggole: ah
<orbitz> martinsk: I haven't read the whoel thing but found it not bad
Eyyub has joined #ocaml
<ggole> (I should reinstall, but I really can't be arsed to -_-)
<martinsk> orbitz
<def`> manually rewriting array_foldleft2 into for loop + ref got me to the same time as java
<orbitz> oh really?
<def`> as rust actually, I don't have java
<orbitz> so ~2 seconds
<def`> 3 on my computer
<orbitz> why is that? The guidance generally given in this channel is recursive fun should be faster than that
<def`> 3.3 for rust, 3.9 for ocaml
wwilly has quit [Quit: This computer has gone to sleep]
<Drup> def`: isn't the function tail rec ? it should be compiled pretty much the same, shouldn't it ?
<ggole> FWIW, this is the change I had in mind http://pastebin.com/pjC5Rh3N
<ggole> The closure argument will be called indirect, won't be inlined, etc
<martinsk> I read the "Elements of ML Programming, ML97 Edition" book... but my experience with books from O'reilly is that they are somewhat .. verbose
<def`> Drup: no idea, I didn't take a look at the generated code
<ggole> (That's what I got, anyway.)
<orbitz> def`: is that the only change you made? that cut 3 - 4 seconds off for me, so still over 10 seconds (original runtime ~15 seconds for me)
<ggole> Oh, I missed the function argument
<ggole> Should pass f into iter as well
<orbitz> I'm shocked changing to a ref is so much faster
<orbitz> goes against all I thought I knew!
philtor has joined #ocaml
dsheets has joined #ocaml
<def`> orbitz: refs not escaping are turned into local variables (in the best case, it's just a CPU register)
<ggole> Won't be as fast as the ref, either
<orbitz> oh nice\
dant3_ has joined #ocaml
<orbitz> the java version of the classify code doesn't use floats either
<def`> more or less the same as the java version
<ggole> Hmm, still allocates? What am I missing?
<def`> allocates what?
<ggole> Ah, polymorphism sneaked in and got me :(
<ggole> Polymorphic array access conditionally allocate (in 32-bit ocaml, at least)
<ggole> Because of the different shape of float and other arrays.
<orbitz> def`: how did you change classify too?
<def`> orbitz: yep, I rewrote all loops as for-loops
<ggole> (The code for that version is mostly saving and restoring around the call, sigh)
<orbitz> def`: what's classify look like now? because looks like yo ualso got rid of the dependence on floats
<def`> orbitz: right, i just removed sqrt
<orbitz> ggole: i see, so you're inlining everything to parameters
dant3_ has quit [Ping timeout: 244 seconds]
<ggole> Yep: if there's a free variable, it'll generate a closure
<orbitz> def`: but looks like you did more, beacuse the existing classify compalins about a type having float but expenting int
<ggole> The compiler should do it: but it doesn't
<ggole> (At least, not yet.)
<orbitz> so changing max_float to max_int, I get ~5 seconds
<orbitz> which is probably about right
<def`> I made different tests… That's weird, the hot loop compiled with -unsafe takes from 2.74 to 3.4 depending on … I don't know, I reordered a few things but didn't change this part.
<def`> (I ended measuring only the loop and not parsing)
<def`> parsing time*
<orbitz> so is there any takeaway here? Obviously I don't want to rewrite everything as for-loops in a real program, but it also seems unclear how to know when a for-loop + ref is faster than aregular recursive function
<orbitz> def`: thanks btw
philtor has quit [Ping timeout: 245 seconds]
<def`> orbitz: well, it depends on how often you have to traverse an array
philtor has joined #ocaml
<def`> with less linear data structures, such as trees, it's much less interesting to do that kind of rewriting
<def`> the remaning differences in performance can probably be explained by the less optimal code generator
<ggole> Profile and only target the hot spots
<def`> yeah, often, just having a sane architecture is enough to have decent performance (obviously less true with numeric code where the architecture is really simple)
pyon has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
<orbitz> ggole, def` thanks for teh lesson
<ggole> ocamlbuild: unknown option `-use-ocamlfind'. O_o
<ggole> What the hell
<ggole> orbitz: no problem
vfoley has quit [Ping timeout: 240 seconds]
demonimin has quit [Remote host closed the connection]
nikki93 has joined #ocaml
demonimin has joined #ocaml
<def`> ggole: do you have opam in PATH?
<def`> it might be an old system provided ocamlbuild
<def`> orbitz: np :)
<ggole> I have some opam junk in ~/.bashrc (and .profile)
<ggole> . /home/ggole/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
<ggole> And echo `which ocamlbuild` => /home/ggole/.opam/4.01.0/bin/ocamlbuild, which is what it should be afaict
* ggole a bit confused
Kakadu has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
nikki93 has quit [Remote host closed the connection]
hhugo has joined #ocaml
Eyyub has quit [Ping timeout: 245 seconds]
Eyyub has joined #ocaml
martinsk has quit [Quit: Leaving]
dant3_ has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
dant3_ has quit [Ping timeout: 272 seconds]
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
shinnya has joined #ocaml
BitPuffin has joined #ocaml
nikki93 has joined #ocaml
lordkryss has joined #ocaml
hhugo has quit [Quit: Leaving.]
SethTisue has quit [Quit: SethTisue]
vfoley has joined #ocaml
vfoley has joined #ocaml
vfoley has quit [Changing host]
tlockney_away is now known as tlockney
Eyyub has quit [Ping timeout: 245 seconds]
vfoley has quit [Remote host closed the connection]
vfoley has joined #ocaml
dant3_ has joined #ocaml
tane has joined #ocaml
dant3_ has quit [Ping timeout: 244 seconds]
alpounet has quit [Remote host closed the connection]
tobiasBora has quit [Ping timeout: 244 seconds]
tlockney is now known as tlockney_away
Eyyub has joined #ocaml
maattdd_ has joined #ocaml
racycle has quit [Quit: ZZZzzz…]
maattdd_ has quit [Ping timeout: 264 seconds]
vfoley has quit [Ping timeout: 245 seconds]
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Hannibal_Smith has joined #ocaml
rgrinberg has joined #ocaml
eizo has joined #ocaml
S1100100` has joined #ocaml
S11001001 has quit [Disconnected by services]
S1100100` is now known as S11001001
<nickmeharry> Quick question about recursive module definitions: http://pastebin.com/ifj5XFgt
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
<nickmeharry> I have two related but distinct modules living within one compilation unit. I have a common function that needs to refer to both, and be refered to by at least one of the two modules.
<mrvn> and the question is?
<nickmeharry> File "sample.ml", line 11, characters 16-23:
<nickmeharry> Error: Unbound module A_MOD
<nickmeharry> Is this even possible?
<nickmeharry> A_MOD is defined before COMMON_REC here, and contains no abstract components.
<flux> yes, A_MOD is a module type, not a module
<nickmeharry> s/components/types/
<mrvn> type t = A of AMOD.t | B of BMOD.t meeds to use A_mod.t
<nickmeharry> Right, but that's not defined at that point.
<nickmeharry> The explicit signatures are there to satisfy the recursive module definition.
<mrvn> and I think you can't predeclare the COMMON_REC, you need to do that inside the module rec
<nickmeharry> I'll try declaring that inline.
<mrvn> and A_mod.t, not A_MOD.t
<mrvn> Is B using utility? Looks like it could be taken out of the recursion
<nickmeharry> Not at the moment. I'll lift it out if it's still not using it after I finish implementing the real thing.
<nickmeharry> Anyways, that worked. Thanks!
<mrvn> you could also use type ('a, 'b) t in COMMON_REC
<mrvn> #or pass utility
<mrvn> as argument to something_using_utility
<mrvn> recursive modules get rather tedious.
<nickmeharry> Fortunately the common one isn't very big, and it's limited to the one compilation unit.
dant3_ has joined #ocaml
vfoley has joined #ocaml
vfoley has joined #ocaml
vfoley has quit [Changing host]
vfoley has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
S11001001 has quit [Quit: rebooting]
claudiuc has joined #ocaml
dant3_ has quit [Ping timeout: 240 seconds]
Arsenik has joined #ocaml
tobiasBora has joined #ocaml
philtor has joined #ocaml
Submarine has quit [Quit: Leaving]
oriba has joined #ocaml
eizo has quit [Ping timeout: 246 seconds]
philtor has quit [Ping timeout: 252 seconds]
WraithM has joined #ocaml
Asmadeus has quit [Changing host]
Asmadeus has joined #ocaml
S1100100` has joined #ocaml
isomorphismes has joined #ocaml
<isomorphismes> just watched yaron minsky's video about OCaml. Seems like a cool language
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
S1100100` is now known as S11001001`
S11001001` is now known as S11001001
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
ggole has quit []
typedlambda has quit [Ping timeout: 252 seconds]
typedlambda has joined #ocaml
axiles has quit [Remote host closed the connection]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
dant3_ has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
dant3_ has quit [Ping timeout: 252 seconds]
alpounet has joined #ocaml
wwilly has joined #ocaml
alpounet has quit [Ping timeout: 255 seconds]
<reynir> I'm trying to use ocamllex with menhir. I put a %parameter in the .mly file, but now I'm not sure how to refer to the tokens in the .mll file (cause they're inside a functor)
maattdd_ has joined #ocaml
Lutin` has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
<reynir> ah, I can use external tokens
Hannibal_Smith has quit [Quit: Sto andando via]
wwilly has quit [Quit: This computer has gone to sleep]
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 255 seconds]
alpounet has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
maattdd_ has joined #ocaml
Animal has joined #ocaml
tlockney_away is now known as tlockney
Simn has quit [Ping timeout: 240 seconds]
<reynir> now, how to do that nicely with ocamlbuild...
maattdd_ has quit [Ping timeout: 252 seconds]
Lutin` has quit [Ping timeout: 240 seconds]
<Drup> reynir: what is the issue ?
dant3_ has joined #ocaml
<def`> reynir: here is how we do this for merlin, https://github.com/the-lambda-church/merlin/blob/master/myocamlbuild.ml
tobiasBora has quit [Quit: Konversation terminated!]
<def`> although you could also parameterize the lexer by the same argument as the parser or by the parser itself
<reynir> Ah, I think the latter might make more sense. How would you do that with ocamllex?
<reynir> (sorry if I'm not making much sense - I'm a bit tired)
<def`> juste put "module Make (A : T) = struct" in the header and "end" in the footer
<reynir> thanks
<def`> … ocamllex is more-or-less just concatenating slice of the input files, inserting the automata in the middle. so if you enter and exit the functor appropriately, it should work fine
<def`> np
dant3_ has quit [Ping timeout: 264 seconds]
Eyyub has quit [Ping timeout: 264 seconds]
tani has joined #ocaml
alpounet has quit [Remote host closed the connection]
tlockney is now known as tlockney_away
Arsenik has quit [Remote host closed the connection]
alpounet has joined #ocaml
tane has quit [Ping timeout: 240 seconds]
Eyyub has joined #ocaml
alpounet has quit [Ping timeout: 252 seconds]
alpounet has joined #ocaml
Animal has quit [Quit: Verlassend]
Kakadu has quit [Quit: Konversation terminated!]
Eyyub has quit [Ping timeout: 245 seconds]
philtor has joined #ocaml
Eyyub has joined #ocaml
<reynir> thanks, I got it working
lordkryss has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz… Oh no wait i don't have a MBP, i just closed my client]
darkf has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
racycle has joined #ocaml
nikki93 has quit []
dant3_ has joined #ocaml
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
dant3_ has quit [Ping timeout: 245 seconds]
alpounet has quit [Ping timeout: 272 seconds]
ollehar has quit [Ping timeout: 244 seconds]
carleastlund has joined #ocaml
carleastlund has quit [Client Quit]
carleastlund has joined #ocaml
carleastlund has quit [Client Quit]
oriba has quit [Quit: Verlassend]
sheijk has quit [Quit: .]
madroach has quit [Ping timeout: 252 seconds]
ustunozgur has joined #ocaml
madroach has joined #ocaml
<reynir> where would one find the documentation for compiler-libs? My google-fu is weak tonight
ustunozgur has quit [Ping timeout: 252 seconds]
<Drup> compiler-libs is (on purpose) not documented a part from mli in the compiler sources
<Drup> s/a part/except/
<reynir> OK, thank you Drup
tani has quit [Quit: Verlassend]