[Caml-list] ocamlyacc error recovery

2010-07-17 Thread Warren Harris
I was wondering if it was possible for ocamlyacc to perform error recovery by attempting to insert a token in the stream and continuing to parse. The docs indicate that the error recovery mechanism is mostly centered around discarding tokens, but in this case I'd like to attempt to insert a

[Caml-list] gc crash

2010-06-09 Thread Warren Harris
I've observed the following gc crash with my ocaml (3.11.2) application, after attempting to implement a memory-flushing routine with Gc.create_alarm: Program received signal SIGSEGV, Segmentation fault. 0x007c15a7 in caml_fl_allocate (wo_sz=value optimized out) at freelist.c:171 171

Re: [Caml-list] [ANN] OCaml-Java project: 1.4 release

2010-05-11 Thread Warren Harris
I'm curious whether there are any notes / pointers regarding the completeness of the ocaml-java implementation (couldn't find this on the web site). I'm wondering about the feasibility of using it for a moderately large ocaml project I've been working on which uses Lwt to perform async I/O. I

Re: [Caml-list] gc overhead

2010-03-02 Thread Warren Harris
On Mar 1, 2010, at 12:54 AM, Richard Jones wrote: 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

Re: [Caml-list] gc overhead

2010-03-02 Thread Warren Harris
On Mar 2, 2010, at 1:01 PM, Peter Hawkins wrote: I would have recommended using oprofile on linux, which I greatly prefer to GCC's built-in profiling support for profiling C programs. It has a low and tunable overhead, and because it's a sampling profiler it doesn't perturb the results

Re: [Caml-list] Re: gc overhead

2010-03-02 Thread Warren Harris
On Mar 2, 2010, at 2:03 PM, Sylvain Le Gall wrote: You can have a look at: http://ocamlviz.forge.ocamlcore.org This allow to instrument your code and watch GC activity. I think that with a little a little help on program side, you can be quite precise about GC without using gprof at all. This

Re: [Caml-list] gc overhead

2010-03-02 Thread Warren Harris
like I'd need to hack my runtime a bit to get this though. Warren On Mar 2, 2010, at 4:55 PM, Peter Hawkins wrote: Hi... On Tue, Mar 2, 2010 at 3:08 PM, Warren Harris warrensomeb...@gmail.com wrote: Peter - gprof with ocaml works quite well: http://caml.inria.fr/pub/docs/manual-ocaml

[Caml-list] gc overhead

2010-02-28 Thread Warren Harris
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 using gprof? Additional information provided by Gc.stat would be

[Caml-list] lazy vs fun

2009-08-24 Thread Warren Harris
Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? E.g. let x = lazy (3+4) let y = Lazy.force x vs: let x = fun () - 3+4 let y = x () Perhaps it's just that the type int lazy_t is more informative than unit - int? Warren

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Warren Harris
On Aug 24, 2009, at 4:11 PM, Martin Jambon wrote: Oops. The following makes it possible for f to be garbage-collected: [...] If I understand correctly, the closure associated with f will be collectable after the lazy_t is forced, whereas before its lifetime would be bound to the

[Caml-list] camomile vs netstring

2009-04-07 Thread Warren Harris
of conversions, but I have no idea whether these are actually useful, or simply legacy artifacts. I think my unicode needs are fairly simple, but then again, maybe everyone thinks that as they're diving off this cliff. :-) Warren -- Warren Harris war...@metaweb.com Metaweb Technologies http

[Caml-list] polymorphic variants and recursive functions

2009-03-25 Thread Warren Harris
I stumbled upon a little puzzle that I can't quite work out. I'm trying to use polymorphic variants as phantom types and in one particular situation involving a polymorphic type with an invariant type parameter (Lwt.t) the compiler is unhappy with a set of mutually recursive functions. I

Re: [Caml-list] polymorphic variants and recursive functions (caml: to exclusive)

2009-03-25 Thread Warren Harris
Mauricio, Thanks for your response... On Mar 25, 2009, at 4:24 PM, Mauricio Fernandez - m...@acm.org wrote: The Lwt.t type is abstract and invariant since no annotation has been given for the type variable (you'd need it to be type +'a t): ... Unfortunately, the type variable is in

Re: [Caml-list] [ANN] OCaml-Java project: 1.1 release

2008-11-11 Thread Warren Harris
On Nov 11, 2008, at 8:17 AM, [EMAIL PROTECTED] - [EMAIL PROTECTED] wrote: Your (dual) suggestion of compilation of Java sources into either OCaml sources of OCaml binaries for ocamlrun (or even interpretation of Java bytecode) is interesting. The Java language is clearly easy to parse, type,

Re: [Caml-list] [ANN] OCaml-Java project: 1.1 release

2008-11-09 Thread Warren Harris
Interesting project. Looks like you're mostly focused on getting ocaml code to run in a jvm. Have you given any consideration to making things work the other way around? I've found the ocaml runtime to be far superior, and it would be nice to be able to recompile a java library (source or

[Caml-list] understanding weak

2008-10-30 Thread Warren Harris
from A to B is maintained. Can anyone verify? Thanks, Warren Harris Metaweb Technologies smime.p7s Description: S/MIME cryptographic signature ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list

Re: [Caml-list] RE: understanding weak

2008-10-30 Thread Warren Harris
On Oct 30, 2008, at 11:48 AM, CUOQ Pascal - [EMAIL PROTECTED] wrote: Warren Harris [EMAIL PROTECTED] wrote: I'd like to understand better how ocaml's weak pointers operate. You will be interested in the following important article: http://portal.acm.org/citation.cfm?id=1411308 :) Thank

[Caml-list] killing a cat

2008-09-08 Thread Warren Harris
as desired, although this solution seems somewhat round-about, and was difficult to arrive at. Can anyone suggest another approach that prevents the dreaded underscores? (Note that using objects instead of records exhibits the exact same behavior.) Warren Harris Metaweb Technologies smime.p7s

[Caml-list] parameter passing optimizations

2008-08-05 Thread Warren Harris
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 only, but I wanted to

Re: [Caml-list] cost of monads

2008-06-22 Thread Warren Harris
metaocaml for this would seem to offer the best of both worlds: http://www.cas.mcmaster.ca/~carette/publications/scp_metamonads.pdf) Warren On Jun 21, 2008, at 7:32 PM, Brian Hurt wrote: On Sat, 21 Jun 2008, Warren Harris wrote: I'm considering writing a moderate sized program with high