Re: [Caml-list] ocamlbuild: simplification of invocation

2008-06-16 Thread Stéphane Glondu
]; Options.ocaml_libs := [ unix; oUnit]; | _ - () end;; --8-- Then you can just invoke ocamlbuild test_setup.native. Cheers, -- Stéphane Glondu ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml

Re: [Caml-list] parameter passing optimizations

2008-08-05 Thread Stéphane Glondu
Warren Harris wrote: I've been wondering whether the ocaml compiler does any sort of parameter passing optimizations for data structures, e.g. stack allocating, or destructuring them when it can determine their scope does not escape the call. My first conclusion is that it does for tuples

Re: [Caml-list] Run-time evaluation of a Printf format string

2008-08-28 Thread Stéphane Glondu
Jan Kybic wrote: I would need an equivalent of Printf.sprintf where the format string is not constant, it is read from the command line. The motivation is to let the user specify a template for file names, such as img%03d.png. Can this be achieved in Ocaml? It seems not, as

Re: [Caml-list] What's the purpose of the static library?

2008-09-22 Thread Stéphane Glondu
bill yan a écrit : I noticed there are some static libraries(.a) installed with ocaml, for example, /usr/lib/ocaml/bigarray.a. What's the purpose of those static libraries? Thanks a lot. They contain (natively) compiled OCaml code. An OCaml library compiled in native mode (usually) consists

Re: [Caml-list] Reading external references from cmo/cmx files

2008-10-04 Thread Stéphane Glondu
Jason Noakes wrote: Are there any tools or examples that would allow me to take a .cmo or .cmx file and produce a list of the external modules that are referenced from that file? There is ocamlobjinfo. But it seems to work only with bytecode objects (.cmo/.cma). If I could just read a list

[Caml-list] Relevance of explicit -linkall with ocamlopt -shared

2008-10-30 Thread Stéphane Glondu
Hello, Are there cases where ocamlopt -shared is useful without -linkall? Cheers, -- Stéphane Glondu ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr

Re: [Caml-list] ocamlbuild vs INCLUDE: how to copy snippets into _build/ ?

2008-11-08 Thread Stéphane Glondu
Stefano Zacchiroli wrote: How can I tell ocamlbuild to copy into the _build/ directory my snippets? You can use copy_rule in a plugin. Cheers, -- Stéphane ___ Caml-list mailing list. Subscription management:

Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included

2008-11-19 Thread Stéphane Glondu
Stefano Zacchiroli wrote: Still, the idea of doing the pack on the client-side is an interesting one. [...] BUT that would horribly break down with checksum assumptions, I believe. It would also mean someone's executables (contents and size) will depend on the libraries installed during

[Caml-list] Re: Notes from testing OCaml 3.11.0+beta1 on Fedora

2008-12-09 Thread Stéphane Glondu
Richard Jones wrote: coq -- Strange camlp4 problem, not yet resolved. Maybe just a missing BuildRequires: OCAMLClib/pp.mli OCAMLC4 lib/pp.ml4 sh: camlp4o: command not found File lib/pp.ml4, line 1, characters 0-1: Error: Preprocessor error This is

Re: [Caml-list] Typing Dynamic Typing in ocaml?

2008-12-17 Thread Stéphane Glondu
Jacques Carette a écrit : I have two (related) questions: 1) Has anyone transcribed the TypeRep library into ocaml? http://people.cs.uu.nl/arthurb/dynamic.html 2) How do I embed 'dynamically known' data into a single ocaml data-structure? [...] You might be interested by the following:

Re: [Caml-list] Typing Dynamic Typing in ocaml?

2008-12-17 Thread Stéphane Glondu
Jacques Carette wrote: You might be interested by the following: http://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/lib/dyn.ml?rev=5920root=coqview=markup Scarily enough, I do believe that that is exactly what I need. I guess I was hoping to avoid Obj, but this may be one of those

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Stéphane Glondu
Erick Matsen a écrit : [...] /usr/lib/libblas.a(xerbla.o): In function `xerbla_': (.text+0x0): multiple definition of `xerbla_' /usr/lib/liblapack.a(xerbla.o):(.text+0x0): first defined here /usr/lib/ocaml/3.10.2/libasmrun.a(unix.o): In function `caml_dlopen': (.text+0x223): warning: Using

Re: [Caml-list] findlib-1.2.4 (for ocaml-3.11)

2009-02-15 Thread Stéphane Glondu
Gerd Stolpmann a écrit : I've just uploaded findlib-1.2.4. This is a bugfix release: * For ocaml-3.11 some camlp4 libs no longer include dynlink. Findlib has a fixed META definition. * Bigarray needs unix: This has been fixed in the META file, too. * Attempt to fix

Re: [Caml-list] Re: otags 3.09.0 released

2009-02-17 Thread Stéphane Glondu
Sam Steingold a écrit : I would like to announce the release of otags version 3.09.0 for ocaml 3.09.0. otags generates tags files for both emacs and vi/vim from ocaml sources. has this project been abandoned? what do people use instead? I won't answer directly to the question. However,

Re: [Caml-list] Re: otags 3.09.0 released

2009-02-17 Thread Stéphane Glondu
Stéphane Glondu a écrit : I won't answer directly to the question. However, the last upstream version seems to be 0.9.3.3: http://www.cs.ru.nl/~tews/otags/ And the version in Debian is 0.9.3 and it compiles with the following patches: [...] Of course, replace 0.9.3 with 3.09.3

Re: [Caml-list] options to write a cross-platform interacting program in OCaml

2009-03-10 Thread Stéphane Glondu
Alan Schmitt a écrit : [...] For instance, could I use lwt under Windows? FYI, Unison uses lwt and works under Windows. Cheers, -- Stéphane ___ Caml-list mailing list. Subscription management:

Re: [Caml-list] questions

2009-03-24 Thread Stéphane Glondu
John Prince a écrit : 4) What kind of YAML support is there? I've seen an ad-hoc writeup to read in JSON in an ocaml program, but I'm much more familiar with YAML. http://ocaml-syck.sourceforge.net/ It is packaged in Debian. I've never used it, though... Cheers, -- Stéphane

Re: [Caml-list] cvs ocaml build failing

2009-04-16 Thread Stéphane Glondu
Joel Reymont a écrit : That would be my fault (I guess). See PR#3047. I haven't tested the patch with the ocamlbuild-based build system, but I guess initgroups.o and setgroups.o are missing from otherlibs/unix/libunix.clib... Could you check that updating libunix.clib solves your build

Re: [Caml-list] Re: arm backend

2009-04-30 Thread Stéphane Glondu
Sylvain Le Gall a écrit : Xavier talked a little about it on 2009 OCaml Meeting. It seems that he is interested in maintaining it but there is problem with floating point computation (depending on some modes you can have hard/soft/semi-soft... floating point computation). I don't know the

Re: [Caml-list] OCaml version 3.11.1+rc0

2009-05-22 Thread Stéphane Glondu
Damien Doligez a écrit : We need you to test this on as many system types as possible. Please report success or failure to damien.doli...@inria.fr as usual. It looks like ocamlbuild plugins do not work anymore... maybe because `ocamlbuild -where` now points to the same location as `ocamlc

Re: [Caml-list] Caml on CentOS: problem with -custom option

2009-06-09 Thread Stéphane Glondu
Sébastien Hinderer a écrit : Just out of curiosity: does anybody see what could cause the -lcurses flag to be present when -custom is specified ? OCaml has probably been compiled this way. You can see configure options in `ocamlc -where`/Makefile.config. I guess this is just a trivial

Re: [Caml-list] OCaml 3.11.1 released

2009-06-12 Thread Stéphane Glondu
Damien Doligez a écrit : It is our pleasure to celebrate the 30th anniversary of the first human-powered flight over the English channel by announcing the release of OCaml version 3.11.1. This is mainly a bug-fix release, see the list of changes below. It is available here:

Re: [Caml-list] Uncaught Unix_error.

2009-06-18 Thread Stéphane Glondu
Romain Beauxis a écrit : 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 believe that the issue is raised because the module that uses Unix.read is compiled

Re: [Caml-list] Uncaught Unix_error.

2009-06-18 Thread Stéphane Glondu
David Baelde a écrit : Both liquidsoap and ocaml-duppy are compiled with -threads, so they are using the same version of Unix. Duppy is not linked against Unix, only requires it through ocamlfind. Could it be that ocamlfind (on some versions) links Unix twice in liquidsoap? I did not know it

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Stéphane Glondu
Warren Harris a écrit : Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? [...] Two things I can think of right now: they are evaluated only once (even if you call Lazy.force several times), and you can do pattern matching with them.

Re: [Caml-list] Why don't you use batteries?

2009-09-04 Thread Stéphane Glondu
Jean-Christophe Filliâtre a écrit : I like writing my own libraries when I need some. Unfortunately, many people do that. The problem with this approach (from a FOSS point of view) is with external contributors (who can fix bugs or develop features). A (big) project using non-standard libraries

Re: [Caml-list] Why don't you use batteries?

2009-09-04 Thread Stéphane Glondu
Pierre Etchemaite a écrit : I imagine there are a fair number of people who take parts bits and pieces out of the batteries sources and use those in their projects. I've seen this in too many OCaml projects indeed, and that approach has its own problems too. Fixes and improvements do not

Re: [Caml-list] automake and ocaml

2009-09-21 Thread Stéphane Glondu
Daniel Molina a écrit : I have searching in the net about ocaml compatibility for automake. I have found a patch from automake by Tom Murray in 2003 http://sourceware.org/ml/automake/2003-12/msg00153.html There are autoconf macros for OCaml available there:

Re: [Caml-list] automake and ocaml

2009-09-21 Thread Stéphane Glondu
Vincent Aravantinos a écrit : There is also this project: http://forge.ocamlcore.org/projects/ocaml-autobuild/ which seems quite dead, though. The last commit was two months ago: http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocaml-autobuild;a=summary I don't think this qualifies as

Re: [Caml-list] JIT HLVM, LLVM

2009-09-30 Thread Stéphane Glondu
Mikkel Fahnøe Jørgensen a écrit : But this requires the function to be designed in a clean way and conform to certain monadic rules, and getting it wrong creates a mess in the type errors. Actually, I find the typing discipline enforced by the monadic abstraction very helpful (and elegant).

[Caml-list] [ANN] Lwt 2.0.0 released

2009-10-15 Thread Stéphane Glondu
Hello, The Lwt team is pleased to announce the release of Lwt 2.0.0. You can download it at: https://ocsigen.org/lwt/install This new version brings a lot of new features, including: * GLib integration: it is now possible to write cooperative application using GTK! * Terminal

Re: [Caml-list] forbidden construct as right hand side of let rec

2009-10-22 Thread Stéphane Glondu
Mathias Kende a écrit : let rec g = f g What about: let rec g x = f g x -- Stéphane ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's

Re: [Caml-list] forbidden construct as right hand side of let rec

2009-10-25 Thread Stéphane Glondu
Mathias Kende a écrit : [...] I also want to write : let rec h = t (f h) (with t : ('a - 'b) - 'a - 'b) but here, I can't afford to use let rec h x = t (f h) x because t as some side effects and I need it to be evaluated only once. Then what about: let h = let tmp = ref (fun x

Re: [Caml-list] Lwt try_bind question...

2009-11-02 Thread Stéphane Glondu
Tim Hanson a écrit : I've been trying to use Lwt in my application (robot control). [...] Hummm... How familiar :-) I compile with the following line: ocamlfind ocamlc -c -package lwt,lwt.unix,lwt.syntax -syntax camlp4o relay.ml Try instead: ocamlfind ocamlc -c -package

Re: [Caml-list] OCaml is broken

2009-12-19 Thread Stéphane Glondu
Erik Rigtorp a écrit : However OCaml is broken! It does not provide any support for multicore architectures, which by now is considered a bug! [...] You might be interested by OCaml4Multicore: http://www.algo-prog.info/ocmc/web/ It's still experimental, but its authors would love to have

Re: [Caml-list] [ANN] Release Candidate: 3.11.2+rc1

2009-12-29 Thread Stéphane Glondu
Damien Doligez a écrit : After testing this release candidate, please send a mail to damien.doli...@inria.fr and tell us what you tested and whether it worked. I've successfully recompiled most of the packages depending on ocaml currently available in Debian sid on amd64. The missing packages

Re: [Caml-list] [ANN] Release Candidate: 3.11.2+rc1

2010-01-05 Thread Stéphane Glondu
Richard Jones a écrit : camlp5 - When you compile, it complains it doesn't know anything about 3.11.2 and that this will require an upstream change. The first patch attached adds support for 3.11.2 (see comments in it). I've also added some fixes to the manpage that are of course irrelevant for

Re: [Caml-list] Controlling module loading order.

2010-01-09 Thread Stéphane Glondu
Guillaume Yziquel a écrit : My question is: do I have to put a line like module X = OCamlR in quantmod.ml, [...] Sounds good. But in case the compiler is too smart and discards this, I'd rather export explicitly an initialization function (or some dummy value to force the dependency order) in

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Stéphane Glondu
Guillaume Yziquel a écrit : # type untyped;; type untyped # type 'a typed = private untyped;; type 'a typed = private untyped # type -'typing tau = private obj and 'a t = 'a typed tau and obj = private untyped tau;; type 'a tau = private obj and 'a t = 'a typed tau and obj = private

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Stéphane Glondu
Guillaume Yziquel a écrit : Because subtyping seems more efficient than applying a noop function. And this code might run really often, so I do not like very much the idea of having noop functions running really often. FWIW, I don't think you have any penalty if you declare your identities as

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Stéphane Glondu
Dario Teixeira a écrit : A simple nonsensical example that illustrates the problem is listed below; the type-checking error occurs in function step1, where the optional parameter story is used as an object of type title:string; .. . In function step3, this parameter story is actually

[Caml-list] [ANN] Lwt 2.1.0 released

2010-04-19 Thread Stéphane Glondu
descriptors were not monitored correctly Enjoy! -- Stéphane Glondu, on behalf of the Lwt team ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list

Re: About Cryptokit (was: Re: [Caml-list] Re: SHA1 = stdlib ?!)

2010-04-30 Thread Stéphane Glondu
David MENTRE a écrit : I also used Cryptokit once. It was pretty useful and easy to use. However I had to modify a few lines in it in order to allow me to do some compositions with Cryptokit building blocks. Could you be more specific? Cheers, -- Stéphane

Re: [Caml-list] new emacs tuareg mode release

2010-05-24 Thread Stéphane Glondu
Sam Steingold a écrit : Now, with his blessing, Jane Street Capital took over maintenance of the code from him, and released Tuareg Mode v. 2.0.0. It is available for download at http://www.janestreet.com/ocaml/tuareg.tgz. Is there some kind of project page, with available versions? A place

Re: [Caml-list] Native compiler on armel (arm-eabi)

2010-05-24 Thread Stéphane Glondu
Fabiano a écrit : Am I right? Is ocaml able to generate native code on armel (arm eabi)? In case, have you suggestions in order to solve the issue? See [1]. In a nutshell: it will be, with OCaml 3.12.0. FWIW, almost all Debian packages compile natively on armel with it [2]. The notable

Re: [Caml-list] new emacs tuareg mode release

2010-05-26 Thread Stéphane Glondu
Sam Steingold a écrit : I have the same problem with 22.3.1 playing around, this construction seems to be causing some invalid modifier errors: (skip-syntax-backward \s-) in tuareg-find-colon-typespec and other places what kind of error? I.e., start emacs like this: $ emacs -q

[Caml-list] Architectures with natdynlink support...

2010-05-28 Thread Stéphane Glondu
Hello, This is a follow-up on PR#5049 [1], but the bug has been closed and it seems no longer possible to comment on it now (and reopening doesn't seem relevant). [1] http://caml.inria.fr/mantis/view.php?id=5049 Alain Frisch wrote: The list of platforms where natdynlink is supported is given

Re: [Caml-list] OCaml 3.12.0+beta1

2010-06-18 Thread Stéphane Glondu
Le 16/06/2010 06:07, Damien Doligez a écrit : We have the pleasure of celebrating Bloomsday by announcing the release of OCaml version 3.12.0+beta1. This is a beta release, available as source only and intended for power users to test new features and report bugs (if any). [...] I've

Re: [Caml-list] Re: Caml Light license in 2010

2010-07-14 Thread Stéphane Glondu
Le 14/07/2010 01:23, Michael Ekstrand a écrit : [...] I seem to remember a discussion about whether or not a VCS is sufficient distinction to meet the requirements of the QPL, but do not remember its outcome. http://article.gmane.org/gmane.comp.lang.caml.general/42200 -- Stéphane

Re: [Caml-list] Setting function in a class

2010-07-19 Thread Stéphane Glondu
Le 19/07/2010 09:30, Keyan Zahedi a écrit : class myclass = object val mutable _myfunc = (* a function of type string - bool) method set_myfunc f = _myfunc - f method my_func f = _myfunc f ;; I am not sure of what blocks you. Just making your snippet syntactically correct works: class

Re: [Caml-list] OCaml 3.12.0+rc1

2010-07-24 Thread Stéphane Glondu
Le 23/07/2010 18:04, Damien Doligez a écrit : [...] so you'd better test it and report any problems with compilation and installation on your favorite platform. I've successfully recompiled (almost) all (relevant) Debian packages with this new version. The only package that needs more work is

Re: [Caml-list] Segfaults with Dynlink with OCaml 3.11

2010-08-23 Thread Stéphane Glondu
Le 23/08/2010 12:57, Paul Steckler a écrit : I'm getting segmentation faults when using dynamically linked native code in 64-bit OCaml 3.11 running on Linux (Fedora 12 x64). [...] I've written some small example programs with a similar structure, and those work just fine. In my real, large

Re: [Caml-list] caml_copy_string

2010-08-23 Thread Stéphane Glondu
Le 23/08/2010 14:09, Florent Monnier 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? an alternative method is to provide a string from ocaml to c then c fills this buffer, then you can save

Re: [Caml-list] Segfaults with Dynlink with OCaml 3.11

2010-08-23 Thread Stéphane Glondu
Le 23/08/2010 14:12, Paul Steckler a écrit : [...] Oh, we just added the Dynlink stuff. There haven't been any recent crashes until just now. That could be an unhappy coincidence; the real issue might lurk in unrelated code, as you point out. Note that Dynlink can point out bugs (even in

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

2010-09-07 Thread Stéphane Glondu
Le 07/09/2010 22:58, Paolo Donadeo a écrit : I'm writing a Lua API binding [...] typedef struct ocaml_data { value state_value; value panic_callback; } ocaml_data; [...] /* alloc space for the register entry */ ocaml_data *data = (ocaml_data*)caml_stat_alloc(sizeof(ocaml_data));

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

2010-09-07 Thread Stéphane Glondu
Le 07/09/2010 23:23, Paolo Donadeo a écrit : Why don't you call caml_register_global_root on (data-state_value) as well? This was a solution I tried, but with the additional global root the finalization function was never called by the GC, so it solved the segfault with a memory leak :-)

Re: [Caml-list] web server interface for Ocaml ( like rack, wsgi, ...)?

2010-09-17 Thread Stéphane Glondu
Le 17/09/2010 09:59, Paolo Donadeo a écrit : Could you expand on the reasoning a little? I mean, what is for you the advantage of running Eliom over Ocamlnet as opposed to over the Ocsigen server? From my point of view the problem with Ocsigen is that it requires you to install an HTTP

Re: [Caml-list] Crach de l'installation de pxp

2010-11-03 Thread Stéphane Glondu
Le 03/11/2010 16:09, Sebastien Ferre a écrit : Nous essayons d'installer le package ocaml pxp après avoir installé avec succès pcre requis. L'installation de pxp crach avec des problèmes avec pcre ... [...] ocamlfind ocamlc -g -package netstring -o lexpp -linkpkg uni_types.cmo uni_lexer.cmo

Re: [Caml-list] Pervasives.compare != Pervasives.compare

2010-11-12 Thread Stéphane Glondu
Le 12/11/2010 06:57, Elnatan Reisner a écrit : Playing around a bit more, I seemed to find that every time you access an 'external' function, you get a distinct reference (is there a better term?) to it. This seems a bit odd to me. Can someone explain? Think of externals as constructors: they