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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 21A727F7C2 for ; Thu, 6 Feb 2014 10:43:21 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain.bardou@inria.fr) identity=pra; client-ip=188.165.53.149; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="romain.bardou@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain.bardou@inria.fr) identity=mailfrom; client-ip=188.165.53.149; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="romain.bardou@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mo2.mail-out.ovh.net) identity=helo; client-ip=188.165.53.149; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="postmaster@mo2.mail-out.ovh.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqEBAOJY81K8pTWVnGdsb2JhbABZg0S/RIEdDgEBAQEBBg0JCRQogiUBAQUnCwFFARALGAkWDwkDAgECATcBDQYNAQcCiAUBCM5SjkczB4Q4BJgrgTKFPo5f X-IPAS-Result: AqEBAOJY81K8pTWVnGdsb2JhbABZg0S/RIEdDgEBAQEBBg0JCRQogiUBAQUnCwFFARALGAkWDwkDAgECATcBDQYNAQcCiAUBCM5SjkczB4Q4BJgrgTKFPo5f X-IronPort-AV: E=Sophos;i="4.95,792,1384297200"; d="scan'208";a="47994407" Received: from 2.mo2.mail-out.ovh.net (HELO mo2.mail-out.ovh.net) ([188.165.53.149]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Feb 2014 10:43:20 +0100 Received: from mail632.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo2.mail-out.ovh.net (Postfix) with SMTP id 3C6A0FFAC8B for ; Thu, 6 Feb 2014 10:43:20 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 6 Feb 2014 11:43:20 +0200 Received: from unknown (HELO ?10.1.202.10?) (postmaster@doomeer.com@194.254.61.161) by ns0.ovh.net with SMTP; 6 Feb 2014 11:43:17 +0200 Message-ID: <52F35934.5070306@inria.fr> Date: Thu, 06 Feb 2014 10:43:16 +0100 From: Romain Bardou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Fabrice Le Fessant CC: Ocaml Mailing List References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 6428044044173544169 X-Ovh-Remote: 194.254.61.161 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrjedvucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrjeehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Validation-by: romain@bardou.fr Subject: Re: [Caml-list] OCamlPro Highlights: Dec 2013 & Jan 2014 On 05/02/2014 18:31, Fabrice Le Fessant wrote: > Hi, > > Here is the link to OCamlPro's report on its activities in January > 2014 on OCaml: > > http://www.ocamlpro.com/blog/2014/02/05/monthly-2014-01.html > > --Fabrice > Interesting read. Regarding OCamlRes... - It like the idea. I already have one use case: images for my GTK icons. - There is no .mli in your src directory, it makes your code less readable (even empty .mli files are interesting, they tell the reader that the module is the main module). - Because of the above I was not able to find out what ocplib-ocamlres provided. - Maybe this is handled by ocplib-ocamlres, but it would be nice if there was a way to include resources in the executable at first, and then, if the project becomes bigger, have a way to externalize (some of) those resources without changing the code. So we would have some function such as: val load_resource: string -> string taking the resource path (e.g. "res/a/x/test.int") and returning the contents of the file, either by actually reading an external file, or just by returning a string which was included at compile-time. It could be as simple as: let load_resource path = try Hashtbl.find included_resources path with Not_found -> let ch = open_in path in ... where included_resources is a hash table filled by ocp-ocamlres. (I don't think it is very interesting to keep the directory hierarchy, but maybe it is for some use cases.) - I would probably write a file containing the list of resource files I want to include (one per line), and in my build system, add a rule saying how to obtain an .ml file from it using ocp-ocamlres. It would protect the user from including trash such as Emacs autosaves (~ files — although mines are in a different directory :) ) or Windows Thumbs.db files or whatever. You can't be sure what's inside your "res" directory! Maybe your tool could read such a file itself to make it easier and more unified. Cheers, -- Romain Bardou