gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
arubin has joined #ocaml
arquebus has joined #ocaml
arquebus has left #ocaml []
goncalo has quit [Read error: Connection reset by peer]
goncalo has joined #ocaml
lopex has quit []
joewilliams is now known as joewilliams_away
dnolen_ has joined #ocaml
arubin has quit [Quit: arubin]
clog has joined #ocaml
lopex has joined #ocaml
clog has joined #ocaml
* sgnb found comint-send-input
betta_y_omega has quit [Read error: Operation timed out]
betta_y_omega has joined #ocaml
munga has quit [Ping timeout: 264 seconds]
f[x] has quit [Ping timeout: 260 seconds]
dnolen_ has joined #ocaml
dnolen_ has quit [Client Quit]
dnolen_ has joined #ocaml
iratsu has quit [Ping timeout: 255 seconds]
iratsu has joined #ocaml
pdhborges has joined #ocaml
pdhborges has left #ocaml []
pdhborges has joined #ocaml
pdhborges has quit [Read error: Connection reset by peer]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx_ has joined #ocaml
munga has joined #ocaml
cthuluh has quit [Quit: .]
cthuluh has joined #ocaml
pdhborges has joined #ocaml
<pdhborges> Is anyone here familiar with ocaml's gc?
dnolen_ has quit [Quit: dnolen_]
<thelema> pdhborges: a bit, what's up?
<pdhborges> hi thelema
<pdhborges> I don't understand very well how threads interact with caml_local_roots and release_runtime_system
<hcarty> pdhborges: When you have time - what is the state of your zeromq bindings?
<thelema> ocaml threads or C/C++ threads?
<pdhborges> hcarty: I'll fix the bugs zmq 2 bindings
<pdhborges> thelema: ocaml threads
<pdhborges> hcarty: but I'm writting new ones for ocaml zmq 3
<hcarty> pdhborges: I haven't used your bindings yet, but I'm hoping to get a chance to try them out soon
<pdhborges> okay ^^
<hcarty> pdhborges: Ah! In that case, perhaps I'll wait for version 3.
<pdhborges> hcarty: in about 5 days I'll release the bindings for zmq 3
<pdhborges> they will be much simpler
<pdhborges> and closer to the original api
<pdhborges> thelema: ocaml threads
<pdhborges> the problem is
<thelema> pdhborges: I'm not familiar with release_runtime_system, but the model seems pretty straightforward - threads run one at a time, when the GC is running, no threads are running
<pdhborges> the param macros save the current local_root
<pdhborges> into the frame
<pdhborges> and return
<pdhborges> assigns the local roots to the frame
<pdhborges> the problem is
<pdhborges> what happens
<pdhborges> when a thread is preempted after releasing the lock
<pdhborges> another thread might add modify the local roots
<thelema> ah, ocaml threads aren't fully preemptive - they only context switch at designated places, such as at allocation.
<pdhborges> o
<thelema> it's possible for an ocaml thread to run long-living computational code and keep the CPU for a long time
<thelema> thus Thread.yield
iratsu has quit [Ping timeout: 255 seconds]
StepanKuzmin has joined #ocaml
<pdhborges> well in that case
* thelema tries to verify this online
<pdhborges> I'll have to totally rework my scenarios
cthuluh has quit [Ping timeout: 260 seconds]
<thelema> hmm, maybe I'm only correct for bytecode threads
<thelema> it seems native code threads use system threads, which are more than likely preemptive
<pdhborges> ok
<pdhborges> tl dr I don't understand how caml_local_roots are shared between threads
<pdhborges> I though each thread had one but then
Snark has joined #ocaml
<thelema> well, I guess all the uses of GC data are protected by locks so only one thread at a time can be in that critical section
<thelema> as the GC isn't concurrent
<pdhborges> that would make sense because I can't find any code that
<zsparks> Is there a way to print floats that doesn't use scientific notation?
<pdhborges> iterates the threads (struct)
<pdhborges> and traverses the local_roots
<zsparks> That is, that gets just the decimal with no "...e-05" or whatever?
<zsparks> or rather, getting a string out of it, not printing, sorry
<pdhborges> there is some code in interp.c that saves and restores local_root
<thelema> zsparks: sprintf "%.0f" 3.1415 -> "3"
munga has quit [Ping timeout: 264 seconds]
<zsparks> thelema: I still want the stuff after the decimal, too, though I think I get the idea
<zsparks> I want to be able to save it to a variable, though, not print it out
<pdhborges> but i can figure how does that fit in the grand scheme of things
cthuluh has joined #ocaml
<thelema> zsparks: sprintf returns a string
<zsparks> (if yo are guessing that ugly hacks involving the string representations of numbers are happening, you'd be right!)
<zsparks> thelema: ah, heh, shows you what I know. Thanks!
<thelema> zsparks: no problem
<hcarty> pdhborges: Will the zeromq 3 bindings be in the same github repository?
<pdhborges> hcarty: no, I created a new one
<pdhborges> but it's empty for now
f[x] has joined #ocaml
betta_y_omega has quit [Ping timeout: 250 seconds]
<hcarty> pdhborges: Ok. Thank you for the bindings and the information.
betta_y_omega has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
munga has joined #ocaml
f[x] has joined #ocaml
ankit9 has quit [Quit: Leaving]
iratsu has joined #ocaml
zsparks_ has joined #ocaml
zsparks_ is now known as zsporks
zsporks has quit [Client Quit]
zsparks_ has joined #ocaml
zsparks_ is now known as zsporks
lopex has quit []
spearalot has joined #ocaml
munga has quit [Ping timeout: 264 seconds]
ftrvxmtrx_ has quit [Quit: This computer has gone to sleep]
f[x] has quit [Ping timeout: 240 seconds]
todun has joined #ocaml
larhat has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
munga has joined #ocaml
halfr has joined #ocaml
joewilliams_away is now known as joewilliams
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
lopex has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
yezariaely has joined #ocaml
yezariaely has left #ocaml []
othiym23 has joined #ocaml
ftrvxmtrx has joined #ocaml
Cyanure has quit [Remote host closed the connection]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz_ is now known as ulfdoz
betta_y_omega has quit [Ping timeout: 255 seconds]
betta_y_omega has joined #ocaml
munga has quit [Ping timeout: 260 seconds]
todun has quit [Quit: :s]
ftrvxmtrx has quit [Quit: Leaving]
todun has joined #ocaml
chrissbx has joined #ocaml
f[x] has joined #ocaml
<chrissbx> Hello. I need to build a completely static binary of a program, meaning, one that also includes libc etc.; how do I do that?
iratsu has quit [Ping timeout: 252 seconds]
<chrissbx> Does ocamlopt link .o files itself without invoking ld? In any case, it doesn't take any -ldopt argument.
<thelema> -ccopt -static
<chrissbx> ah, thanks
yezariaely has joined #ocaml
yezariaely has left #ocaml []
f[x] has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
f[x] has joined #ocaml
Ptival has joined #ocaml
ygrek has joined #ocaml
ftrvxmtrx has joined #ocaml
chee1 has joined #ocaml
Snark has quit [Quit: Quitte]
bobry has quit [Quit: Leaving.]
<chee1> Does anybody know if some HBase bindings exist? I've googled and searched github and don't see any relevant projects.
bobry has joined #ocaml
<thelema> chee1: someone was working on ocaml thrift stuff...
<thelema> But I doubt direct bindings exist
<chee1> ok, thanks
<thelema> I think one could be created with the ocaml<->java interface
<chee1> I think I'll try writing some thrift/ocaml bindings for HBase. That ocaml/java pointer is interesting though.
eikke has quit [Ping timeout: 240 seconds]
thelema has quit [Read error: Operation timed out]
todun has quit [Quit: :s]
thelema has joined #ocaml
<chee1> Is there a way to see what modules an ocamlfind package exports?
<thelema> looking for .cmi files in `ocamlfind query <packagename>`?
todun has joined #ocaml
<flux> so, I don't feel this is a neat way to convert an enum into it's run-length-encoded variant: http://ocaml.nopaste.dk/p3654
<flux> how would I write that better?
<flux> especially the deal with `End is kludgy IMO
<chee1> thelema: thanks
<thelema> flux: Enum.group equal e |> map (fun e -> let c = Enum.count e in c,Enum.get e |> Option.get)
<flux> thelema, well, what if I wanted to combine consecutive elements in some other way than just count them?
* ygrek has that in .ocamlinit
<flux> well, I guess Enum.group will do there as well, at least if I have a decent equality oepration for them
<flux> thelema, thanks :)
pdhborges has quit [Read error: Connection reset by peer]
<thelema> flux: no problem. I have the feeling I just wrote this code in the last week, for some reason
pdhborges has joined #ocaml
<thelema> yup, I did...
<thelema> I went a bit crazy with the |>
<flux> thelema, hmm, what about the equality operator?
<flux> (function)
<flux> mine takes two arguments..
<thelema> what about it?
<flux> the one in batteries takes one
zsparks has quit [Quit: leaving]
<flux> Enum.group's first argument that is
<thelema> hmm, that's a wierd signature...
<thelema> oh yeah, because its a projection operator...
<thelema> you project your input values into some space where normal equality makes sense.
<thelema> the examples use wierd things like (x -> x mod 2) and (s -> s.[0])
<flux> so, I now call rle (=) e
<thelema> apparently my code using (=) is wrong, the correct thing to use is (fun x -> x) (i.e. identity)
todun has quit [Quit: :s]
<thelema> although (=) seems to work... can't explain that.
<thelema> or not...
<thelema> what equality function would you like to use?
<flux> for this case, regular binary equivalence
<thelema> then the first argument to Enum.group should be [identity]
<flux> identity is 'a -> 'a, right?
<flux> and my enumeration could be of type int Enum.t
<thelema> if you want to do some other equivalence that can be put in the form (fun x y -> (f x) = (f y)), then put f as the first arg
<thelema> yes, identity is 'a -> 'a
<flux> thelema, isn't that type ('a -> 'a -> bool)?
<flux> not ('a -> bool) ?
<thelema> yes, that's the type of the implied equal function for a function f
<flux> val group : ('a -> bool) -> 'a t -> 'a t t
<thelema> group should be ('a -> 'b) -> 'a t -> 'a t t
<flux> well, it's not in batteries 1.2.0 in debian unstable. fixed then?
<thelema> I could look up the commit, but it's fixed now.
todun has joined #ocaml
<flux> but the type of (fun x y -> (f x) = (f y)) isn't ('a -> 'b) either
<flux> actually
<flux> what should be the whole type? where does 'b go?
<thelema> correct, f is ('a -> 'b), and it implies the equality function f x = f y
<flux> ah, right, I misunderstood that
<thelema> The 'b is used for comparison only.
<flux> but I can see a problem if someone wants to group for instance an enumeration of Maps
<flux> first he needs to convert the map into a list.. (because two equal maps may have different equality)
<thelema> yup.
<thelema> group (Map.enum |> List.of_enum) ms
<thelema> err, |-
halfr has quit [Ping timeout: 276 seconds]
<thelema> oh yeah, there's also a Enum.group_by that takes the equality function directly, apparently added after 1.2 sometime
pdhborges has quit [Read error: Connection reset by peer]
halfr has joined #ocaml
<flux> ahha, figures why my functional version looked so ugly, those things use mutation beneath the surface 8-)
<thelema> yes, enums are evil.
<thelema> and we (try to) hide all the nasty parts under the surface
<thelema> otoh, your implementation is propely lazy, Enum.group is eager, iirc
<flux> I want to .group stdin etc as well
<thelema> flux: by character or line?
<flux> by character
<flux> actually by bit, but I already have characters
<flux> I'm decoding from a 433MHz radio receiver in hopes to hear my wireless thermometers :)
<thelema> IO.bytes_of stdin |> Enum.group ...
spearalot has quit [Quit: Computer has gone to sleep]
ymasory_ has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 240 seconds]
Modius has joined #ocaml
oriba has joined #ocaml
eikke has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
oriba has quit [Remote host closed the connection]
oriba has joined #ocaml
edwin has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
ztfw has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 246 seconds]
ymasory_ has quit [Quit: Leaving]
todun has quit [Quit: :s]
todun has joined #ocaml
lamawithonel has joined #ocaml
chee1 has quit [Quit: leaving]
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 264 seconds]
oriba_ has quit [Client Quit]
oriba has joined #ocaml
munga has joined #ocaml
dnolen_ has joined #ocaml
chee1 has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
Smerdyakov has joined #ocaml
avsm has joined #ocaml
munga has quit [Ping timeout: 258 seconds]
todun has quit [Remote host closed the connection]
todun has joined #ocaml
lamawithonel has quit [Ping timeout: 260 seconds]
lamawithonel has joined #ocaml
ftrvxmtrx has joined #ocaml
todun has quit [Client Quit]
todun has joined #ocaml
todun has quit [Remote host closed the connection]
todun has joined #ocaml