From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 7023E7ED34 for ; Fri, 13 Jul 2012 02:27:30 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of berenger@riken.jp) identity=pra; client-ip=134.160.33.162; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of berenger@riken.jp designates 134.160.33.162 as permitted sender) identity=mailfrom; client-ip=134.160.33.162; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of postmaster@postman.riken.jp designates 134.160.33.162 as permitted sender) identity=helo; client-ip=134.160.33.162; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="postmaster@postman.riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlcBALZq/0+GoCGimWdsb2JhbABFuDkBAQEBAQgLCwcUJ4IgAQEEAThAEQsYCRYPCQMCAQIBRRMGAgEBiAMGvXyLQIJagxwDiEmMcYVWjR4 X-IronPort-AV: E=Sophos;i="4.77,577,1336341600"; d="scan'208";a="150501923" Received: from postman2.riken.jp (HELO postman.riken.jp) ([134.160.33.162]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Jul 2012 02:27:28 +0200 Received: from postman.riken.jp (postman2.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id 39BA21260455 for ; Fri, 13 Jul 2012 09:27:25 +0900 (JST) Received: from [172.27.98.103] (rikad98.riken.jp [134.160.214.98]) by postman.riken.jp (Postfix) with ESMTPA id 291A41270063 for ; Fri, 13 Jul 2012 09:27:24 +0900 (JST) Message-ID: <4FFF6B6C.3080901@riken.jp> Date: Fri, 13 Jul 2012 09:27:24 +0900 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: caml-list@inria.fr References: <4FFECB57.9060900@coherentgraphics.co.uk> <4FFEFB0F.5080506@coherentgraphics.co.uk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.7.13.1516 Subject: Re: [Caml-list] Coherent Graphics Product Updates On 07/13/2012 01:44 AM, David MENTRE wrote: > Hello, > > 2012/7/12 John Whitington : >> It's entirely one-way. Objective C calls OCaml. OCaml never calls Objective >> C. > [...] >> Similarly, no complicated OCaml data structures cross the boundary - it's >> all direct ints, floats, strings, and the occasional void*. The possibility >> for programmer error in building big OCaml data structures directly in C >> seems to outweigh the annoyance of a slightly flat interface, at least for >> this particular application. FFI Masters may disagree :-) > > OK, thanks. I immediately thought at more complicated things (e.g. two > processes with a protocol between them) and I did not thought at > OCaml's C interface. Can't you generate the bindings to C code automatically? Aren't there tools for this? >> The multiple PDF files representing different undo/redo states of a document >> are held in memory in OCaml (with most of the data shared between them >> automatically, of course). When the PDF is updated or undone/redone, it's >> flattened to disk, and the PDFKit component in Cocoa picks it up and renders >> it - surprisingly, this is quick enough - it's all in the memory cache >> rather than the actual disk usually, of course. > > That's an interesting way to bypass simple FFI approach. > >> PDFKit (The cocoa PDF component) is only used for rendering - almost every >> other piece of functionality is dealt with by CamlPDF via the FFI. > > Thank you for your detailed and quick answer, > Best regards, > david >