Re: [Caml-list] help with ocaml makefiles

2010-11-19 Thread Anil Madhavapeddy
On 18 Nov 2010, at 07:43, ri...@happyleptic.org wrote: > Each time I need more debug information for the ocaml runtime itself > (which hopefully is not often) I recompile Ocaml adding various "-g" > and "-O0" here and there in some makefiles. > > But I've noticed there are some special targets an

Re: [Caml-list] Causes for segfaults

2010-11-15 Thread Anil Madhavapeddy
On 15 Nov 2010, at 18:50, Daniel de Rauglaudre wrote: > On Mon, Nov 15, 2010 at 07:38:25PM +0100, Jamie Brandon wrote: > >> ja...@jamie-aspire:~$ cat > segfault.ml >> let rec ints n = n :: ints (n+1) >> let _ = ints 0 >> ja...@jamie-aspire:~$ ocamlopt segfault.ml >> ja...@jamie-aspire:~$ ./a.out

Re: [Caml-list] Asynchronous IO programming in OCaml

2010-10-24 Thread Anil Madhavapeddy
On 24 Oct 2010, at 09:17, Jake Donham wrote: > On Sun, Oct 24, 2010 at 3:34 AM, Jon Harrop wrote: > Is there a tutorial on using something like LWT for asynchronous programming > in OCaml? I'm looking for an example like an echo server that handles > clients concurrently without blocking threads,

Re: [Caml-list] Create a constraint between variant type and data list

2010-09-04 Thread Anil Madhavapeddy
Here's a (very) quick and dirty implementation that will automatically populate data, using our dynamic typing library ( http://github.com/mirage/dyntype ). You just need to fill in desc_of_license with the matching descriptions, and data will be auto-populated at program startup. -anil -- ty

[Caml-list] [CUFP 2010] Birds of a Feather sessions

2010-08-25 Thread Anil Madhavapeddy
= Birds of a Feather sessions (BOFs) Commercial Uses of Functional Programming Workshop (CUFP 2010) http://cufp.org/bofs-2010 Baltimore, Maryland, September 30 - October 1 =

Re: [Caml-list] caml_copy_string

2010-08-24 Thread Anil Madhavapeddy
On 24 Aug 2010, at 15:52, Till Varoquaux wrote: > On Tue, Aug 24, 2010 at 10:21 AM, Florent Monnier > wrote: >> Le lundi 23 août 2010 22:24:48, Romain Beauxis a écrit : >>> 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

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

2010-08-23 Thread Anil Madhavapeddy
On 23 Aug 2010, at 13:12, Paul Steckler wrote: > On Mon, Aug 23, 2010 at 10:05 PM, Mark Shinwell > wrote: > >> Have you tried using gdb to determine the stack backtrace when it segfaults? >> Also, if it can be done without disturbing too much code, it might be worth >> trying to eliminate Dynlin

Re: [Caml-list] Re: multicore wish

2009-12-28 Thread Anil Madhavapeddy
On 28 Dec 2009, at 12:28, Gerd Stolpmann wrote: > However, there are some problems: Values outside the heap do not support > the polymorphic comparison and hash functions. That's a hard limitation, > e.g. you cannot even compare two strings, or build a hash table with > strings as keys. That limit

Re: [Caml-list] Generation of Java code from OCaml

2009-10-03 Thread Anil Madhavapeddy
On 3 Oct 2009, at 18:27, blue storm wrote: On Sat, Oct 3, 2009 at 2:16 PM, Anil Madhavapeddy wrote: The only thing I haven't quite worked out yet is the quotation to pattern-match type applications to detect things like "(string, unit) Hashtbl.t" the way the current json-stat

Re: [Caml-list] Generation of Java code from OCaml

2009-10-03 Thread Anil Madhavapeddy
On 24 Sep 2009, at 13:19, Martin Jambon wrote: Oh yes, there's type-conv too. I don't know the pros and cons of using either type-conv or deriving. If anyone knows, a brief comparison would be helpful. The nice thing about using type-conv is that syntax extensions can be composed qui

Re: [Caml-list] Re: Generating comments from camlp4

2009-09-15 Thread Anil Madhavapeddy
I dont believe you can add comments with camlp4; I'm using type-conv to hack on an ORM layer, and it would be lovely to have the generated functions also have comments to not dirty up the OCamldoc. And also, to maintain sanity when reading through pages of generated OCaml... -anil On 15 S

Re: [Caml-list] Camlimages integer overflows with PNG images

2009-07-03 Thread Anil Madhavapeddy
On 3 Jul 2009, at 18:28, Richard Jones wrote: On Fri, Jul 03, 2009 at 06:19:49PM +0100, Anil Madhavapeddy wrote: Do you have a patch for this at all? I need to stick it into OpenBSD fairly urgently as we're in release lock. Yes, I worked up a patch here: https://bugzilla.redha

[Caml-list] ANN: OCaml/Sqlite ORM layer (preview 0.2)

2009-06-02 Thread Anil Madhavapeddy
I've been using OCaml in a few server projects which need a light- weight database, and so I wrote a library to map OCaml objects directly to a SQLite3 backend database. Like other ORM systems, you define a schema based on sets of named fields. The Sql_orm library then generates an OCaml mo

Re: [Caml-list] Re: mixing infix functions and the format4 types

2009-03-30 Thread Anil Madhavapeddy
On 30 Mar 2009, at 10:10, Zheng Li wrote: Is extra separators acceptable? # let ($) f x = f x;; val ( $ ) : ('a -> 'b) -> 'a -> 'b = # "foo" --- "%s %s %s" $ "bar1" $ "bar2" $ "bar3";; - : string = "foo: bar1 bar2 bar3" Aha ... using the identity function like this works great, thanks! -ani

[Caml-list] mixing infix functions and the format4 types

2009-03-29 Thread Anil Madhavapeddy
Is there any way to mix infix operators with the Printf format6 types? I have a code printing module where this would be quite convenient syntactically, but the obvious attempt didn't work: $ ocaml Objective Caml version 3.11.0 # open Printf;; # let myfn m s = let xfn o = m ^ ": " ^

Re: [Caml-list] Re: ocamlfind ocamlopt.opt?

2009-03-18 Thread Anil Madhavapeddy
On 18 Mar 2009, at 16:19, Alexy Khrabrov wrote: On Mar 18, 2009, at 8:21 AM, Anil Madhavapeddy wrote: I rather like MacPorts since it's easy to add a local override with upgrades and so on (e.g. backporting the fix for fork+threads on MacOS X). I've got my OCaml macports

Re: [Caml-list] Re: ocamlfind ocamlopt.opt?

2009-03-18 Thread Anil Madhavapeddy
On 17 Mar 2009, at 22:53, Alexy Khrabrov wrote: Another alternative on Mac is MacPorts, and there's quite a few of OCaml ports. Are the maintaners here by any chance, can anybody say what the structure/coordination is? I don't see why MacPorts can't be as good or better than Debian, and