<iris1>
Dear experts, I have run into what I hope is a minor problem. I am trying to use maps and have been successful in doing stuff like "module M = Map.Make (struct type t = ... let compare = ... end);;" However, when I try to use a previously existing module instead of the struct, I get a syntax error. Specifically, the String module defines a type t and a function compare, but when I do "module M = Map.Make String;;", I get "Error: Syntax err
<iris1>
What am I doing wrong? Thank you!
thelema_ has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
<jderque>
iris1: try "module M = Map.Make(String)"
<pdhborges>
Map.Make(String)
edwin has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
eikke has joined #ocaml
ikaros has joined #ocaml
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
vivanov has joined #ocaml
ikaros has joined #ocaml
douknoukem has joined #ocaml
<douknoukem>
hello
<douknoukem>
how can i see if a function works on n^2 or n log n
<iris1>
jderque, pdhborges: That works! Thank you very much!!
<pdhborges>
douknoukem: show us the function
<douknoukem>
well i thought there was some kind of operation to do
douknoukem has quit [Read error: Connection reset by peer]
<edwin>
the lwt one is something I just wrote after reading the manual today, so may not be the best example
douknoukem has joined #ocaml
<edwin>
some advice on benchmarking: turn off CPU freq scaling, it is bad for latency measurement (like 150us instead of 40us)
<edwin>
and well the lwt one is cheating a bit as it is actually sending data inside the same process
ymasory has joined #ocaml
<edwin>
I should probably fork
<edwin>
and run the s1 and s2 lines in separate processes
<rproust>
forking with Lwt is tricky
<rproust>
you have to fork before you actually start the scheduller
<rproust>
and I'm not sure of the exact version the forking support was added to Lwt
<rproust>
(IIRC, the problem is that Lwt uses a few pipes internally and forking messes it up…)
rwmjones has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
ankit9 has joined #ocaml
zorun has quit [Ping timeout: 252 seconds]
bzzbzz has quit [Quit: leaving]
philtor has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
alpounet has joined #ocaml
vivanov has quit [Ping timeout: 240 seconds]
philtor has quit [Ping timeout: 276 seconds]
zorun has joined #ocaml
Snark has quit [Quit: Ex-Chat]
Cyanure has joined #ocaml
jld has quit [Ping timeout: 260 seconds]
Tianon has quit [Ping timeout: 264 seconds]
impy has joined #ocaml
Associat0r has quit [Ping timeout: 240 seconds]
eikke has quit [Ping timeout: 276 seconds]
impy has quit [Quit: impy]
pdhborges has joined #ocaml
impy has joined #ocaml
yezariaely has joined #ocaml
<pdhborges>
edwin: hi, I was away when you talked about zeromq could you elaborate your point?
yezariaely has left #ocaml []
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Associat0r has joined #ocaml
<flux>
rproust, I'd think such forking problems would be fixable, possibly with the assistance of close on exec -flag
<flux>
hmm, actually, right, it's close on exec, not close on fork :)
<edwin>
pdhborges: zeromq is great as a concept and API, and probably very good for throughput. Its not that good for low latency message passing (that is probably because it must use an I/O thread even for IPC over unix sockets). Therefore I think it might be an interesting project to write a zeromq-like ocaml module implemented using LWT, and not just direct binding to the C impl.of zeromq
<flux>
but at least it could provide its own variety of fork, if it doesn't already
<edwin>
pdhborges: best I could get from zeromq is 40us (by default it is ~45us, but I replaced the socketpair in its mailbox by ypipe + eventfd, but there's just a limit on the performance you can get when dealing with an I/O thread. it introduces additional latency).
jld has joined #ocaml
<pdhborges>
edwin: but did you test the C api ?
<edwin>
yes I tested the C api, see my pastebin above
<edwin>
btw above testing is for REQ/REP sockets
<edwin>
for PUB/SUB there are no problems with zeromq, you can get millions of messages/second ;)
<edwin>
pdhborges: I think it should be possible to improve zeromq itself though, like use non-blocking send/recv directly on the unix socket for ipc://, instead of dispatching to I/O thread
ankit9 is now known as ankit9|zzz
<pdhborges>
edwin: would that zero mq like module compatible with other zmq clients?
<edwin>
if zeromq's wire proto on unix sockets is stable then yes
Associat0r has quit [Ping timeout: 240 seconds]
<pdhborges>
:| it woulb be nicer if zmq was fixex
<pdhborges>
fixed*
<pdhborges>
meanwhile the bindings need serious fixing but I'm swamped in work
<edwin>
oh I didn't try the zeromq ocaml bindings
<edwin>
there are two of them, which one is yours?
<pdhborges>
ocaml-zmq
<edwin>
whats wrong with it?
<pdhborges>
Exception info sucks
<pdhborges>
zero mq creashes when closing a socket or a context twice
<pdhborges>
(the crash comes from zeromq)
<pdhborges>
poll only supports zmq sockets
<pdhborges>
no zero copy api
<pdhborges>
no low level optimizations
Associat0r has joined #ocaml
Associat0r has quit [Ping timeout: 276 seconds]
lamawithonel has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
zorun has quit [Ping timeout: 276 seconds]
zorun has joined #ocaml
zorun_ has joined #ocaml
zorun has quit [Read error: Connection reset by peer]
DOUK has joined #ocaml
douknoukem has quit [Ping timeout: 240 seconds]
edwin has quit [Remote host closed the connection]
alexgordon has left #ocaml []
DimitryKakadu has quit [Remote host closed the connection]
Cyanure has quit [Ping timeout: 248 seconds]
nantralien has joined #ocaml
<nantralien>
how to save a toplevel session ?
ikaros has quit [Quit: Leave the magic to Houdini]
nantralien has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
zorun_ is now known as zorun
valross has joined #ocaml
<pdhborges>
nantralien you can use screen
Yoric1 has quit [Quit: Leaving.]
pdhborges has quit [Quit: Leaving.]
<mbac>
there's a linear correlation of -0.9613 between time and my weight
<mbac>
by 2013-03-02 i'll weigh 0 pounds
<mbac>
wait, wrong channe
<mbac>
l
Amorphous has quit [Ping timeout: 263 seconds]
Amorphous has joined #ocaml
impy has quit [Read error: Connection reset by peer]