Re: [Caml-list] Private types

2008-10-30 Thread Jérémie Dimino
"David Allsopp" <[EMAIL PROTECTED]> writes: > I thought that the point of private types was that you could > deconstruct them... so values of type M.t are valid wherever an int > is used but not the converse. It should probably be ok for immutable data but not for mutable ones. One example is usi

Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?

2008-11-05 Thread Jérémie Dimino
t all the C++isms of Qt in the ocaml application. - this would make Qt available to any languages that have DBus. For ocaml i am currently writing a pure ocaml DBus implementation [2]. [1] http://en.wikipedia.org/wiki/D-Bus [2] http://forge.ocamlcore.org/projects/obus/ -- Jérémie Dimi

Re: [Caml-list] New language feature in OCaml 3.11

2008-12-05 Thread Jérémie Dimino
On Fri, Dec 05, 2008 at 12:57:42PM +0100, Paolo Donadeo wrote: > > - Subtyping is now allowed between a private abbreviation and its > > definition, > > and between a polymorphic method and its monomorphic instance. > > Is there anybody who wants to elaborate this with an example, > especially th

Re: [Caml-list] What is a future of ocaml?

2009-01-14 Thread Jérémie Dimino
Dawid Toton writes: > Make record fields acting as projection functions? This can be done with camlp4 + type-conv, i put an example here: http://www.dimino.org/projection.tar.gz Jérémie ___ Caml-list mailing list. Subscription management: http://yqu

Re: [Caml-list] Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version?

2009-01-29 Thread Jérémie Dimino
Jan Kybic writes: > Good morning. I have looked at ocamlopt and it looks very useful. > Are there any plans to include macro expansion in ocamlopt? Right now there is no plan for that. My only intention when i started optcomp was conditional compilation, and i made choices making it incompatib

Re: [Caml-list] Parsing 64-bit ints in 32-bit OCaml

2009-03-07 Thread Jérémie Dimino
Jon Harrop wrote: > Is there a better workaround? A (maybe overkill) solution is to use optcomp [1]. What you have to do is to add word_size variable: Pa_optcomp.define "word_size" (Int Sys.word_size) Then you can write: let gcd3 = #if word_size = 32 715827883 #elif word_size = 64

Re: [Caml-list] Reference to undefined global `Camlp4_config'

2009-03-11 Thread Jérémie Dimino
Joel Reymont wrote: > ocamlfind ocamlc -package 'oUnit, extlib, *camlp4*' -linkpkg -g src/ > easy_ast.cmo src/easy_code.cmo src/easy_lexer.cmo src/easy_symtab.cmo > src/token.cmo src/static1.cmo src/easy_parser.cmo src/test_tools.cmo > src/parser_test.cmo src/test.cmo -o src/test.byte > File "

Re: [Caml-list] Int64 comparison

2009-03-17 Thread Jérémie Dimino
Le mardi 17 mars 2009 à 08:51 -0400, Elnatan Reisner a écrit : > Do the polymorphic ordering functions -- (<), (>), etc. -- correspond > to the numerical ordering for Int64s and Int32s? I assume so, but I > didn't see this specified anywhere. Yes, int64s and int32s are represented in memory by

Re: [Caml-list] printf "%a" vs sprintf "%a"

2009-03-26 Thread Jérémie Dimino
Tiphaine Turpin wrote: > has type string. But %a breaks this rule. Wouldn't it be simpler to have > two separate directives which accept respectively string printers and > channel printers, regardless of the outer printing function ? Note that you can do it with batteries and the new printf. The

Re: [Caml-list] How to achieve this camlp4 syntax extension

2009-04-02 Thread Jérémie Dimino
Conglun Yao wrote: > I tried to achieve the following syntax extension, but failed. > > Add expression .[ ] after a module name, inside .[ ] I want to refer > to the specified module, like > > let _ = M1.M2.[ here is my syntax, using M1.M2 module ] You should have a look at delimited overloadin

Re: [Caml-list] storing object in record

2009-04-08 Thread Jérémie Dimino
Michael wrote: > it seems that I'm not able to figure out how to do this: > > class baseclass = object(this) > method asBase = (this :> baseclass) > (* ... *) > end;; > > class ex = object inherit baseclass method name = "ex" end > > type state_rec = { mutable state: 'a. #baseclass as '

Re: [Caml-list] storing object in record

2009-04-08 Thread Jérémie Dimino
Le mercredi 08 avril 2009 à 12:29 +0200, Michael a écrit : > > There is no value of type: forall 'a. #baseclass as 'a. > > is this similar? : > > type 'a xx = 'a constraint 'a = < asBase: baseObject; .. > ;; > > (why does: type 'a xx = < asBase: baseObject; ..> as 'a not work instead? ) No,

Re: [Caml-list] interface mismatch on camlp4_import

2009-04-15 Thread Jérémie Dimino
Joel Reymont wrote: > Camlp4: Uncaught exception: DynLoader.Error ("/usr/local/lib/ocaml/ > site-lib/ocsigen/xhtmlsyntax.cma", "interface mismatch on > Camlp4_import") > > What does this mean and how do I fix it? This means that xhtmlsyntax.cma requires a different version of the Camlp4_import

Re: [Caml-list] Creating an lwt toplevel

2009-10-06 Thread Jérémie Dimino
Hello, Le mardi 06 octobre 2009 à 16:48 +0200, Alan Schmitt a écrit : > I am trying to experiment with some code that uses lwt, and I would > like to do it in a toplevel. Unfortunately I seem to be missing a > step. Here is what I tried: > > # #load "unix.cma";; > # #load "/Users/schmitta/godi/li

Re: [Caml-list] Constructors are not functions

2009-10-06 Thread Jérémie Dimino
Le mardi 06 octobre 2009 à 14:01 +0200, Chantal KELLER a écrit : > Dear Ocaml users, > > Is there a reason for constructors not to behave like functions? For > instance, one cannot make a partial application from a constructor: > > # type foo = | Bar of int;; > type foo = Bar of int > # let foo

Re: [Caml-list] Re: Recursion on React.events.

2009-12-11 Thread Jérémie Dimino
Le jeudi 10 décembre 2009 à 23:24 +0100, Guillaume Yziquel a écrit : > Yes. It's also here where I worry about a few things concerning Lwt: > > In Lwt, you have a monadic way to do context switches for multithreading > withing a single real thread. So if you use Lwt inside the update cycle, > yo

Re: [Caml-list] Toplevel debugging.

2010-01-25 Thread Jérémie Dimino
Le samedi 23 janvier 2010 à 18:29 +0100, Guillaume Yziquel a écrit : > >> # Fatal error: exception Sys_blocked_io > >> yziq...@seldon:~/git/mlgame$ It is because mlgame set stdin into non-blocking mode (file input.ml, line 81) and the toplevel does not support that. If you want to be able to put

Re: [Caml-list] camlp4 infix let

2010-04-07 Thread Jérémie Dimino
Hi, Le mercredi 07 avril 2010 à 15:05 -0400, Jacques Le Normand a écrit : > Dear List, > I'm writing a camlp4 syntax extension and I'd like to write > > <:expr< let ( >>= ) = Bar.( >>= ) in 5 >> > > but camlp4 complains: > > While expanding quotation "expr" in a position of "expr": >

Re: [Caml-list] scalable web apps

2010-07-26 Thread Jérémie Dimino
On Mon, Jul 26, 2010 at 10:29:04AM +0300, Török Edwin wrote: > Lwt's Lwt_preemptive seems to allow one to use 'preemptive > threads' (which I assume are just usual OCaml threads). > So would it be possible to put the file I/O on Lwt_preemptive.detach > threads? Yes. > Has anyone tried to measure

Re: [Caml-list] scalable web apps

2010-07-26 Thread Jérémie Dimino
On Mon, Jul 26, 2010 at 11:19:20AM +0300, Török Edwin wrote: > How about using linux's AIO and eventfd? Linux's AIO are Linux specific and not implemented on all file-systems, so i am not sure it is the best way to go. Best, -- Jérémie ___ Caml-list

Re: [Caml-list] scalable web apps

2010-07-26 Thread Jérémie Dimino
On Mon, Jul 26, 2010 at 12:57:55PM -0700, Jake Donham wrote: > > BTW it is planed to add some kind of asynchronous file I/O support in > > Lwt by using mmap and mincore. > > How would this work? Is it possible to be notified when the page comes > into core (mincore appears to support only polling)

Re: [Caml-list] LablGtk 2.14.2

2010-09-17 Thread Jérémie Dimino
The link to download the tarball seems to be broken: it ends with lablgtk-2.14.2.gz instead of lablgtk-2.14.2.tar.gz On Fri, Sep 17, 2010 at 05:59:19PM +0900, Jacques Garrigue wrote: > Dear Camlers, > > Following a number of bug fixes, and particularly a serious > incompatibility in ocaml 3.12 (d

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

2010-10-24 Thread Jérémie Dimino
On Sun, Oct 24, 2010 at 01:54:50PM -0700, Anil Madhavapeddy wrote: >This should work fine for a couple of thousand clients or so, but you'll >begin to see degradation as the number of clients increase. This is >because LWT internally uses select(2) to wait for file-descriptors, and >

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

2010-10-25 Thread Jérémie Dimino
On Mon, Oct 25, 2010 at 10:42:05AM +0200, Goswin von Brederlow wrote: > Doesn't that mean you have to do polling of all pending I/O? That seems > horrible ineficient (you check them all every time) or slow I/Os can > starve quick ones (you only check the oldest ones). No. In the current implementa

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

2010-10-25 Thread Jérémie Dimino
On Mon, Oct 25, 2010 at 11:34:41AM -0400, Yaron Minsky wrote: >I don't quite understand how this whole benchmark holds together.  Could >you post the C code?  I don't understand the differences between (1), (2) >and (3) well enough to explain where the factor of 100 comes in. Yes. Here

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

2010-10-27 Thread Jérémie Dimino
On Wed, Oct 27, 2010 at 11:33:51AM +0200, Goswin von Brederlow wrote: > You aren't doing any multithreading. You are creating a thread and > waiting for the thread to finish its read before strating a second. > There are never ever 2 reads running in parallel. So all you do is add > thread creation

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

2010-10-28 Thread Jérémie Dimino
On Thu, Oct 28, 2010 at 11:00:59AM +0200, Goswin von Brederlow wrote: > Hehe, and you have prooven yourself wrong. As you said, when the file > isn't cache and the syscall actually blocks there is no time > difference. The reasons being that the blokcing takes the majority of > time anyway and the

Re: [Caml-list] Looking for stubs for sendmsg/recvmsg

2010-11-19 Thread Jérémie Dimino
On Thu, Nov 18, 2010 at 06:40:51PM +0100, Goswin von Brederlow wrote: > I'm looking for stubs for > >ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); >ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); > > Specifically I need those to send (among normal m

Re: [Caml-list] Lwt_pool usage

2010-11-25 Thread Jérémie Dimino
On Thu, Nov 25, 2010 at 07:48:49PM +0300, Sergey Plaksin wrote: >What's wrong in code? Why it raise Canceled exception? It was a bug in Lwt 2.1.1, it has been fixed in the development version. Cheers, Jérémie ___ Caml-list mailing list. Subscriptio

Re: [Caml-list] install lwt in solaris

2010-11-25 Thread Jérémie Dimino
On Thu, Nov 25, 2010 at 05:26:21PM -0500, HP Wei wrote: > I got errors of the type: no member named 'blah'. > > one example: > > src/unix/stubs/lwt_unix_stubs.c:159 error: 'struct msghdr' > has no member named 'msg_controllen' > > --- > > How do I make it

[Caml-list] [ANN] Lwt 2.2.0 released

2010-12-13 Thread Jérémie Dimino
buffer. Lwt_io.make now takes a function that uses a bigarray. * Add module {{{Lwt_switch}}} Enjoy! -- Jérémie Dimino, on behalf of the Lwt team ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo

[Caml-list] [ANN] OBus 1.1

2010-12-13 Thread Jérémie Dimino
Hi, I'm happy to announce the release 1.1 of OBus, a pure OCaml implementation of the D-Bus protocol. OBus aims to make it easy to use and provide D-Bus services in OCaml. It can generate interfaces to D-Bus services from introspection files, it provides integration of D-Bus methods, signals and

Re: [Caml-list] [ANN] OBus 1.1

2010-12-13 Thread Jérémie Dimino
On Mon, Dec 13, 2010 at 05:47:09PM +0100, David MENTRE wrote: > Are there any example of the use of OBus? There are small examples in the archive. I don't think there are yet applications using it, except one i wrote as part of the control system of a robot. > Was OBus written for certain applica

Re: [Caml-list] [ANN] Lwt 2.2.0 released

2010-12-16 Thread Jérémie Dimino
On Thu, Dec 16, 2010 at 05:05:31PM +0100, Gregory Bellier wrote: > I can't build lwt 2.2.0 while I successfully built 2.1.1 > > Here is the error I got (no such file or directory), followed by my > configuration : > > + ocamlfind ocamlc -c src/unix/lwt_unix_stubs.c > In file included from src/uni

Re: [Caml-list] [ANN] OBus 1.1

2010-12-16 Thread Jérémie Dimino
On Thu, Dec 16, 2010 at 05:15:18PM +0100, Gregory Bellier wrote: > - Is OCaml 3.12 really required to be able to build it ? Yes. If you are using debian there is a repository with ocaml 3.12 here: http://ocaml.debian.net/debian/ocaml-3.12.0 > - By the way, I got this with Ocaml 3.11.1 and lwt

Re: [Caml-list] Re: [ANN] OBus 1.1

2010-12-16 Thread Jérémie Dimino
On Thu, Dec 16, 2010 at 04:23:21PM +, Sylvain Le Gall wrote: > I think Jeremie should add: > > OASISVersion: >= 3.11.2 > > to its _oasis file. Yes, i did not know this option (it is OCamlVersion by the way), thanks. -- Jérémie ___ Caml-list mai

Re: [Caml-list] [ANN] Lwt 2.2.0 released

2010-12-16 Thread Jérémie Dimino
On Thu, Dec 16, 2010 at 05:54:52PM +0100, Hans Ole Rafaelsen wrote: > Does this added requirement limit its portability to other platforms e.g. > Windows? No, libev should work on Windows. -- Jérémie ___ Caml-list mailing list. Subscription management

Re: [Caml-list] Lwt and OCamlMakefile

2010-12-21 Thread Jérémie Dimino
On Mon, Dec 20, 2010 at 09:36:39PM -0500, orb...@ezabel.com wrote: > Thanks, I forgot to mention that I am setting that: > > (*pp camlp4o pa_lwt.cmo *) This one should work: (*pp camlp4o `ocamlfind query -i-format lwt` `ocamlfind query -predicates syntax,preprocessor -a-format -r lwt.syntax`

Re: [Caml-list] Lwt and Tuareg mode

2010-12-21 Thread Jérémie Dimino
On Tue, Dec 21, 2010 at 01:54:32PM -0500, orb...@ezabel.com wrote: > Are there any modified versions of Tuareg mode to work with Lwt > syntax extensions? I looked around but didn't see anything. I > don't know Emacs lisp particularly well but will try to hack > something out of nothing exists. T