caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Malcolm Matalka <mmatalka@gmail.com>
Cc: Romain Bardou <romain.bardou@inria.fr>,
	Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>,
	Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] OCamlPro Highlights: Dec 2013 & Jan 2014
Date: Thu, 6 Feb 2014 10:57:39 +0000	[thread overview]
Message-ID: <D1F5C986-3E18-4CE4-9A5B-5BE0F21D9BDD@recoil.org> (raw)
In-Reply-To: <87sirw1qs2.fsf@gmail.com>

OCamlRes is a much more principled library than crunch -- which
just prettyprints a giant pattern match of strings from a
filesystem tree.

One differentiator of crunch is that it exposes a more system-like
interface, to match the other "real" backends in Mirage (i.e. a
Lwt_cstruct iterator based on Bigarrays, rather than a string).

I have no problem migrating to ocplib-res eventually, except for
a query I've raised on their bugtracker about the licensing:
https://github.com/OCamlPro/ocp-ocamlres/issues/2

best,
Anil

On 6 Feb 2014, at 10:25, Malcolm Matalka <mmatalka@gmail.com> wrote:

> I haven't use either, but what is the important differences between
> crunch and ocamlres?
> 
> Romain Bardou <romain.bardou@inria.fr> writes:
> 
>> 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
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


  reply	other threads:[~2014-02-06 10:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 17:31 Fabrice Le Fessant
2014-02-06  9:43 ` Romain Bardou
2014-02-06 10:25   ` Malcolm Matalka
2014-02-06 10:57     ` Anil Madhavapeddy [this message]
2014-02-06 11:31   ` Benjamin Canou
2014-02-06 13:06     ` Daniel Bünzli
2014-02-06 16:07       ` Benjamin Canou
2014-02-07  1:36         ` Benjamin Canou
2014-02-07 10:48           ` Daniel Bünzli
2014-02-06 10:53 ` Pierre-Étienne Meunier
2014-02-07  9:15   ` Alain Frisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D1F5C986-3E18-4CE4-9A5B-5BE0F21D9BDD@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=fabrice.le_fessant@ocamlpro.com \
    --cc=mmatalka@gmail.com \
    --cc=romain.bardou@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).