mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
tty56_ has joined #ocaml
tty56 has quit [Read error: 110 (Connection timed out)]
[azoic] has joined #ocaml
psnively has quit [Excess Flood]
seafoodX has joined #ocaml
psnively has joined #ocaml
psnively has quit [Excess Flood]
psnively has joined #ocaml
[azoic] has left #ocaml []
schme` has quit [Connection timed out]
buluca has quit [Read error: 113 (No route to host)]
fremo has quit ["4.2..."]
smimou has quit ["bli"]
authentic has joined #ocaml
seafoodX has quit []
seafoodX has joined #ocaml
seafoodX has quit [Client Quit]
seafoodX has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
psnively has quit []
yminsky has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
yminsky has quit []
replore has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
joshcryer has joined #ocaml
[azoic] has joined #ocaml
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
ygrek has joined #ocaml
replore has quit [Read error: 110 (Connection timed out)]
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
love-pingoo has joined #ocaml
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
gim_ has joined #ocaml
gim has quit [Read error: 104 (Connection reset by peer)]
hagman has joined #ocaml
hagman has quit [Client Quit]
jonafan has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
b4taylor has joined #ocaml
<b4taylor> Can I generate C code with ocamlc/opt and not just C object files?
<flux-_> no
<flux-_> ocamlopt compiles directly to assembler
b4taylor has quit [Client Quit]
jonathanv has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
[azoic] has quit ["Leaving."]
ramki has joined #ocaml
schme has joined #ocaml
seafoodX has quit [Read error: 110 (Connection timed out)]
buluca has joined #ocaml
seafoodX has joined #ocaml
schme` has joined #ocaml
schme has quit [Read error: 110 (Connection timed out)]
schme`` has joined #ocaml
gim_ is now known as gim
schme` has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Abo-Marwan14 has quit [Read error: 104 (Connection reset by peer)]
screwt840 has quit [Read error: 104 (Connection reset by peer)]
buluca has quit [Read error: 113 (No route to host)]
Abo-Marwan14 has joined #ocaml
screwt840 has joined #ocaml
Tetsuo has joined #ocaml
Tetsuo has quit [Remote closed the connection]
Tetsuo has joined #ocaml
Tetsuo has quit [Remote closed the connection]
Tetsuo has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
hsuh has joined #ocaml
Tetsuo has quit ["Leaving"]
seafoodX has quit []
Tetsuo has joined #ocaml
Demitar has joined #ocaml
buluca has joined #ocaml
hsuh has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
ygrek has quit [Remote closed the connection]
[azoic] has joined #ocaml
pango has quit [Remote closed the connection]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
[azoic] has quit ["Leaving."]
hsuh has joined #ocaml
<hsuh> Hi! I know this is a linux question, but anyway... i have this working example of sockets where a server receives one msg from a client, prints it, and then exits. Then i tried inserting a while loop to receive (and print) multiple msgs. The question is: what part of the code i need to repeat? only the Unix.recv? (or also the bind, listen, accept commands)
<jonafan> probably just the recv
<jonafan> unless you mean to accept messages from more clients
<hsuh> no, same client.
<jonafan> then you just need the recv
<hsuh> i get this error repeating the recv
<jonafan> ?
<hsuh> Received: (hi)
<hsuh> Fatal error: exception Unix.Unix_error(56, "recv", "")
<hsuh> receives the first msg ok then instead of waiting for more, gives this error
<jonafan> okay i don't know what that means
<hsuh> ok, tks anyway
<hsuh> Do you know where I can find the listing for those errors? (56 for example)
<flux-_> hsuh, that's error ENOBUFS.. looks strange to me!
<flux-_> you can get the value with magic: (Obj.magic 56 : Unix.error)
<hsuh> ok. i more or less found out whats wrong... the client closes the socket
<hsuh> (and thats intended behavior)
kelaouchi has quit [Read error: 110 (Connection timed out)]
<hsuh> flux-_: for me its another error, because i'm on windows ;)
<hsuh> ECONNRESET
Demitar has quit [Connection timed out]
buluc1 has joined #ocaml
kelaouchi has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
buluca has quit [Remote closed the connection]
buluc1 has quit [Read error: 110 (Connection timed out)]
kelaouch1 has joined #ocaml
buluca has joined #ocaml
ygrek has joined #ocaml
hsuh has quit [Remote closed the connection]
kelaouchi has quit [Read error: 110 (Connection timed out)]
kelaouchi has joined #ocaml
kelaouch1 has quit [Read error: 110 (Connection timed out)]
diakopter has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
buluc1 has joined #ocaml
kig has joined #ocaml
buluc1 is now known as buluca
bluestorm__ has joined #ocaml
Jedai has joined #ocaml
fritte has joined #ocaml
Torment has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
jonathanv has joined #ocaml
bluestorm__ has quit [Remote closed the connection]
jonafan has quit [Read error: 110 (Connection timed out)]
Tetsuo has quit [Remote closed the connection]
Tetsuo has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
Abo-Marwan14 has quit [Remote closed the connection]
screwt840 has quit [Remote closed the connection]
kelaouchi has quit [Connection timed out]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
screwt840 has joined #ocaml
ygrek has quit [Remote closed the connection]
jlouis has quit ["brb"]
screwt840 has quit [Remote closed the connection]
jerbear has joined #ocaml
<jerbear> i've been looking at fp languages recently, but i don't know anyone who uses any of them... can someone explain to me what the advantage is over procedural languages?
Tetsuo has quit ["Leaving"]
kelaouchi has joined #ocaml
jerbear has left #ocaml []
Demitar has joined #ocaml
<kig> is there any easy way to read up to N bytes from a file?
<kig> what i'm doing now is http://pastie.caboo.se/105498
Hadaka has quit [Read error: 111 (Connection refused)]
buluca has joined #ocaml
joelr1 has joined #ocaml
<joelr1> good evening
<pango> kig: Pervasives.really_input?
<kig> pango: how does that handle End_of_file?
<kig> *tries*
<pango> hum, yes, according to documentation it should raise an exception... Not always nice
<kig> it'd need an input loop in the exception handler
<pango> Buffer;add_channel seems to have a similar behavior
<pango> s/;/./
<kig> what i'm really trying to do is run a regexp over a file as fast as possible, collect and count the matches
<pango> if it's line-oriented you could use input_line
<kig> yeah, i'll give it a go
<kig> now (with the input loop and 3MB block size), reading the 200MB file from page cache is 600ms, vs. 80ms in C
<kig> it's a silly thing to optimize, but i'm bored :>
<pango> OCaml breaks I/O in 16kB blocks, iirc
<pango> an strace should confirm
jlouis has joined #ocaml
<kig> ooh, it's faster than the big-block-version
<pango> thanks to read-ahead, it may better overlap I/O and matching?
<kig> 100ms faster read loop, 100ms faster Hashtbl fill + sort
<kig> i have no idea
<kig> aha
<kig> faster because i'm a retard
<kig> let read_block ic = (input_bytes ic 3000000) ^ (try input_line ic with End_of_file -> "");; <- how about not creating new 3M strings
<pango> and not copy them
<kig> hmm, need to do each block in two phases, first read the block, then seek backwards in block to last linebreak, concat that with input_line, process big block and last line
<kig> and use a global buffer and then it looks pretty much like the C code :>
<kig> and should run about as fast (200ms now without the ^)
<kig> or rather, return rindex \n from read_block and String.blit the rest to the start of buffer
thermoplyae has joined #ocaml
joelr1 has quit []
yminsky has joined #ocaml
Abo-Marwan14 has joined #ocaml
yminsky has quit []
Naked has joined #ocaml
Naked is now known as Hadaka
Mr_Awesome has joined #ocaml
screwt840 has joined #ocaml