Re: [Caml-list] ocamlnet: event queues

2010-11-06 Thread Jake Donham
On Sat, Nov 6, 2010 at 3:43 PM, Philippe Strauss wrote: > still in my first cut at rpc, in my app I need to react on a file > descriptor collectings logs for a child process, how do I transform > >let esys = Unixqueue.standard_event_system () in [...] Unixqueue.run esys > > to somethi

Re: [Caml-list] rpc: type conversion

2010-11-05 Thread Jake Donham
On Thu, Nov 4, 2010 at 2:26 PM, Philippe Strauss wrote: > I need to use RPC in a current project of mine, but I don't get how do you > write the type conversion and what is provided, taking a very basic example: > If you are using OCaml on both ends, you might prefer to use orpc: http://jaked

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

2010-10-24 Thread Jake Donham
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, so it can handle thousands > of > clients wi

Re: [Caml-list] Type constraint to explain that a polymorphic variants is included into another

2010-10-08 Thread Jake Donham
On Fri, Oct 8, 2010 at 10:13 AM, Sylvain Le Gall wrote: > This code doesn't compile because I see no way to explain that F.kind is > included into plugin_kind. As you have written it, F.kind is of course completely abstract. I am not sure where you need F.kind to be a strict subtype of plugin_kin

Re: [Caml-list] Chain Camlp4 syntax extensions?

2010-09-28 Thread Jake Donham
On Tue, Sep 28, 2010 at 6:13 AM, Dmitry Bely wrote: > I have two similar syntax extension that generate some functions for > each type in the module: > > EXTEND Gram >  str_item: >    [ [ "type"; tdl = LIST1 type_declaration SEP "and" -> >        ... > END; There is not a good solution without mo

Re: [Caml-list] what do I need to know to understand camlp4

2010-09-23 Thread Jake Donham
On Thu, Sep 23, 2010 at 11:49 AM, ben kuin wrote: > thanks Jake, after browsing through those articles I came to the > conclusion that for understanding and using camlp4 the notion of > quotations and antiquotations is fundamental. My absolute lack of > knowledge in this area might be a reason why

Re: [Caml-list] what do I need to know to understand camlp4

2010-09-23 Thread Jake Donham
On Thu, Sep 23, 2010 at 8:25 AM, bluestorm wrote: > For an accessible introduction to modern (>= 3.10) Camlp4, you may be > interested in Jake Donham's blog post series "Reading Camlp4" : > http://ambassadortothecomputers.blogspot.com/search/label/camlp4 You can also see the articles in sequence

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

2010-09-16 Thread Jake Donham
On Thu, Sep 16, 2010 at 4:05 AM, ben kuin wrote: > Is there a web server interface / adapter for ocaml that abstracts > your application from the various web server implementations? There is no OCaml equivalent to rack / wsgi. It would be nice to have something like this; the existing web framewo

[Caml-list] patterns for 3.12.0

2010-09-07 Thread Jake Donham
Hi list, If you are interested in using Jeremy Yallop's patterns extension on OCaml 3.12.0, I have fixed it up here: http://github.com/jaked/patterns I haven't tried anything serious with it but the tests pass. Also I added a little extension for "alist patterns": a pattern alist [ "foo", x

Re: [Caml-list] ANN: ocamljs 0.3

2010-09-07 Thread Jake Donham
On Sun, Sep 5, 2010 at 6:05 AM, Christophe Papazian wrote: > I was playing with ocamljs. It's very nice to use ocaml to > produce javascript ! I have a question : in ocamljs, there is a support > for style objects. However, I do not see how to use them usefully because > there don't seem to have s

[Caml-list] deriving for 3.12.0

2010-09-03 Thread Jake Donham
Hi list, If you are interested in using deriving on OCaml 3.12.0, I have fixed it up here: http://github.com/jaked/deriving I haven't tried anything serious with it but the tests pass. Jake ___ Caml-list mailing list. Subscription management: http:

Re: [Caml-list] Contribute your Camlp4 knowledge! [was: account for Camlp4 wiki]

2010-09-03 Thread Jake Donham
On Fri, Sep 3, 2010 at 12:07 AM, Hendrik Tews wrote: > Great! Let's collect all our Camlp4 knowledge in this wiki! > Hopefully the wiki can replace the non-existing documentation one > day. For people who haven't seen it, I have a number of Camlp4 articles at http://ambassadortothecomputers.bl

Re: [Caml-list] account for Camlp4 wiki

2010-09-02 Thread Jake Donham
On Sep 2, 2010, at 11:16 AM, Ruslan Ledesma Garza < ruslanledesmaga...@gmail.com> wrote: The first paragraph of http://brion.inria.fr/gallium/index.php/Camlp4 says: [...] nicolas.pouill...@inria.fr Ha, I looked everywhere but there. Thanks! ___ Caml-li

[Caml-list] account for Camlp4 wiki

2010-09-02 Thread Jake Donham
Hi, I would like to make some contributions to the Camlp4 wiki at http://brion.inria.fr/gallium/index.php/Camlp4 but the "login / create account" page does not actually allow an account to be created, and I can't find any contact information on the wiki itself. Can someone help me create an ac

[Caml-list] ANN: ocamljs 0.3

2010-08-26 Thread Jake Donham
Hi list, I am happy to announce version 0.3 of ocamljs. Ocamljs is a system for compiling OCaml to Javascript. It includes a Javascript back-end for the OCaml compiler, as well as several support libraries, such as bindings to the browser DOM. Ocamljs also works with orpc (http://jaked.github.com/

Re: [Caml-list] Delimited continuations in OCaml go to 3.12 and 64

2010-08-23 Thread Jake Donham
On Mon, Aug 23, 2010 at 2:38 PM, Yoann Padioleau wrote: > Is there any tutorial on why such features are useful ? > Concrete examples of their use. For instance can you implement > python generators and its yield stuff by using this library ? Here is an example of a particular use of Delimcc to i

Re: [Caml-list] node.ocaml

2010-08-23 Thread Jake Donham
On Sat, Aug 21, 2010 at 8:27 PM, Jeffrey Barber wrote: > example code: > http://github.com/mathgladiator/node.ocaml/blob/master/test/kvp.ml Have you considered using Lwt (http://ocsigen.org/lwt) as a layer on top of raw continuation-passing style? It has a lot of nice functions for writing asynch

Re: [Caml-list] scalable web apps

2010-07-26 Thread Jake Donham
On Mon, Jul 26, 2010 at 12:59 AM, Jérémie Dimino wrote: > Yes, i tried it some time ago with two small C programs which were just > reading a file on the disk. One doing read operations in a simple loop, > and one launching a thread for each read operation (or reusing the same > thread). The threa

Re: [Caml-list] [Camlp4] Quotation expander with OCaml syntax

2010-07-26 Thread Jake Donham
On Mon, Jul 26, 2010 at 8:41 AM, Raphael Proust wrote: > What I basically need is to get an AST with antiquotations and quotations > being > special nodes. How is this achievable w/o reimplementing a whole grammar? There is already a special node for antiquotations, but not quotations; see below

Re: [Caml-list] [Camlp4] Quotation expander with OCaml syntax

2010-07-26 Thread Jake Donham
On Mon, Jul 26, 2010 at 8:41 AM, Joel Reymont wrote: > What if the quotation is not valid OCaml syntax, e.g. C#, and a Camlp4 parser > for it exists? > > How would I tie it all together to parse the quotation, plug in   > antiquotations and end up with the custom AST that my parser outputs? Ther

[Caml-list] ANN: froc 0.2

2010-05-07 Thread Jake Donham
Hi list, I am happy to announce the release of version 0.2 of the froc library for functional reactive programming in OCaml. There are a number of improvements: * better event model: there is now a notion of simultaneous events, and behaviors and events can now be freely mixed * self-adjusting

Re: [Caml-list] Threads Scheduling

2010-04-13 Thread Jake Donham
On Tue, Apr 13, 2010 at 1:33 PM, Gregory Malecha wrote: > It seems like it should work, but it doesn't work if the function f doesn't > terminate. It seems to be running everything serially. I know that threads > aren't actually parallel, but I thought they were preemptive in which case > it seems

[Caml-list] ANN: orpc 0.3

2010-04-02 Thread Jake Donham
Hi list, I am happy to announce version 0.3 of orpc, a tool for generating RPC bindings from OCaml signatures. Orpc can generate ONC RPC stubs for use with Ocamlnet (in place of ocamlrpcgen), and it can also generate RPC over HTTP stubs for use with ocamljs. You can use most OCaml types in interfa

Re: [Caml-list] Backtracting exceptions in toplevel

2010-03-29 Thread Jake Donham
On Mon, Mar 29, 2010 at 12:15 PM, C. Fr wrote: > It there a way to get a backtrace for exceptions occurring in the toplevel > (for example, getting more information when the stack blows)? I’ve read that > there was an equivalent of the -b option that ocamlrun uses, but I couldn’t > find any subseq

Re: [Caml-list] camlp4

2010-02-09 Thread Jake Donham
On Tue, Feb 9, 2010 at 7:30 AM, Guillaume Yziquel wrote: > http://ambassadortothecomputers.blogspot.com/search/label/camlp4 > > is also a good link, covering the essentials to get started with camlp4, I > think. Thanks for the plug; the series is sadly incomplete but I hope to get back to it very

Re: [Caml-list] Toplevel debugging.

2010-01-23 Thread Jake Donham
On Sat, Jan 23, 2010 at 9:29 AM, Guillaume Yziquel wrote: > I am wondering how to use a debugger with libraries in the toplevel. As > /usr/bin/ocaml is bytecode and that the exception is raised from OCaml and > not from C code, I do not have a backtrace: You may find this patch helpful; it adds b

Re: [Caml-list] Wrapping C code using pthread.

2009-12-28 Thread Jake Donham
On Sun, Dec 27, 2009 at 1:33 PM, Guillaume Yziquel wrote: > If someone knows how to use gdb on a bytecode executable to locate the > segfault in MonetDB's .so file, I'd be quite happy to know. You can just gdb ocamlrun, then run with the bytecode file as argument. (Assuming you are not building i

Re: [Caml-list] A strange typing error with polymorphic variants

2009-10-27 Thread Jake Donham
On Tue, Oct 27, 2009 at 3:28 AM, Marc de Falco wrote: > Hi, I've come across a very strange error, and I'm not sure if it is > a bug or a feature. > > The following code : > type 'a p = R of 'a t | E of float >     and 'a t = { mutable p : 'a p; c : 'a } > let f = >     let x = sqrt(2.0) in >    

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

2009-09-15 Thread Jake Donham
On Tue, Sep 15, 2009 at 5:42 AM, Anil Madhavapeddy wrote: > 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

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

2009-09-03 Thread Jake Donham
On Thu, Sep 3, 2009 at 6:05 AM, Edgar Friendly wrote: > 8) Other (please explain) > Please take this with the caveat that I have little experience with Batteries, but my impression (from following batteries-devel) is that it changes OCaml significantly with Camlp4 extensions, and that it is not

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Jake Donham
On Mon, Aug 24, 2009 at 3:15 PM, Warren Harris wrote: >> Lazy cells don't just defer, they also memoize the returned value once >> the cell is forced. > > Thanks Jake - I guess I overlooked that in the manual. Hope you're doing well. Best of luck on the CUFP talk. Jake __

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Jake Donham
On Mon, Aug 24, 2009 at 2:57 PM, Warren Harris wrote: > 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 () Lazy cells don't just defer, the

Re: [Caml-list] Storing UTF-8 in plain strings

2009-08-12 Thread Jake Donham
On Wed, Aug 12, 2009 at 1:51 PM, Edgar Friendly wrote: >> - If the source is invalid UTF-8 in any way, Ulex will raise Utf8.MalFormed. >>   I can therefore assume in subsequent steps that the source is compliant. >> > This is the weakest assumption of the four - Ulex could parse and only > raise Ma

Re: [Caml-list] Ocamlfind with camlp4r.

2009-07-18 Thread Jake Donham
On Fri, Jul 17, 2009 at 4:18 PM, Serge Leblanc wrote: > ocamlfind ocamlc -o test -package "camlp4" -linkpkg  -syntax "camlp4r" > ./test.ml It's useful to add the -verbose option (after ocamlc) to see what options are passed to camlp4. In this case it's getting the -rp option, which is apparently

Re: [Caml-list] Re: Obj.magic and existential types.

2009-06-22 Thread Jake Donham
On Mon, Jun 22, 2009 at 5:24 PM, Daniel Bünzli wrote: > But in this "chunk" can you repeatedly get external (in the sense primitive) > input ? I looked at your breakout implementation and I think I understand your concern now. In your code there is a top-level select loop that feeds keystrokes and

Re: [Caml-list] Re: Obj.magic and existential types.

2009-06-22 Thread Jake Donham
On Mon, Jun 22, 2009 at 5:24 PM, Daniel Bünzli wrote: > But in this "chunk" can you repeatedly get external (in the sense primitive) > input ? > > Because _if_ you can't then in the breakout game example where you need to > constantly gather (external) time and keyboards events you cannot "pipe" >

Re: [Caml-list] Re: Obj.magic and existential types.

2009-06-22 Thread Jake Donham
On Sun, Jun 21, 2009 at 5:03 PM, Daniel Bünzli wrote: > Does that mean the only values froc knows how to garbage collect are those > values that are dynamically created in an update cycle and not used further > ? (because that's rather contrived IMHO) Everything in froc happens on a "timeline". Wh

Re: [Caml-list] Re: Obj.magic and existential types.

2009-06-21 Thread Jake Donham
On Sat, Jun 20, 2009 at 1:30 AM, Daniel Bünzli wrote: > Theoretically React may also work in browsers via o'browsers > (http://ocsigen.org/obrowser) but I never tried. I have not tried either, but from a cursory glance at the code I have the impression that React's space safety relies on support f

Re: [Caml-list] Re: Obj.magic and existential types.

2009-06-19 Thread Jake Donham
On Fri, Jun 19, 2009 at 11:21 AM, Daniel Bünzli wrote: > Not directly responding to your question but you are looking for functional > reactive programming (frp). > > http://erratique.ch/software/react You can also find FRP in froc (which is quite similar to React; the main difference is that it w

Re: [Caml-list] Uncaught Unix_error.

2009-06-18 Thread Jake Donham
On Thu, Jun 18, 2009 at 7:41 AM, David Baelde wrote: > Also, note that the call to read that raises the error is from the > same module that tries to catch the exception. > > I'm lost, I'd like to understand when the exception is registered: at > runtime initialization? In this case, only one shoul

Re: [Caml-list] Loading RSA public key from DER files in Caml ?

2009-05-05 Thread Jake Donham
On Tue, May 5, 2009 at 9:17 AM, Sébastien Hinderer wrote: > Is there some code available to load an RSA public key from a > .der file ? Maybe this is helpful: http://code.google.com/p/ooauth/source/browse/trunk/pem2cryptokit.c It takes a PEM file containing an RSA key and converts it to a mar

[Caml-list] ANN: ocamljs 0.2 + orpc 0.2 + froc 0.1

2009-04-22 Thread Jake Donham
Hi, I am happy to announce the release of three related projects: ocamljs 0.2: Javascript backend for ocamlc + libraries for web programming orpc 0.2: generates RPC bindings from OCaml signatures (ONC RPC with Ocamlnet or HTTP with ocamljs) froc 0.1: library for functional reactive programm

Re: [Caml-list] quasiquoting: 3 parsers for camlp4 vs 1 for haskell?

2009-04-17 Thread Jake Donham
On Fri, Apr 17, 2009 at 11:24 AM, Joel Reymont wrote: > Can someone shed light on how, where and why three different > parsers are required for camlp4? Is this still the case with 3.11? I haven't read the Mainland paper so I don't know exactly what he's talking about, but with the MetaGenerator m

Re: [Caml-list] antiquotations for c#

2009-04-15 Thread Jake Donham
On Wed, Apr 15, 2009 at 1:49 AM, Joel Reymont wrote: > Suppose I have a camlp4 parser for C#. > > I want to include bits of C# in my code and end up with the AST. > > I want to have "holes" in the above AST to plug in values. > > I understand that antiquotations take car of filling the holes in th

Re: [Caml-list] netplex multi-thread asynchronous processor for passive clients

2009-04-03 Thread Jake Donham
On Fri, Apr 3, 2009 at 10:55 AM, Serge Sivkov wrote: > I 've look through sources of the netplex. For now i clearly see how > synchronious service works, > but i don't understand workflow of anyncronious version of netplex > services (i'm using ocamlnet-2.2.9). Can you explain what you're trying

Re: [Caml-list] camlp4 grammar and LIST1

2009-03-10 Thread Jake Donham
On Tue, Mar 10, 2009 at 3:07 PM, Joel Reymont wrote: > I have it like this at the moment. Are you saying it won't work? Here's an example of what I'm talking about: open Camlp4.PreCast let bar = Gram.Entry.mk "bar" let baz = Gram.Entry.mk "baz" let bar_or_baz = Gram.Entry.mk "bar_or_baz"

Re: [Caml-list] camlp4 grammar and LIST1

2009-03-10 Thread Jake Donham
On Tue, Mar 10, 2009 at 11:41 AM, Joel Reymont wrote: > inputDeclarations: > [ >[ "Input"; ":"; > l = LIST1 inputDeclaration SEP "," -> l >] > ]; > > Is it always necessary to write [ x = inputDeclaration -> x ] instead of > just inputDeclaration? I don't think this is ever necess

Re: [Caml-list] stl?

2009-03-05 Thread Jake Donham
On Thu, Mar 5, 2009 at 12:44 PM, Jon Harrop wrote: > Is this [the lambda IL] format documented anywhere? The ocamljs backend compiles Javascript from the lambda intermediate language. I haven't found documentation of it, but most of it is pretty easy to understand (a few things I've had to track

Re: [Caml-list] Behavior of camlp4o when used with -pp?

2009-02-10 Thread Jake Donham
On Tue, Feb 10, 2009 at 12:20 PM, David Rajchenbach-Teller < david.tel...@ens-lyon.org> wrote: > camlp4o -no_comments foo.ml > > understands option "-no_comments" correctly and pretty-prints the > contents of foo.ml, minus comments > > > However, when using camlp4o as a preprocessor, > > ocamlc -i

Re: [Caml-list] Parsing simple type expressions

2009-01-06 Thread Jake Donham
On Tue, Jan 6, 2009 at 6:03 AM, Paolo Donadeo wrote: > For a serializer I'm writing I need to parse simple OCaml type > expressions composed by OCaml basic types, tuples, options and lists. This is pretty easy with Camlp4, although as you say there isn't much in the docs to point the way. You m

[Caml-list] camlp4 blog posts

2009-01-05 Thread Jake Donham
Hi list, I've started a series of blog posts about Camlp4, containing things learned the hard way, with pointers into the Camlp4 source. Hope you find them interesting and useful. I would be grateful for comments and corrections. http://ambassadortothecomputers.blogspot.com/ Jake

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

2008-11-23 Thread Jake Donham
One more choice is Xmlm: http://erratique.ch/software/xmlm It is simpler than pxp and more complete/correct than xml-light. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http:/

[Caml-list] ANN: orpc 0.1, tool for generating RPC bindings from OCaml signatures

2008-08-28 Thread Jake Donham
you will find it useful. Jake Donham, for Skydeck ___ 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.yahoo.com/group/ocaml_begi

Re: [Caml-list] linking the same module more than once

2008-08-08 Thread Jake Donham
On Thu, Aug 7, 2008 at 11:13 PM, Alain Frisch <[EMAIL PROTECTED]> wrote: > You should really avoid linking two modules with the same name. Yes, I agree vehemently :). I would like the bytecode linker to help me out by (at least) warning me when I do it by accident. Jake _

[Caml-list] linking the same module more than once

2008-08-07 Thread Jake Donham
Hi, Consider the following code: a.ml: let a () = raise (Unix.Unix_error (Unix.E2BIG, "", "")) b.ml: try A.a () with Unix.Unix_error (_,_,_) -> () compiled with ocamlc -o test unix.cma a.ml unix.cma b.ml Run it: > ./test Fatal error: exception Unix.Unix_error(0, "", "") With except

Re: [Caml-list] Q: Profiling ocaml using gprof

2008-07-14 Thread Jake Donham
On Mon, Jul 14, 2008 at 6:52 PM, Raj Bandyopadhyay <[EMAIL PROTECTED]> wrote: > 'camlPervasives__$5e_136'. It's the string concatenation function (ASCII 5E is ^). It allocates a new string and blits the two argument strings into it, so you can probably do much better with explicit use of the Buf

[Caml-list] ANN: ooauth 0.1

2008-07-01 Thread Jake Donham
ck (and have a cell phone with a major American carrier), drop me an email (of course you don't need a Skydeck account to use the OAuth library). Jake Donham, for Skydeck ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-

[Caml-list] camlp4 parser accepts more than its grammar?

2008-06-26 Thread Jake Donham
Hi list, I expected the following program to fail with a parse error, but it happily ignores the extra '+'. I would be grateful if someone could point out what I'm doing wrong. Thanks, Jake open Camlp4.PreCast;; let expr = Gram.Entry.mk "expr";; let stmt = Gram.Entry.mk "stmt";; EXTEND Gram

[Caml-list] surprising type error with labels

2008-06-19 Thread Jake Donham
Hi list, Why does ListLabels.find (fun _ -> true) [];; produce Characters 16-31: ListLabels.find (fun _ -> true) [];; ^^^ This expression should not be a function, the expected type is ('a -> 'b) list I thought the rule was that "if an application is total

Re: [Caml-list] Issue #4265 (Printexc)

2008-05-12 Thread Jake Donham
2008/5/10 Berke Durak <[EMAIL PROTECTED]>: > On Sat, May 10, 2008 at 10:36 AM, Christophe TROESTLER < > [EMAIL PROTECTED]<[EMAIL PROTECTED]>> > wrote: > > > > > Is it what you want: http://caml.inria.fr/mantis/view.php?id=4265 ? > > > That's a very nice thing to have. Please, Xavier, could you ex