Re: [Caml-list] Lwt and OCamlMakefile

2010-12-21 Thread Romain Beauxis
Le mardi 21 décembre 2010 04:02:13, Michael Ekstrand a écrit : > So, the real solution is to use a shell script which wraps 'camlp4o' and > looks up the appropriate package lines with ocamlfind. It will do > something like > > camlp4 $(ocamlfind -predicates preprocesor,syntax -syntax camlp4o > -p

Re: [Caml-list] Tips to find the cause of a seg fault

2010-12-01 Thread Romain Beauxis
Le mercredi 1 décembre 2010 09:17:15, Philippe Veber a écrit : > > The function that triggers the segfault may be confusing, in particular > > in case of a memory corruption, which I suspect here. > > The pattern matching can cause a crash because it is using a value that > > is already corrupted a

Re: [Caml-list] Tips to find the cause of a seg fault

2010-11-30 Thread Romain Beauxis
Hi, Le mardi 30 novembre 2010 17:08:12, Philippe Veber a écrit : > The seg fault occurs during the call to this function with the button event > retrieved by ocamlsdl. What's really weird is that if I comment the third > case of the pattern matching, the seg fault does not occur. This is strange >

[Caml-list] nan and infinity in C bindings..

2010-11-13 Thread Romain Beauxis
Hi all ! I have a code that uses an external C library (fftw3) for float (double) computations. I get nan and infinity values back in OCaml using Store_double_field... Is it possible or do I have a problem in my binding code ? Romain ___ Ca

Re: [Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Romain Beauxis
Hi, Le mardi 7 septembre 2010 15:58:04, Paolo Donadeo a écrit : > Any ideas or suggestions? I'm sorry if I missed something obvious, but why don't you simply require the callback in the CAMLprim function's arguments and then wrap it in the ML code? Something like: .ml: type handler

Re: [Caml-list] caml_copy_string

2010-08-25 Thread Romain Beauxis
Le mercredi 25 août 2010 14:16:30, Florent Monnier a écrit : > > That's right. Therefore, calling caml_copy_string in noalloc mode is > > probably not a good idea.. > > but no-one told to do so > > there was a boxed value provided to the noalloc function, > but this function does not call caml_co

Re: [Caml-list] caml_copy_string

2010-08-24 Thread Romain Beauxis
Le mardi 24 août 2010 10:22:48, Anil Madhavapeddy a écrit : > That's not quite right; "noalloc" calls do not have the OCaml runtime in a > functioning state at all since the instructions to set it up are not > emitted by ocamlopt. > > See [1] for Xavier Leroy's explanation on the matter, which I'v

Re: [Caml-list] caml_copy_string

2010-08-23 Thread Romain Beauxis
Le lundi 23 août 2010 07:09:05, Florent Monnier a écrit : > an alternative method is to provide a string from ocaml to c then c fills > this buffer, then you can save allocations by reusing the same buffer, > see: This is a good idea but I would be a little bit suspicious about using "noalloc".

Re: [Caml-list] caml_copy_string

2010-08-21 Thread Romain Beauxis
Le samedi 21 août 2010 18:30:28, Jeffrey Barber a écrit : > Is there a way to get a string from C to OCaml without the caml_copy_string > function, or is there a version that doesn't copy the string? String_val ? :-) R. ___ Caml-list mailing list. Subs

Re: [Caml-list] Smart ways to implement worker threads

2010-07-17 Thread Romain Beauxis
Le samedi 17 juillet 2010 05:52:31, Goswin von Brederlow a écrit : > Now I have a queue that I can include in select. The take function can > be used by the worker threads. The main thread can use either take_all > or process to save on syscalls or stick with take to ensure the queue > does not sta

Re: [Caml-list] Smart ways to implement worker threads

2010-07-17 Thread Romain Beauxis
Le samedi 17 juillet 2010 05:07:48, Goswin von Brederlow a écrit : > No, it couldn't. The main thread must be blocked waiting for something. > That something would either be waiting for select to return or the main > thread runs a queue and a seperate select thread and worker threads > throw tasks

Re: [Caml-list] Smart ways to implement worker threads

2010-07-16 Thread Romain Beauxis
Le vendredi 16 juillet 2010 08:05:10, vous avez écrit : > > Now, the main thread does not need to be a task.. > > But then how does the main thread notice when a checksum is finished > computing? The information has to flow both ways. I would say its implemented in the replay_request function. Y

Re: [Caml-list] Smart ways to implement worker threads

2010-07-15 Thread Romain Beauxis
Le jeudi 15 juillet 2010 22:52:53, Goswin von Brederlow a écrit : > The main task will only process priority 0 events and bounce between > main_task and with_checksum while the worker threads process priority 1 > events and do_checksum. > > Correct? I think it should be like this: let do_checksu

Re: [Caml-list] Smart ways to implement worker threads

2010-07-15 Thread Romain Beauxis
Le jeudi 15 juillet 2010 12:46:53, Goswin von Brederlow a écrit : > I don't see where that helps at all. I don't want to offload the IO into > threads and schedule them and Duppy seems to only handle IO tasks. I don't understand what you mean by IO tasks. Tasks in duppy are scheduled according to

Re: [Caml-list] Smart ways to implement worker threads

2010-07-15 Thread Romain Beauxis
Hi ! Le mercredi 14 juillet 2010 11:09:49, Goswin von Brederlow a écrit : > What do you think? Other Ideas? Ready-to-use modules for this? I won't commend on CML; which I don't know at all but the description you give seems to match the requirements we had in liquidsoap when we implement

Re: [Caml-list] Distinguish between osx and linux programmatically

2010-07-08 Thread Romain Beauxis
Le jeudi 8 juillet 2010 12:01:24, Richard Jones a écrit : > Actually I misunderstood the link I posted > (http://www.kernel.org/doc/man-pages/online/pages/man2/uname.2.html#NOTES) > thinking it meant that the string fields in the structure could have > variable width. Reading it again, they don't.

Re: [Caml-list] Distinguish between osx and linux programmatically

2010-07-08 Thread Romain Beauxis
Le jeudi 8 juillet 2010 06:44:34, Richard Jones a écrit : > Stdlib could bind the uname(2) syscall, but it's legendary in its > complexity. Seems more likely to cause problems than just calling out > to the external program. I fail to see the complexity.. Where is it ? Such a function would also

Re: [Caml-list] OCaml 3.12.0+beta1 on Cygwin 1.7.5

2010-07-07 Thread Romain Beauxis
Hi ! Le mardi 6 juillet 2010 16:36:05, Taylor Venable a écrit : > Hi there, I'm thinking of writing some programs in OCaml to assist a > custom build infrastructure (currently 95% Tcl, 5% external Lua > programs) that we use at work. Since we build on Windows, Mac, and > Linux I have to m

Re: [Caml-list] Bigarrays and blocking_section..

2010-05-25 Thread Romain Beauxis
Hi ! Le mardi 25 mai 2010 14:29:28, vous avez écrit : > Are you sure that you correctly calculate the bigarray size in your > Caml code? Why not just use struct caml_ba_array fields? I suspect > it's not GC problem but just a buffer overrun in memset(). I'm pretty sure the size is not the

[Caml-list] Bigarrays and blocking_section..

2010-05-25 Thread Romain Beauxis
Hi all ! I am trying to understand some segfault that we observe and I have a question about the relationships between bigarrays in C and the Gc. We have the following code: static frame *frame_of_value(value v, frame *f) { f->data = Caml_ba_data_val(Field(v,0)); f->width = Int_val(

Re: [Caml-list] [ANN] Camomile 0.7.3

2010-05-12 Thread Romain Beauxis
Hi ! Le mercredi 12 mai 2010 07:13:17, Yoriyuki Yamagata a écrit : > Also, I would like to hear about a success ( /failure ) story > of Camomile. Do you use Camomile? What for? This is important since I > have to convince my boss to allow me to invest some spare time to Camomile > proj

Re: [Caml-list] [ANN] Camomile 0.7.3

2010-05-12 Thread Romain Beauxis
Hi ! Le mercredi 12 mai 2010 07:13:17, Yoriyuki Yamagata a écrit : > Also, I would like to hear about a success ( /failure ) story > of Camomile. Do you use Camomile? What for? This is important since I > have to convince my boss to allow me to invest some spare time to Camomile > proj

[Caml-list] Win32 OCaml cross-compiler for Debian

2010-02-11 Thread Romain Beauxis
Hi all ! Thanks to the great work from Richard Jones on building a OCaml cross-compiler for windows, we now have a similar package in Debian ! The package is called mingw32-ocaml and has just been accepted yesterday. I hope this can be useful.. Romain _

Re: [Caml-list] Problem with try_lock on win32.

2010-01-27 Thread Romain Beauxis
Hi ! Le mercredi 27 janvier 2010 02:23:25, David Allsopp a écrit : > Romain Beauxis: > > I have a problem with the following code under win32: > > > > let m = Mutex.create () > > > > let () = > > Mutex.lock m; > > if Mutex.try_

[Caml-list] Problem with try_lock on win32.

2010-01-26 Thread Romain Beauxis
Hi all ! I have a problem with the following code under win32: let m = Mutex.create () let () = Mutex.lock m; if Mutex.try_lock m then Printf.printf "locked !\n" else Printf.printf "could not lock!\n" When run, the program outputs: "locked !" Obviously, this is not the i

[Caml-list] Ocaml-cry: an ocaml native implementation source protocols for icecast/shoutcast

2009-10-16 Thread Romain Beauxis
Hi all ! Coming along with the next release of liquidsoap, we have just released a new module for ocaml, namely ocaml-cry. Ocaml-cry is a native implementation of the protocols used for sending source data to icecast and shoutcast servers. The main difference with the famous libshout i

Re: [Caml-list] Jane Street is hiring (as if you didn't already know)

2009-08-17 Thread Romain Beauxis
Hi ! Le lundi 17 août 2009 15:02:10, Alexy Khrabrov a écrit : > I believe that any OCaml job posting is such a cause to rejoice, that the > only event which comes less frequently is a Haskell job posting! :) You > have to be pretty heartless, or not planning to work as a functional > prog

Re: [Caml-list] Jane Street is hiring (as if you didn't already know)

2009-08-17 Thread Romain Beauxis
Hi ! Le dimanche 16 août 2009 13:56:40, Yaron Minsky a écrit : > I believe it's fairly well established that job announcements are welcome > on the caml list, and that the appearance of the ocaml-jobs list does not > change that. Here's a thread that asks and answers that very question.

Re: [Caml-list] Jane Street is hiring (as if you didn't already know)

2009-08-16 Thread Romain Beauxis
Hi ! Le mardi 11 août 2009 16:50:07, Yaron Minsky a écrit : > For someone who cares about functional programming, Jane Street is an > interesting place to consider. Jane Street has invested deeply in > OCaml, to the point where we now have the largest team of OCaml > programmers in any in

Re: [Caml-list] Uncaught Unix_error.

2009-06-19 Thread Romain Beauxis
Le jeudi 18 juin 2009 21:21:20, Stéphane Glondu a écrit : > > I'm lost, I'd like to understand when the exception is registered: at > > runtime initialization? In this case, only one should ever be > > registered (at least it seems easy to enforce). Or is it statically > > registered somehow? > > T

Re: [Caml-list] Uncaught Unix_error.

2009-06-18 Thread Romain Beauxis
Le jeudi 18 juin 2009 15:17:12, Stéphane Glondu a écrit : > > We believe that the issue is raised because the module that uses > > Unix.read is compiled with one of unix or threads and the application > > using that module with the other one. > > Such errors can also happen if you link the (same) U

[Caml-list] Uncaught Unix_error.

2009-06-18 Thread Romain Beauxis
Hi all ! We have had a strange bug report on our code. Somehow, an Unix.Unix_error exception was not caught while it ought to be. See: http://savonet.rastageeks.org/ticket/269 We have precisely characterized the issue in the code, and we would like to understand its possible origin.

Re: [Caml-list] [ANN] ocamltarzan 0.1

2009-04-16 Thread Romain Beauxis
Hi ! Le Thursday 16 April 2009 14:15:40 Yoann Padioleau, vous avez écrit : > Sexplib and binprot by Jane Street are attractive, but they rely on > camlp4. I don't like camlp4. I like the metaprogramming facility it > offers but it has many disadvantages. So I've found a in-the-middle > sol

Re: [Caml-list] Strings

2009-04-05 Thread Romain Beauxis
Le Saturday 04 April 2009 11:14:34 David Rajchenbach-Teller, vous avez écrit : > Note that Batteries provides > * regular OCaml strings > * strings with capabilities (i.e. strings which, depending on their > type, can be read-only/write-only/read-write) -- sometimes faster than > regular strings, n

Re: [Caml-list] Manipulating xml files withing ocaml

2008-11-23 Thread Romain Beauxis
Hi Jean ! On Sun, 23 Nov 2008 10:13:27 -0700, "Jean Krivine" <[EMAIL PROTECTED]> wrote: > Just a quick question, I would like to open and access easily an xml > file within my ocaml program. Does someone have a small library that > would help me doing that? All the things I found for now

Re: ANNOUNCE: Windows cross-compiler (was: Re: [Caml-list] OCaml 3.11.0+beta1 cross-compiler)

2008-11-15 Thread Romain Beauxis
Le Saturday 15 November 2008 20:02:51 Richard Jones, vous avez écrit : > There are about a million things to fix, but this should be enough to > get people started. Thanks for this work, that seems an awsome achievement ! Romain ___ Caml-list mailing

Re: [Caml-list] Big array with data managed by another value

2008-11-14 Thread Romain Beauxis
Le Friday 14 November 2008 16:10:13 Daniel Bünzli, vous avez écrit : > I think I understood now, the original value was the custom block. > > If you were using the custom block only for finalization issues (not   > serialization, hashing etc.) then one solution would be to replace   > your custom b

[Caml-list] Big array with data managed by another value

2008-11-14 Thread Romain Beauxis
Hi all ! In our application, we use a custom block to carry a pointer to data allocated by C. We would like to use this data with functions that use Bigarrays. Hence, we want a [custom_to_bigarray] function that would allocate a big array, and put our pointer as its data. We can pass

[Caml-list] toplevel not executed: Bug ?

2008-09-03 Thread Romain Beauxis
Hi all ! I've encountered a strange bug while preparing a caml module with C function. Depending on the execution of a caml-defined function, the toplevel is evaluated or not, leading to a segfault when calling a caml callback from C. The code of the C part is: <--- #include #include

Re: [Caml-list] New Ocaml Plug-in for NetBeans

2008-07-26 Thread Romain Beauxis
Le Saturday 26 July 2008 04:57:40 Jon Harrop, vous avez écrit : > > If I might stick my oar in: why don't the OCaml community write an IDE > > for OCaml in OCaml using Camlp4 for parsing with throwback and LablGTK > > for the GUI? (...) > However, the resulting program would most likely be difficul

Re: [Caml-list] ocamlc.opt tries to allocate 34 GB of RAM ... and fails

2008-05-07 Thread Romain Beauxis
Isn't it this bug: http://caml.inria.fr/mantis/view.php?id=4448 Romain ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.ya