From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3C97DBC37 for ; Fri, 12 Feb 2010 23:02:14 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUBAGpedUtV2gB4mWdsb2JhbACDBJgUAQEBAQEICwoHEyOva485gS+CTlsEiWA X-IronPort-AV: E=Sophos;i="4.49,463,1262559600"; d="scan'208";a="56961606" Received: from emailfrontal1.citycable.ch ([85.218.0.120]) by mail4-smtp-sop.national.inria.fr with SMTP; 12 Feb 2010 23:02:13 +0100 Received: from [192.168.0.12] (unknown [85.218.92.99]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal1.citycable.ch (Postfix) with ESMTPA id E8CF012C1FB; Fri, 12 Feb 2010 23:02:11 +0100 (CET) Message-ID: <4B75D001.5080502@citycable.ch> Date: Fri, 12 Feb 2010 23:02:41 +0100 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: OCaml List , r-devel@r-project.org Subject: [ANN] OCaml-R binding for the R language. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; guillaume:01 guillaume:01 ocamldoc:01 ocaml:01 maxence:01 guesdon:01 ocaml:01 findlib:01 initialise:01 statically:01 ocamlopt:01 -package:01 initialises:01 compile-time:01 low-level:01 This post is to announce the 0.2 release of OCaml-R. OCaml-R is a binding embedding the R interpreter into Objective Caml code. Home page: http://home.gna.org/ocaml-r/ Download page: http://download.gna.org/ocaml-r/ Deb packages: http://yziquel.homelinux.org/debian/pool/main/o/ocaml-r/ Tutorial: http://home.gna.org/ocaml-r/gettingstarted.en.html OCamlDoc API: http://yziquel.homelinux.org/topos/api/ocaml-r/index.html http://home.gna.org/ocaml-r/refdoc/index.html The goal of OCaml-R is to provide adequate integration of the R interpreter into Objective Caml, and a framework suitable to bind R library into OCaml code. Version 0.2 is a near-complete rewrite of the 0.1 version by Maxence Guesdon, with an incompatible API. Main features are: - Safe handling of R default environment variables at compile time, following what is done in littler. - R Signal handlers do not conflict with OCaml code. - Integration with findlib, enabling the #require "R.interpreter" to initialise statically the R interpreter. Compiling with 'ocamlfind ocamlopt -package R.interpreter' also initialises the R interpreter at compile-time, so to speak. - Some (most?) functionalities of the R standalone library are wrapped. - Low-level binding, in the sense that you construct low-level R calls to execute them. You can also parse R code to execute it, if you wish. - R exceptions are chained back to Objective Caml. - R's garbage collector is chained with OCaml's garbage collector. This is done rather inefficiently for the moment (freeing n R values in O(n^2) time complexity), and we expect to bring this down to O(n) with a thin garbage collecting layer in the future. - We provide a double typing scheme, with some subtyping features. A first typing mimics the dynamic typing of the R language, while a second typing, for the end-user, aims at providing a static typing of R values and functions. (This can be bettered). - S3 classes are supported (static typing is however still unsatisfying). S4 classes are not yet supported. Help welcome. - Some basic R datatypes, such as dataframes, are wrapped, and a framework to wrap the standard library has been put in place. - Basic data structures can be converted back and forth between OCaml and the R interpreter. - Ability to inspect (read-only) the inner structure of R values, which is quite convenient: you get to know rather quickly what a given piece of R code returns, which you need to know to type R code statically in order to bind it to OCaml. - Not thread-safe at all. At least, not more than R is... Lwt-style multithreading of R code could be possible, modulo some simple and deep (i.e. below R API) changes in the R evaluation functions. POSIX threading a single R thread with multiple OCaml threads is not yet possible, but is within reach. - Doesn't interact well the R "Defaults" package. While most of the code sticks or could stick to the R API, or at least to the public part of the R headers, there are some functionalities which are outright out of the scope of the R API. Some of these functionalities are for convenience only (i.e. inspecting internals of R values), while others are crucial to the binding (chaining R exceptions to OCaml). Hopefully, this lays down a foundation on which one could import R functionalities, libraries and packages to OCaml. -- Guillaume Yziquel http://yziquel.homelinux.org/