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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C81EC82355 for ; Wed, 10 Jan 2018 11:20:25 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=christoph.hoeger@celeraone.com; spf=Pass smtp.mailfrom=christoph.hoeger@celeraone.com; spf=None smtp.helo=postmaster@mail-vk0-f44.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@celeraone.com) identity=pra; client-ip=209.85.213.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@celeraone.com"; x-sender="christoph.hoeger@celeraone.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of christoph.hoeger@celeraone.com designates 209.85.213.44 as permitted sender) identity=mailfrom; client-ip=209.85.213.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@celeraone.com"; x-sender="christoph.hoeger@celeraone.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vk0-f44.google.com) identity=helo; client-ip=209.85.213.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@celeraone.com"; x-sender="postmaster@mail-vk0-f44.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A0aFu+hadqR3cmm3zBy8l8jn/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZr827bnLW6fgltlLVR4KTs6sC17KP9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCagbb9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhz?= =?us-ascii?q?sGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJVyJPDICy?= =?us-ascii?q?YZYRAeUdJutXtZXxqkEUoBeiGQWhBuXiwSJIiH/s2q061vwsHB/G3Aw6HtIOq2?= =?us-ascii?q?jUrNLtNKcSSe+7zq/QzTrdYPNMxDzw75THchA7ofGNRrJwbc3RyVEvFw/fjlWQ?= =?us-ascii?q?rpLqPzyL2eQXqGWU8/RvVeaxhG49sQ5xpT6vydk2hobVgYIVz0nJ+CNky4g2Pd?= =?us-ascii?q?21UFB3bcKgHZdKtCyXN5F6Tt0/T2xmoio3xbILtJimdyYQ0psn3QTQa/mffoiI?= =?us-ascii?q?/B3jUOGRLC99hH1/ebK/gw++8VajyuHgT8W03llHoyVfntnDsXAN0BPT6syZRf?= =?us-ascii?q?dn4kih3jOP2xjS6uFCP080ibLWJ4A9zrM0jJYeskTOEjXolEnrgqKabEop9+ew?= =?us-ascii?q?5+TieLrmp5ucN4FuigH5N6QjgtCwAeQiMggPRGib5eO81KXj/UHjQLVKieM5kq?= =?us-ascii?q?bHv5DAPskUurC2AwtL3YY58Rm/CDGm38oCkXYbK1JFfQqLj5L1NFHWPPD4EfC/?= =?us-ascii?q?jkywnzhxwvDGOqTtApHMLnjYjLfsZq196k5ZyAor199T/ZNUCrcbIPLyQED9rt?= =?us-ascii?q?LYDgVqezCzlsHMAdB5nqYXWGaOBKDRFKLJrRfc7esqJ6yIZZQJkDf7MfksofD0?= =?us-ascii?q?2ywXg1gYKIKpx5oMdHegHsNGvUqUezK4idcbEHwWuRI+CuzthVKPSxZYanK/Ra?= =?us-ascii?q?s74Dx9A4WjW9SQDruxiaCMiX/oVqZdYXpLXxXVSS+xJte0HswUYSfXGfdP1zkN?= =?us-ascii?q?VLyvUYgkjEz8vwL+xqBuKezZvCYfsMC6jYQn16jojRg3sAdMIYGFyWjUEjN/k2?= =?us-ascii?q?cFXTYx2q05qkt4mA/ajPpIxsdAHNkW3MtnFwc3MZmGkr5/AtH2HxzCJpKHFArg?= =?us-ascii?q?TdKhDjU8CNk2xo1Wbg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DrAgDs51VahizVVdFdHgEGDIMRggonB?= =?us-ascii?q?4QAgTmXSZNfhVEUgSMDXAqJcwdAFwEBAQEBAQEBAQESAQEBCAsLCCgvgjgkAYJ?= =?us-ascii?q?wHQEBOB4BBjcCJBIBBQEiJ4ofoj5AiyNugieDCgEBBYVBgg8IEoQOghWLVASDT?= =?us-ascii?q?4Jlo2mVRZQOlw0UBSCBFyABggdvgQQGgXKCBAw1H4F0QDcBi18BAQE?= X-IPAS-Result: =?us-ascii?q?A0DrAgDs51VahizVVdFdHgEGDIMRggonB4QAgTmXSZNfhVE?= =?us-ascii?q?UgSMDXAqJcwdAFwEBAQEBAQEBAQESAQEBCAsLCCgvgjgkAYJwHQEBOB4BBjcCJ?= =?us-ascii?q?BIBBQEiJ4ofoj5AiyNugieDCgEBBYVBgg8IEoQOghWLVASDT4Jlo2mVRZQOlw0?= =?us-ascii?q?UBSCBFyABggdvgQQGgXKCBAw1H4F0QDcBi18BAQE?= X-IronPort-AV: E=Sophos;i="5.46,339,1511823600"; d="scan'208,217";a="308412286" Received: from mail-vk0-f44.google.com ([209.85.213.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Jan 2018 11:20:24 +0100 Received: by mail-vk0-f44.google.com with SMTP id l63so11215781vke.5 for ; Wed, 10 Jan 2018 02:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=celeraone-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=7PA3B187MnJAT1N3F2bV0D8eznezlqXnYQ6RG1Gn6Ww=; b=b1W5p5Fa3/ToJMMiJeua4PzQUizwabMeSUHJyGbuOfvQdIdSu/WE5j88RpFzKX1mNN dDMoWPdTJZ2o+bQBSiRBrxwOnYnYYnxvv4mA2KptnZsDazOm3k3RLJCNEULLhTMDJpsR 4vliucUqifzY1jm6QI0wOOhZ3BQ2AGl39/w1y6G3vjw7eizqb752uhwVCRoIWdCy+dUt imtbWv4Ix545cZG/2w3OhEKPRrVwpZfuzcaQfIfqa4ELE8UJ1a7cgfHdExbMrEDP2j3r t/s/TyWjlQpp33/x4//cfQaVw5IAJOWSg0VERx+L7JRoyxVIuyCVdyR+adXr5/cfpNB9 1DZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7PA3B187MnJAT1N3F2bV0D8eznezlqXnYQ6RG1Gn6Ww=; b=WUYvRhsLfTVuyyxfzFzADjI6uNORwdRuKlWR0NchXLVnxKgThgasbJ6uDTnA5ZksGp 3IZiorAO0SvNT6NcdYhn6KOZRIFaCWBf7oZH2z54wfV/i3LAq23fwiAup1fHy2OCFdUZ VaaNYxql2jJ3YrGehEX6hqxvLBzWTNTPlVjh5rr9A6MhfEC4hv6t3+4xL76eHZ7nibqJ xWP4JkDKfTvKEaO03CnfNXctdjkQpzpfIP9MdR4plAl5LsVZ05yTh6vC8RaV4YF3xMJ4 CLQNBLUKKmZmJY5rpat5qk6K+kVEY2O/aYPQvXyEEhg/88bKXRj+ja6uwiqidsnswGzf BNGQ== X-Gm-Message-State: AKwxytfgSI02eMr5ihPh8YuCEOrFpdCbAl0z939QcriBrqmMTMfp4VuB 3ctIFvs6F1l3JFHAuOFmMi85QnbI4gSuNvwByR7VNO3+ X-Google-Smtp-Source: ACJfBovJqNch31hqqEl5Mv3TpXVsQlRGnoXmsF/yRIi+F7bzI4fDvNqFSXfGtSXagi8ypZ9/3DT4xRcHRrlI4yGT7aw= X-Received: by 10.31.220.67 with SMTP id t64mr16396171vkg.103.1515579623137; Wed, 10 Jan 2018 02:20:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.65.67 with HTTP; Wed, 10 Jan 2018 02:20:22 -0800 (PST) From: =?UTF-8?Q?Christoph_H=C3=B6ger?= Date: Wed, 10 Jan 2018 11:20:22 +0100 Message-ID: To: OCaml Mailing List Content-Type: multipart/alternative; boundary="94eb2c07bdf21102870562696168" Subject: [Caml-list] In-memory assembly --94eb2c07bdf21102870562696168 Content-Type: text/plain; charset="UTF-8" Dear all, I want to trigger OCaml compilation programmatically from a C++ application and avoid the usage of subprocesses. It is fairly straightforward to generate an OCaml AST, but I cannot compile it. 1. The relevant modules/libraries do not load utop # #require "compiler-libs.optcomp";; Error: Reference to undefined global `Location' X86_masm.generate_asm stdout [] ;; 2. The relevant modules seem to insist on file i/o for communication (i.e., they use out_channel objects) Does anyone know a simple way around these issues? a) Can I load the optcomp library without modifying the compiler (or with some simple modifications) b) Is there a way to create an out_channel from a memory buffer? thanks, Christoph ps: If the answer to both questions is "no", I would be willing to work with the community and enhance the compiler if I could get some advice on how to do it best and if such a modification is wanted. --94eb2c07bdf21102870562696168 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear all,
=
I want to trigger OCaml compilation programmatically from a C++ a= pplication and avoid the usage of subprocesses. It is fairly straightforwar= d to generate an OCaml AST, but I cannot compile it.

1. The r= elevant modules/libraries do not load

=C2=A0 utop # #require "c= ompiler-libs.optcomp";;=C2=A0
=C2=A0 Error: Reference to undefined= global `Location'

=C2=A0 X86_masm.generate_asm stdout [] ;;
=

2. The relevant modules seem to insist on file i/o for commun= ication (i.e., they use out_channel objects)


Does anyone k= now a simple way around these issues?

a) Can I load the optcom= p library without modifying the compiler (or with some simple modifications= )

b) Is there a way to create an out_channel=C2=A0 from a memo= ry buffer?

thanks,

Christoph

ps: If = the answer to both questions is "no", I would be willing to work = with the community and enhance the compiler if I could get some advice on h= ow to do it best and if such a modification is wanted.
--94eb2c07bdf21102870562696168--