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 1B9D2800AE for ; Thu, 22 Dec 2016 16:48:51 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=zhenya1007@gmail.com; spf=Pass smtp.mailfrom=zhenya1007@gmail.com; spf=None smtp.helo=postmaster@mail-yb0-f173.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of zhenya1007@gmail.com) identity=pra; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="zhenya1007@gmail.com"; x-sender="zhenya1007@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of zhenya1007@gmail.com designates 209.85.213.173 as permitted sender) identity=mailfrom; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="zhenya1007@gmail.com"; x-sender="zhenya1007@gmail.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-yb0-f173.google.com) identity=helo; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="zhenya1007@gmail.com"; x-sender="postmaster@mail-yb0-f173.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A+/PbqxKIQUNAMAH1N9mcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUKPzxwZ3uMQTl6Ol3ixeRBMOAuqkC27ad4/moGTRZp83e4DZaKN0EfiRGoP?= =?us-ascii?q?tVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blIt?= =?us-ascii?q?dazdU7TfhMWv1u2054abI0AR3GL8MvtOK0CWoAPdrMgVyaFlLaN5nhvEpHdSeu?= =?us-ascii?q?d+2WRwIlPVhxH7/4G7+5s1oApKvPd02tBPXKPrN54/ULZZCj8mL2004oW/pxnO?= =?us-ascii?q?SxqGvyNEDU0ZlxNJB07O6xSsDcS5iTfzqucogHrSBsbxV71hHG36t6o=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CcBAAY9VtYgK3VVdFeGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgwoBAQEBAUAyCoEJB4RJni8BAQaBHIhohB+?= =?us-ascii?q?KFyqFeAKBZQdCEQEBAQEBAQEBAQEBEgEBCQ0JCRsygjMEARUBBIIXAQQBIx0BG?= =?us-ascii?q?x0BAwELBgULNwICIgERAQUBHAYTiFEBAwsFCA6dND+MAoIEBQEegwwFg18KGSc?= =?us-ascii?q?NVIJpAQEBAQYBAQEBAQEaAgYShXGFKIdPgl0FgSUBAQGOWYpuCAEBgTQJhRWKa?= =?us-ascii?q?IF1UYQ2iVaFQIhmgkkUHoEUDyaBehJBgwaCJiA0AYcZgU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0CcBAAY9VtYgK3VVdFeGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgwoBAQEBAUAyCoEJB4RJni8BAQaBHIhohB+KFyqFeAKBZQdCE?= =?us-ascii?q?QEBAQEBAQEBAQEBEgEBCQ0JCRsygjMEARUBBIIXAQQBIx0BGx0BAwELBgULNwI?= =?us-ascii?q?CIgERAQUBHAYTiFEBAwsFCA6dND+MAoIEBQEegwwFg18KGScNVIJpAQEBAQYBA?= =?us-ascii?q?QEBAQEaAgYShXGFKIdPgl0FgSUBAQGOWYpuCAEBgTQJhRWKaIF1UYQ2iVaFQIh?= =?us-ascii?q?mgkkUHoEUDyaBehJBgwaCJiA0AYcZgU8BAQE?= X-IronPort-AV: E=Sophos;i="5.33,389,1477954800"; d="scan'208,217";a="251227898" Received: from mail-yb0-f173.google.com ([209.85.213.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 22 Dec 2016 16:48:50 +0100 Received: by mail-yb0-f173.google.com with SMTP id w19so12354649ybb.2 for ; Thu, 22 Dec 2016 07:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=G5uulT6N0sjZJvqo6kUCuGeyPC0MxpuZBr1PrH7A3fE=; b=hTvfaMDnNBLQlwyFqYRanLsRGOTGA+ekRQw2IgjByWFTqSmWliy6dRcVgdkB5HpYiR TJdqIf/BGcy3q8+bMX+NTMHMc4fruYZQjfIJWC0xwqrfbrhD2fiyuR6J3vAS3fiMgRxN sS75qwyMUfbutAZhGvqcRGHYHTnHT3a+Wg5Zqx/47jXbISkd4hqpGNKTVzTrslNDV1ov uzl+e9C2mZJhr9cedfxVsk7SK9SS2ruL3EaF2OjIQ+fKTDikOrwmXtLx4IcStlBbtC2b TnGB13mymHQT7gunozXmCUdSVM5ZamBEEcmTwJYa9hltUweWoP0UUjWtdQsnmjHL4H6X qG/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=G5uulT6N0sjZJvqo6kUCuGeyPC0MxpuZBr1PrH7A3fE=; b=JIJ8oGeyCIQtH7d4/nF38vO1omQO+ZtY34PMXh/7Slm3w1HgNRtE8oPHiDcUaALJVY gUnd+cnDKbU2h3Y+DPy2NyU4S4QYVb4VzLyk4evwC2C9nYpN5aMoVZTkcuD7hHMCDYY7 a6QnATlg4ek3rToiwiTkPwyFrEm+sKWw504vw5a7Q/DKTdWHpWSeHka96FEmSGkMSMCA IongDneOW/FhqMrWaJSsfN8cAIeGtI8ADzMRv9MJ2uSCI+IKt4nq7KiAgRlhRxgwIJe3 a8zL7BggwogGdtC+PxMQmQmTJlb1pOj8wq0oD2oI/7+vB1t8onrVOMiAeJ1eP4eore6/ Euig== X-Gm-Message-State: AIkVDXLh3Y+MblgWHVWTE5Urhem2wm43gOr1GA+sao4AQR/w6sKXedHpscCR7NGx8dRHR+383mpCoa/CfAQIbA== X-Received: by 10.37.4.16 with SMTP id 16mr3643797ybe.131.1482421728893; Thu, 22 Dec 2016 07:48:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.170.106 with HTTP; Thu, 22 Dec 2016 07:48:48 -0800 (PST) In-Reply-To: <20161222011231.GA26221@topoi.pooq.com> References: <20161222011231.GA26221@topoi.pooq.com> From: Evgeny Roubinchtein Date: Thu, 22 Dec 2016 10:48:48 -0500 Message-ID: To: Hendrik Boom Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a11c045048edfb1054441342a Subject: Re: [Caml-list] off-brand use of ocaml bytecode --001a11c045048edfb1054441342a Content-Type: text/plain; charset=UTF-8 I know there are people on this list who are way more qualified to answer these questions, but let me try. On Wed, Dec 21, 2016 at 8:12 PM, Hendrik Boom wrote: > Are there ny tools available that could be used to generate ocaml > bytecode for other languages? > I don't think you will get a definitive answer on this list. Here is a thought experiment showing why. Suppose J. Random Hacker decides to write a compiler from WhizBangLang to OCaml byte code. Under the assumption that OCaml developers are not omniscient, the way they would learn about J. Random Hacker's efforts is if s/he either: a) announces the new language in some venue that OCaml developers watch or b) finds [what s/he believes are] bugs in the OCaml byte code interpreter and files bug reports against it. It isn't clear to me that our J Random Hacker must needs do either of those things. If I were to do that, by hand or otherwise, how would I interpret or > compile it? > The ocamlrun program, shipped with the OCaml distribution and documented at http://caml.inria.fr/pub/docs/manual-ocaml/runtime.html is the standard interpreter for the OCaml byte code. For the OCaml compiler, the byte code is a target (as opposed to a source or an intermediate representation), so the existing OCaml tool chain does not support compiling byte code, to the best of my knowledge (AFAIK projects like Bucklescript and js_of_ocaml use the OCaml front-end and intermediate representation, but supply a different compiler back end). Would the ocaml run-time system we available -- things like the garbage > collector, I/O libraries, etc. > I think that question is answered in the documentation of ocamlrun. You probably will also want to peruse http://caml.inria.fr/pub/docs/manual-ocaml/intfc.html and specifically the discussion of static and dynamic linking of C code with OCaml code. > Is anyone else working of projects like this? I am not entirely certain what the intended antecedent of "this" is here. If "this" is "a compiler that targets OCaml byte code", then please see my answer above. If you feel that the current design of "ocamlrun for standard primitives + the '-custom' flag to the OCaml compiler for non-standard primitives" is failing to address a need, then a description of the need that isn't being addressed would be a good starting point for discussion. ;-) Hope this helps -- Best, Zhenya --001a11c045048edfb1054441342a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I know there are people on this= list who are way more qualified to answer these questions, but let me try.=

On Wed, Dec= 21, 2016 at 8:12 PM, Hendrik Boom <hendrik@topoi.pooq.com> wrote:
Are there = ny tools available that could be used to generate ocaml
bytecode for other languages?

I don'= ;t think you will get a definitive answer on this list. =C2=A0 Here is a th= ought experiment showing why.=C2=A0 Suppose J. Random Hacker decides to wri= te a compiler from WhizBangLang to OCaml byte code.=C2=A0 Under the assumpt= ion that OCaml developers are not omniscient, the way they would learn abou= t J. Random Hacker's efforts is if s/he either: a) announces the new la= nguage in some venue that OCaml developers watch or b) finds [what s/he bel= ieves are] bugs in the OCaml byte code interpreter and files bug reports ag= ainst it.=C2=A0 It isn't clear to me that our J Random Hacker must need= s do either of those things.

If I were to do that, by hand or otherwise, how wou= ld I interpret or
compile it?

The ocamlrun program, shipp= ed with the OCaml distribution and documented at http://caml.inria.fr/pub/docs/man= ual-ocaml/runtime.html is the standard interpreter for the OCaml byte c= ode.=C2=A0

For the OCaml compiler, the byte code i= s a target (as opposed to a source or an intermediate representation), so t= he existing OCaml tool chain does not support compiling byte code, to the b= est of my knowledge (AFAIK projects like Bucklescript and js_of_ocaml use t= he OCaml front-end and intermediate representation, but supply a different = compiler back end).

Would the ocaml run-time system we available -- things like the garbage
collector, I/O libraries, etc.

I think = that question is answered in the documentation of ocamlrun. =C2=A0 You prob= ably will also want to peruse=C2=A0http://caml.inria.fr/pub/docs/manual-ocaml/intfc.= html and specifically the discussion of static and dynamic linking of C= code with OCaml code.
=C2=A0
Is anyone else working of projects like this?

I am not entirely certain what the intended antecedent of "this&quo= t; is here.=C2=A0 If "this" is "a compiler that targets OCam= l byte code", then please see my answer above.=C2=A0 If you feel that = the current design of "ocamlrun for standard primitives + the '-cu= stom' flag to the OCaml compiler for non-standard primitives" is f= ailing to address a need, then a description of the need that isn't bei= ng addressed would be a good starting point for discussion. ;-)
<= br>
Hope this helps
--=C2=A0
Best,
= Zhenya

--001a11c045048edfb1054441342a--