Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
tmaedaZ has quit [Read error: 60 (Operation timed out)]
tmaeda has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
tmaeda is now known as tmaedaZ
derenrich has joined #ocaml
marteo has quit ["Debian GNU/Hurd is Good."]
flux has quit [Remote closed the connection]
Jan_Flanders has quit ["Chatzilla 0.9.75.1 [SeaMonkey 1.1.18/2009082513]"]
tonyg has joined #ocaml
_unK has joined #ocaml
tonyg has quit [Read error: 60 (Operation timed out)]
struktured has joined #ocaml
jeddhaberstro has joined #ocaml
struktured has quit [Read error: 60 (Operation timed out)]
Modius has joined #ocaml
_unK has quit [Remote closed the connection]
Modius_ has quit ["I'm big in Japan"]
ski_ has quit ["Lost terminal"]
Associat0r has quit []
thieusoai has quit ["leaving"]
jeddhaberstro has quit [Client Quit]
struktured has joined #ocaml
struktured has quit [Read error: 60 (Operation timed out)]
struktured has joined #ocaml
joewilliams has quit [Remote closed the connection]
demitar has quit [Read error: 110 (Connection timed out)]
flux has joined #ocaml
demitar has joined #ocaml
ua has joined #ocaml
fx_ has joined #ocaml
ua_ has joined #ocaml
ua has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
struktured has quit [Read error: 60 (Operation timed out)]
mehdid has joined #ocaml
ua_ has quit [Read error: 110 (Connection timed out)]
ikaros has quit ["Leave the magic to Houdini"]
rajeshsr has joined #ocaml
rajeshsr has left #ocaml []
|Jedai| has quit [Read error: 60 (Operation timed out)]
|Jedai| has joined #ocaml
tonyg has joined #ocaml
lagenar has joined #ocaml
tonyg has quit [Read error: 113 (No route to host)]
Lucas_ has joined #ocaml
lagenar has quit [Read error: 60 (Operation timed out)]
Lucas_ has quit [Client Quit]
lagenar has joined #ocaml
lagenar has quit ["Leaving"]
ksson has joined #ocaml
_unK has joined #ocaml
lagenar has joined #ocaml
<lagenar> if I want to distribute a bytecode executable, what else should I include so that it runs in any windows machine?
tonyg has joined #ocaml
<Camarade_Tux> compiling with -custome?
<Camarade_Tux> bah, -custome
<Camarade_Tux> crap
<Camarade_Tux> -custom
<lagenar> I'm not able to compile native executables for windows right now(some problem with cygwin), that's why I was asking how to distribute bytecode executables
<mrvn> You are bound yb ocamls QPL|LGPL|other license then though.
<Camarade_Tux> you need to distribute the bytecode interpreter, but if you compiler to bytecode with -custom, it'll be embedded in your .exe
<lagenar> ahh ok, thanks
<Camarade_Tux> also, you'll need cygwin1.dll and maybe another dll, the best way is to run the .exe file on another machine and see what are the missing .dll files
<mrvn> Thinking about it, does the ocaml binary runtime have an exception for distributing things compiled against it?
<Camarade_Tux> don't think so
<thelema> mrvn: I thought the point of the LGPL exception of ocaml was to allow distribution under other licenses
<Camarade_Tux> the runtime should be QPL which means you can distribute it without any restriction as long as you don't modify it
<thelema> even when statically linked
<thelema> the compiler is qpl
<mrvn> thelema: No. just allows linking. You still need to ship the source for the lib.
<mrvn> BUt eah, you can choose the QPL option
<mrvn> +y
<thelema> "Thus, users are free to distribute (or not) OCaml-generated binaries under whatever conditions they like."
<mrvn> thelema: thx. yes it has an exception.
lagenar has quit ["Saliendo"]
_JFT_ has joined #ocaml
_JFT_ has quit [Remote closed the connection]
_JFT_ has joined #ocaml
Pimm has joined #ocaml
ua has joined #ocaml
_JFT_ has quit []
tonyg has quit [Read error: 60 (Operation timed out)]
ksson has quit [Read error: 110 (Connection timed out)]
_JFT_ has joined #ocaml
ua_ has joined #ocaml
ksson has joined #ocaml
ua has quit [Read error: 60 (Operation timed out)]
peper has joined #ocaml
<peper> hello
<peper> are there any sensible qt bindings for ocaml?
<Camarade_Tux> not that I know of unfortunately
<fx_> afaik no
<orbitz> there are no sensible GUI bindings for ocaml from what i'ev seen
<Camarade_Tux> gtk :P
<orbitz> the curses bindings are allegedly quite good according to Minksy :)
<peper> guess i will have to go with gtk then
<mrvn> Is there another way to create some shared memory between 2 ocaml processes than Bigarray.Array1.map_file?
<Camarade_Tux> I like lablgtk ;-)
<Camarade_Tux> and I have to say that the fact there aren't many nice gui libraries doesn't help
<mrvn> Camarade_Tux: "aren't many"? That implies there are some
<orbitz> haha
<Camarade_Tux> I wonder if I could do something for qt, I should really take a few hours and check it out
<Camarade_Tux> mrvn: hehe :P
<Camarade_Tux> mrvn: win32? :D
<mrvn> I'm still looking for something that adds simple menus and buttons to the ocaml Garphics module.
<Camarade_Tux> I've been thinking about something like that but it'd be awful, motif-like :P
<mrvn> Ocaml make it easy to draw something in a few lines of code but once you need a Menu or Buttons as well all hell breaks loose.
<Camarade_Tux> tried the FRP libraries?
<mrvn> I haven't found a GUI toolkit yet that had a simple set_color color; plot x y;
<Camarade_Tux> also, is ReactiveML some kind of FRP? I noticed there'll be a speech about it at JFLA
<mrvn> Camarade_Tux: A nice small GUI toolkit on top of sdl would be nice.
<orbitz> ohhh FRP!
<mrvn> Something to write tic-tac-toe or sudoku in.
<orbitz> I don't know much about FRP other than I love the idea
<mrvn> frp?
<orbitz> functional reactiv eprogramming
<Camarade_Tux> actually I was wondering what palomer was using for his projects, it had some kind of GUI
<orbitz> from what i've seen you generally describe an eventloop as iterating over a stream of events
<Camarade_Tux> I'm looking for simple examples of FRP, very simple ones, and maybe a small how-to which wouldn't start by explaining the theory behind FRP
<mrvn> Hmm, GUI does fit inot OO really really well.
<Camarade_Tux> (everything needs a tutorial which doesn't start with theory, something "just to see how it looks")
_zack has joined #ocaml
<mrvn> Camarade_Tux: On wikipedia frp sounds like a GUI with callbacks for events.
<Camarade_Tux> yeah, that's what I got but, well, gtk already uses that
<Camarade_Tux> s/that/callbacks/
<orbitz> Camarade_Tux: there is some FRP stuff on haskell wiki
<orbitz> there is also a 10 min meijer talk on reactive programmign in C# that is interesting
<Camarade_Tux> hmmm, could be nice, do you have the link? (although I'll have to wait until I start X before I can check it out I guess)
<mrvn> Hmm, cross reading that with reactive programming itself it sounds more like the callbacks should be called with the state of the GUI instead of events.
<orbitz> Camarade_Tux: it's sitll rathe rbasic, I'm under th eimpression teh style is fairly new in terms of getting to code
<mfp> Camarade_Tux: have you read Daniel Bünzli's introduction?
<mrvn> So the callback wouldn't be called with "button press event" but every time the status of a button changes the callback for the button is evaluated with the button as argument.
<mrvn> (if that makes sense)
<Camarade_Tux> mfp: I saw it, and read a tiny bit but haven't taken the time to read it thoroughfully yet, it looked better than other tutorials though (not perfect yet, but better)
<Camarade_Tux> mrvn: makes sense I think, and yup, it'd be nicer
<mrvn> Camarade_Tux: don't really see how that would benefit a GUI.
<mrvn> Camarade_Tux: There are some aspects in a GUI that fit frp. e.g. you have a scrollbar. Every time the scrollbar changes the window it controls gets reevalated to display the right subset.
<Camarade_Tux> for caravel (my webkit-gtk-based browser), I'm hating the non-functional approach actually
<mrvn> Camarade_Tux: But buttons and menus and such are usualy actions. You press it something runs.
<mrvn> But maybe I just don't grasp the concept
ksson has quit [Read error: 60 (Operation timed out)]
struktured has joined #ocaml
fx_ has quit [Read error: 60 (Operation timed out)]
ulfdoz has joined #ocaml
bind_return has quit ["Leaving"]
_JFT_ has quit []
tonyg has joined #ocaml
lagenar has joined #ocaml
lagenar has left #ocaml []
_JFT_ has joined #ocaml
ygrek has joined #ocaml
demitar_ has joined #ocaml
_unK has quit [Remote closed the connection]
_JFT_ has quit []
demitar has quit [Read error: 110 (Connection timed out)]
struktured has quit [Remote closed the connection]
struktured has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit [Read error: 60 (Operation timed out)]
Amorphous has joined #ocaml
Camarade1Tux has joined #ocaml
Camarade1Tux is now known as Camarade_Tux
tonyg has quit [Read error: 60 (Operation timed out)]
<Camarade_Tux> mlstate.com \o/
<Camarade_Tux> although you need an accoun to access examples
<Camarade_Tux> (well, as linked to from the tag cloud)
ofaurax has joined #ocaml
<mrvn> Marshaling closures is fun.
<mfp> Camarade_Tux: no account needed to see the examples
<mrvn> I wrote a little fractal program with wroker processes to utilize multi-core. The workers are just: let slave () = Printf.fprintf stderr "Slave %d running\n" (Unix.getpid ()); flush_all (); let rec loop () = let fn = ((Marshal.from_channel stdin) : unit -> unit) in fn (); loop () in loop ()
<Camarade_Tux> mfp: well, with the link at the top of the page, no, but the links in the tag cloud somehow do
<mfp> btw. the release includes ocamlopt & the license is ONLY FOR PERSONAL AND NON COMMERCIAL USE
<mrvn> The master just sends them a closure what to do. :)
<mfp> mrvn: having to launch the workers manually is a bit of a PITA though
<mfp> could use /proc/self/exe on Linux + cmdline arg to start in worker mode
<mrvn> The master starts Sys.argv.(0)
<mrvn> And it sends them (fun () -> exit 0) at the end to shut them down.
<mfp> hmm the runtime was indeed doing some magic with Sys.argv.(0)
<mfp> might be guaranteed to actually point to the exe in Linux
<mfp> (unlike ARGV[0], which is wrong if the program was in $PATH, not $PWD)
<mrvn> mfp C standard says argv[0] is the command. Unless you purposefully change it when starting something that is the binary.
<mfp> mrvn: argv[0] is just the exec name if it was in the PATH
<mrvn> And the ENV is the same so the same PATH is used to find the binary
<mrvn> mfp: No, in my case argv[0] is "./fract"
<mfp> I know because I had to hack that for ld_ocaml
<mfp> which is wrong *if the program was in $PATH*
<mfp> put fract in /usr/local/bin or whatever and see if it works
<mrvn> works with and without PATH.
<mfp> are you in the same dir?
<mfp> ah it's honoring PATH to find the binary again, I see
<mrvn> Unix.create_process searches the PATH when needed.
<mfp> ok
<mrvn> You do need to use the right exec() call that honors PATH obviously.
<mfp> didn't know which one create_process was using
<mfp> (seemed to remember it was the wrong one in fact, but obviously that's not the case :)
<mrvn> I think all the high-level ones use PATH. Only the low-level exec ones can do without.
<mrvn> Next step is to implement a work sltealing deque between the processes or use the multi-core GC for it.
<mrvn> Not sure how much fun it is to implement a work stealing deque in a bit of mmaped Bigarray.
<mfp> how are you going to implement the work-stealing queue w/o shared mem?
<mfp> heh
<mrvn> I see 2 problems: 1) How do I pass the Unix.file_descr to the new process? Probably have to misuse stdin for that or so. 2) How to I get a record type into a bigarray?
<mrvn> or generally any type.
<mfp> using the bigarray as a shared string and Marshal, I'd assume
<mrvn> Problem would be variable length
<mfp> you'd have to manage the bigarray manually, as a heap
<mrvn> The standard work stealing deque has a static array.
<mfp> Dynamic-Sized Nonblocking Work Stealing Deque, A http://research.sun.com/techrep/2005/abstract-144.html
<mrvn> But that has a dynamic sized deque. Not dynamic siszed slots in the deque.
demitar_ has quit [Read error: 110 (Connection timed out)]
lagenar has joined #ocaml
<mfp> oh, but the slots are of fixed size --- pointers into blocks of variable size in another bigarray ;)
<mfp> hence... manual heap management inside a bigarray
<mrvn> Tehn I need a lock free memory allocator. :)
<mrvn> and more importantly de-allocator.
<mrvn> Is there a work-granting lock-free deque?
<mrvn> I can give each slave one heap (shared with all slaved via mmap). The slave can allocate at will and free at will. A job can be freed when it is done. But when it was stolen the slave needs to tell the original slave to free the data.
<mrvn> I think if I swap the push and pop operations in the work-stealing algorithms then I get a work-granting algorithm with the same properties.
lagenar has quit ["Saliendo"]
<mrvn> .oO(I need more cores for this to be fun)
<derenrich> suggestions on good concurrency libs?
<mrvn> lib_that_i_m_currently_playing_at_writing.
<derenrich> awkward
<flux> derenrich, what is your goal?
<derenrich> right now, i'm just deciding if I should pick up ocaml as a language. I'm scouting for libraries I might one day need.
alp__ has joined #ocaml
<flux> for web serving, or when you have potentially loads of io-bounds tasks, Lwt. for performing operations in parallel I guess JoCaml is the best current answer.
alp_ has quit [Read error: 110 (Connection timed out)]
<mrvn> It is too bad libio doesn't work on file without O_DIRECT
<mrvn> I hate having to create threads just to wait for IO.
<Pimm> Guys, I have a small question, the following code produces "unbound instance variable some_array", and Google provides no answer here
<Pimm> let some_array = Array.create(1)("first node");;
<Pimm> some_array <- "second node";;
<Pimm> I'm just trying to create an array of strings and add a string to it
<flux> well, it's not going to work well as you cannot change the length of an array
<ygrek> some_array has type string array, you cannot assign to it
<ygrek> but you can assign to the cell of the array
<Pimm> As in, the array has a fixed length and I can overwrite a cell in it?
<flux> correct
<Pimm> Could this: Array.create(2)("");; be done shorter? :)
<flux> usually, if your code needs to string a lot of elements together piecewise, one uses lists (append in front, which is fast; you can reverse the list afterwards)
<flux> Array.create 2 ""
<flux> _however_, you don't likely want to do that :)
<Pimm> Why not?
<flux> because each element of the array becomes the same empty string. well, I suppose it doesn't matter, because you cannot modify an empty string either, so never mind :)
<Pimm> You mean modifying one would modify the others?
<flux> in general if you'd have done Array.create 2 "a"; and then a.(0).[0] <- 'b', all strings would've been changed. but in this case it's ok.
<flux> yes, but it's ok, because you aren't really modifying the strings
<flux> you are modifying the array to point into new strings
<Pimm> Yup, that was the idea
<Pimm> But good to know that constructing an array in that way creates cells with the same object in it
<Pimm> Thanks, flux and ygrek
<ygrek> there is also Array.make
<flux> indeed, Array.make is the preferred name of Array.create
<flux> pimm, btw, the problem I mentioned can be worked around with Array.init: Array.init 42 (fun _ -> "")
<flux> this creates a new string for each element (a bit pointless given it's the empty string, though)
<Pimm> flux, yeah, I get that
<Pimm> That's like using a factory method
_zack has quit ["Leaving."]
derenrich has quit [Read error: 110 (Connection timed out)]
yakischloba has joined #ocaml
yakischloba has quit [Read error: 104 (Connection reset by peer)]
yakischloba has joined #ocaml
ofaurax_ has joined #ocaml
ofaurax_ has quit [Read error: 104 (Connection reset by peer)]
ygrek has quit [Remote closed the connection]
yakischloba has quit [Read error: 60 (Operation timed out)]
jeddhaberstro has joined #ocaml
yakischloba has joined #ocaml
_unK has joined #ocaml
<mattam> Pimm: there's [|"";""|] too.
<Pimm> mattam, I see, thanks
yakischloba has quit [Read error: 110 (Connection timed out)]
tmaedaZ is now known as tmaeda