Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Mark Shinwell
On Mon, Mar 01, 2010 at 07:48:56PM -0500, Jianzhou Zhao wrote: > On Mon, Mar 1, 2010 at 10:19 AM, Mark Shinwell > wrote: > I compiled OCaml code into *.o by 'ocamlc -custom -output-obj...', > and then linked it with *.o from C and C++ code. > I think this isnt a native compilation. Agreed. > My

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Mark Shinwell
On Mon, Mar 01, 2010 at 07:52:01PM -0500, Jianzhou Zhao wrote: > > It seems that OCaml runtime is interpreting via 'caml_interprete' the > > OCaml function which C > > calls at runtime. If this is true, we cannot really debug that OCaml > > function, but we can > > see how it is interpreted. But I

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Mihamina Rakotomandimby
> Peng Zang : > The best way to compile and install OCaml (in my opinion) is via GODI. Why? How to install GODI? -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34 / +261 33 11 207 36

[Caml-list] Re: Event.channel memory leak?

2010-03-01 Thread Satoshi Ogasawara
On 2010/03/02, at 5:34, ygrek wrote: > On Mon, 1 Mar 2010 17:04:31 +0900 > Satoshi Ogasawara wrote: >> But, the next code makes increasing of memory use rapidly in my environment. >> (version 3.11.2 on MacOS X leopard) > Using Gc.compact instead of Gc.full_major doesn't exhibit such behaviour. Gc

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Jianzhou Zhao
On Mon, Mar 1, 2010 at 7:48 PM, Jianzhou Zhao wrote: > On Mon, Mar 1, 2010 at 10:19 AM, Mark Shinwell > wrote: >> On Mon, Mar 01, 2010 at 10:10:44AM -0500, Jianzhou Zhao wrote: >>> My main program is C++. It uses C functions to call >>> OCaml functions, and these OCaml functions also call >>> C

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Jianzhou Zhao
On Mon, Mar 1, 2010 at 10:19 AM, Mark Shinwell wrote: > On Mon, Mar 01, 2010 at 10:10:44AM -0500, Jianzhou Zhao wrote: >> My main program is C++. It uses C functions to call >> OCaml functions, and these OCaml functions also call >> C functions and wrapped C++ functions sometimes. >> >> I can debu

Re: [Caml-list] How to pass C pointers to Caml

2010-03-01 Thread Florent Monnier
Le lundi 1 mars 2010 14:24:45, Goswin von Brederlow a écrit : > Florent Monnier writes: > > Le lundi 1 mars 2010 04:55:00, Jianzhou Zhao a écrit : > >> I have been calling OCaml code from C in my project. > >> The C code has some pointers to C structures. > >> I got 'seg fault' when calling the OC

[Caml-list] Re: [newbie] miscellaneous on installation and web site

2010-03-01 Thread Sylvain Le Gall
On 01-03-2010, Marco Maggi wrote: > "Marco Maggi" wrote: >> So am I correct in saying that MLGMP is orphaned and no >> maintained GMP/MPFR/... package exists? > > Wait! Found something here: > > This is just Debian/Ubuntu p

Re: [Caml-list] Event.channel memory leak?

2010-03-01 Thread ygrek
On Mon, 1 Mar 2010 17:04:31 +0900 Satoshi Ogasawara wrote: > But, the next code makes increasing of memory use rapidly in my environment. > (version 3.11.2 on MacOS X leopard) Using Gc.compact instead of Gc.full_major doesn't exhibit such behaviour. -- ygrek http://ygrek.org.ua

RE: [Caml-list] Recursive subtyping issue

2010-03-01 Thread David Allsopp
Guillaume Yziquel wrote: > David Allsopp a écrit : > > > > external foo_of_bar : bar -> foo = "%identity" > > > > in *both* the .ml and .mli file for the module in question. I'm > virtually certain that ocamlopt eliminates calls to the %identity > primitive. > > yziq...@seldon:~$ grep magic /usr/

RE: [Caml-list] Recursive subtyping issue

2010-03-01 Thread David Allsopp
Goswin von Brederlow wrote: > "David Allsopp" writes: > > > external foo_of_bar : bar -> foo = "%identity" > > > > in *both* the .ml and .mli file for the module in question. I'm > virtually certain that ocamlopt eliminates calls to the %identity > primitive. > > Where is that documented? The u

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Marco Maggi
"Marco Maggi" wrote: > So am I correct in saying that MLGMP is orphaned and no > maintained GMP/MPFR/... package exists? Wait! Found something here: -- Marco Maggi ___ Caml-lis

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Marco Maggi
"David Allsopp" wrote: > the more usual way, which will work with OCaml, is to > specify a different root for the -prefix option when you > run configure. Yes. It worked (it seems) by doing: $ ./configure -prefix "${prefix}" ... $ make world $ make bootstrap $ make opt $ ./configure -pref

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Mark Shinwell
On Mon, Mar 01, 2010 at 08:24:32PM +0100, ri...@happyleptic.org wrote: > -[ Mon, Mar 01, 2010 at 03:19:41PM +, Mark Shinwell ] > > That said, ocamlopt-compiled assembly code is fairly easy to > > read, and you should be able to get something resembling a backtrace using > > "where". > >

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread rixed
-[ Mon, Mar 01, 2010 at 03:19:41PM +, Mark Shinwell ] > That said, ocamlopt-compiled assembly code is fairly easy to > read, and you should be able to get something resembling a backtrace using > "where". What's "where" ? ___ Caml-list mailing

Re: [Caml-list] Debugging C and OCaml

2010-03-01 Thread Mark Shinwell
On Mon, Mar 01, 2010 at 10:10:44AM -0500, Jianzhou Zhao wrote: > My main program is C++. It uses C functions to call > OCaml functions, and these OCaml functions also call > C functions and wrapped C++ functions sometimes. > > I can debug from C++, but it stops when it meets > an OCaml binding. Do

[Caml-list] Debugging C and OCaml

2010-03-01 Thread Jianzhou Zhao
My main program is C++. It uses C functions to call OCaml functions, and these OCaml functions also call C functions and wrapped C++ functions sometimes. I can debug from C++, but it stops when it meets an OCaml binding. Does anyone know an efficient solution about how to debug across different la

[Caml-list] LPAR-16 Short Papers - CFP

2010-03-01 Thread Geoff Sutcliffe
= CALL FOR SHORT PAPERS = LPAR-16 16th International Conference on Logic for Programming, Artificial

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The best way to compile and install OCaml (in my opinion) is via GODI. The GODI installation instructions are clear and allow you to specify where the install should go. Once installed, it's also easy to get all the other libraries you might want

[Caml-list] Re: [newbie] miscellaneous on installation and web site

2010-03-01 Thread Sylvain Le Gall
Hello, On 01-03-2010, Marco Maggi wrote: > Ciao, > > I am a True Beginner taking a look at O'Caml; I hope not > to be abusing by posting here rather than the beginners > list. > > I think I successfully compiled ocaml-3.11.2 on my > i686-pc-linux-gnu, but there seems to be no

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Guillaume Yziquel
David Allsopp a écrit : Guillaume Yziquel wrote: Stéphane Glondu a écrit : Why don't you just declare 'a t to be synonym for obj in the implementation of your module, declare them as abstract in its interface, and export the specially typed identities f and g? Because subtyping seems more ef

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Goswin von Brederlow
"David Allsopp" writes: > external foo_of_bar : bar -> foo = "%identity" > > in *both* the .ml and .mli file for the module in question. I'm virtually > certain that ocamlopt eliminates calls to the %identity primitive. Where is that documented? I would have written let foo_of_bar (x : bar) =

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Mark Shinwell
On Mon, Mar 01, 2010 at 02:07:45PM +0100, Marco Maggi wrote: > I think I successfully compiled ocaml-3.11.2 on my > i686-pc-linux-gnu, but there seems to be no way to install > the package in a temporary location via the Linux de facto > standard DESTDIR environment variable; is ther

Re: [Caml-list] How to pass C pointers to Caml

2010-03-01 Thread Goswin von Brederlow
Florent Monnier writes: > Le lundi 1 mars 2010 04:55:00, Jianzhou Zhao a écrit : >> I have been calling OCaml code from C in my project. >> The C code has some pointers to C structures. >> I got 'seg fault' when calling the OCaml function receiving >> C structure pointers. >> >> 18.7 at http://c

Re: [Caml-list] How to pass C pointers to Caml

2010-03-01 Thread Jianzhou Zhao
On Mon, Mar 1, 2010 at 1:22 AM, Florent Monnier wrote: > Le lundi 1 mars 2010 04:55:00, Jianzhou Zhao a écrit : >> I have been calling OCaml code from C in my project. >> The C code has some pointers to C structures. >> I got 'seg fault' when calling the OCaml function receiving >> C structure poi

RE: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread David Allsopp
Marco Maggi wrote: > Ciao, > > I am a True Beginner taking a look at O'Caml; I hope not to be > abusing by posting here rather than the beginners list. Building OCaml from source is definitely not a beginners' question! :o) > I think I successfully compiled ocaml-3.11.2 on my

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Mihamina Rakotomandimby
> Marco Maggi : > I am a True Beginner taking a look at O'Caml; I hope not > to be abusing by posting here rather than the beginners > list. You are a beginner (you told), you know there is a beginner list, and you apoligize for not using it. > I think I successfully compiled ocaml

[Caml-list] [newbie] miscellaneous on installation and web site

2010-03-01 Thread Marco Maggi
Ciao, I am a True Beginner taking a look at O'Caml; I hope not to be abusing by posting here rather than the beginners list. I think I successfully compiled ocaml-3.11.2 on my i686-pc-linux-gnu, but there seems to be no way to install the package in a temporary location via

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Guillaume Yziquel
Stéphane Glondu a écrit : 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 d

RE: [Caml-list] Recursive subtyping issue

2010-03-01 Thread David Allsopp
Guillaume Yziquel wrote: > Stéphane Glondu a écrit : > > 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 = pr

RE: [Caml-list] Recursive subtyping issue

2010-03-01 Thread David Allsopp
Stéphane Glondu wrote: > 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 penal

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 a

Re: [Caml-list] Recursive subtyping issue

2010-03-01 Thread Guillaume Yziquel
Stéphane Glondu a écrit : 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

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 >>

[Caml-list] 2nd CfP: PPDP'10

2010-03-01 Thread Temur Kutsia
== Call for Papers PPDP 2010 12th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming Hagenberg, A

[Caml-list] CFP: Call for papers, Coq Workshop (Edinburgh, July 9)

2010-03-01 Thread Yves Bertot
Please help disseminate this call for papers Two changes in the call for papers: 1/ papers describing experiments in other type theory-based proof assistants are explicitly invited to this workshop, 2/ EPTCS (http://eptcs.org/) has agreed to host the proceedings. Call for papers The Coq wor

[Caml-list] Event.channel memory leak?

2010-03-01 Thread Satoshi Ogasawara
Hello, I have found a strange memory behavior with Event module. Following code works well. open Event let ct () = let c = new_channel () in ignore (Thread.create (fun () -> sync (send c 1)) ()); let i = sync (receive c) in () let _ = let rec loop () = ct (); Thread.de

Re: [Caml-list] gc overhead

2010-03-01 Thread Richard Jones
On Sun, Feb 28, 2010 at 04:16:03PM -0800, Warren Harris wrote: > I would like to determine what percentage of my application's cpu time > is spent in the garbage collector (for tuning purposes, but also just > to monitor the overhead). Is there any way to obtain this information > short of us