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 2C3B47F84F for ; Sun, 23 Feb 2014 21:18:49 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=pra; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=mailfrom; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@dark.recoil.org) identity=helo; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="postmaster@dark.recoil.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4HAAtXClNZELGaY2dsb2JhbABZDoMzqVuXUwqBHAMYFQY+giUBAQQBeQULC0ZXBgESh30MCcZXEwSOZAeDJIEUAQOYNIpRikQ/PA X-IPAS-Result: Ai4HAAtXClNZELGaY2dsb2JhbABZDoMzqVuXUwqBHAMYFQY+giUBAQQBeQULC0ZXBgESh30MCcZXEwSOZAeDJIEUAQOYNIpRikQ/PA X-IronPort-AV: E=Sophos;i="4.97,530,1389740400"; d="scan'208";a="50165832" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail3-smtp-sop.national.inria.fr with SMTP; 23 Feb 2014 21:18:48 +0100 Received: (qmail 27443 invoked by uid 634); 23 Feb 2014 20:18:47 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from cpc7-cmbg14-2-0-cust238.5-4.cable.virginm.net (HELO [192.168.1.94]) (86.30.244.239) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.84) with ESMTPA; Sun, 23 Feb 2014 20:18:46 +0000 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1812\)) From: Anil Madhavapeddy In-Reply-To: Date: Sun, 23 Feb 2014 20:18:45 +0000 Cc: Ocaml Mailing List Content-Transfer-Encoding: 7bit Message-Id: References: To: Andy Ray , Leo White X-Mailer: Apple Mail (2.1812) X-Virus-Checked: Checked by ClamAV on dark.recoil.org Subject: Re: [Caml-list] camlp4 for js_of_ocaml toplevels On 22 Feb 2014, at 03:07, Andy Ray wrote: > Hi, > > Is anyone working on making camlp4 extensions available in a > js_of_ocaml toplevel? > > I have seen the work the OCamlPro guys have done to get pa_js going by > hacking the compiler itself - serious kudos for that! > > Is there a reason why that's easier than js_of_ocaml compiling a > (static) version of camlp4? Leo White put together a custom compiler frontend for just this use case a while back: https://github.com/lpw25/ocaml-with-pp The idea is that you build this with a static set of camlp4 extensions, and it runs the input through camlp4 and then passes the AST directly through to the compiler (via compiler-libs). It should be reasonably easy to adapt this to a toplevel model as well -- let us know if you need a hand. -anil