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
<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]
<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.
<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
<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
<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
<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)
<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
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...
<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