From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 722EB7F02D for ; Sat, 11 Oct 2014 22:00:18 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@bluechip4.ukhost4u.com) identity=helo; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluechip4.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMCANCLOVS8QLgoaWdsb2JhbABfg2FYy1aIURYBEQ0HDQc5CYRCQD0WGAMCAQIBS4hVAQiaJqRNlRYFljuIeoV8hHaNLWuCSgEBAQ X-IPAS-Result: AvMCANCLOVS8QLgoaWdsb2JhbABfg2FYy1aIURYBEQ0HDQc5CYRCQD0WGAMCAQIBS4hVAQiaJqRNlRYFljuIeoV8hHaNLWuCSgEBAQ X-IronPort-AV: E=Sophos;i="5.04,700,1406584800"; d="scan'208";a="100627970" Received: from bluechip4.ukhost4u.com ([188.64.184.40]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Oct 2014 22:00:18 +0200 Received: from [86.26.5.13] (port=58616 helo=[192.168.0.3]) by bluechip4.ukhost4u.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.82) (envelope-from ) id 1Xd2pr-00494N-TR for caml-list@inria.fr; Sat, 11 Oct 2014 21:00:15 +0100 Message-ID: <54398C4F.4020707@coherentgraphics.co.uk> Date: Sat, 11 Oct 2014 21:00:15 +0100 From: John Whitington User-Agent: Postbox 3.0.11 (Macintosh/20140602) MIME-Version: 1.0 To: "caml-list@inria.fr" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluechip4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Get-Message-Sender-Via: bluechip4.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk Subject: [Caml-list] ANN: ppx_blob v0.1 Hi, Ppx_blob is an OCaml ppx to include a binary blob from a file as a string. Writing [%blob "filename"] will replace the string with the contents of the file at compile time. This allows the inclusion of arbitary, possibly compressed, data, without the need to respect OCaml's lexical conventions. This allows for smaller executables, and a proper separation of data and code. https://github.com/johnwhitington/ppx_blob (Shortly with "opam install ppx_blob") You will need OCaml version 4.02 or later. For example, assuming the existence of "META" in the current directory: OCaml version 4.02.0 # #use "topfind";; # #require "ppx_blob";; # let meta = [%blob "META"];; val meta : string = "name=\"ppx_blob\"\ndescription=\"Include a file as a string at compile time\"\nversion=\"0.1\"\nrequires=\"ppx_tools\"\nppx=\"./ppx_blob\"\n" The example that comes with ppx_blob is the little quine: print_string [%blob "quine.ml"] Thanks, John Whitington