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 89BCD800AE for ; Thu, 22 Dec 2016 17:01:16 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yotambarnoy@gmail.com; spf=Pass smtp.mailfrom=yotambarnoy@gmail.com; spf=None smtp.helo=postmaster@mail-yb0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.213.169 as permitted sender) identity=mailfrom; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@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-f169.google.com) identity=helo; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yb0-f169.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AxgrKWxYKtjkcJLPBocG+SSb/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpc2zbnLW6fgltlLVR4KTs6sC0LuN9fC8EjxZqdbZ6TZZL8wKD0dEwe?= =?us-ascii?q?wt3CUeQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2ap42N2uuz45zeZRlTzHr4OOsqbUb+kQKEm9cZjI1zYpw21xHIpHBIZ+?= =?us-ascii?q?lXwys8N1KemQf1v5/oo7Zs9i1Rv7Qq8MsWAovgeKFtfLtEBTFuGWkv4sr6/U3S?= =?us-ascii?q?SheG43EVSGMRgzJHBgHE6FfxWZKn4XiyjfZ0xCTPZZ6+drszQzn3qv4zEBI=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DjAgBk91tYhqnVVdFeGwEBAQMBAQEJA?= =?us-ascii?q?QEBFgEBAQMBAQEJAQEBgwoBAQEBAUA8eRAHpByXHiqFeAKBZQdCEQEBAQEBAQE?= =?us-ascii?q?BAQEBEgEBAQgLCwkdMIIzBAEVAQSCFwEFIx0BGx0BAwwGBQsDCgICJgICIQEBE?= =?us-ascii?q?QEFARwGE4hRAQMYDp04P4wCggQFAR6DDAWDXwoZJw1UgmkBAQEBAQEEAQEBAQE?= =?us-ascii?q?bAgYSeYU9hGOCUoR9gl0FkAGKQzWGUoZwg3iBdVGENolWhUCELYQ5gkkUHoEUN?= =?us-ascii?q?YEpURKDRyCCBiA0AYcZgU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0DjAgBk91tYhqnVVdFeGwEBAQMBAQEJAQEBFgEBAQMBAQE?= =?us-ascii?q?JAQEBgwoBAQEBAUA8eRAHpByXHiqFeAKBZQdCEQEBAQEBAQEBAQEBEgEBAQgLC?= =?us-ascii?q?wkdMIIzBAEVAQSCFwEFIx0BGx0BAwwGBQsDCgICJgICIQEBEQEFARwGE4hRAQM?= =?us-ascii?q?YDp04P4wCggQFAR6DDAWDXwoZJw1UgmkBAQEBAQEEAQEBAQEbAgYSeYU9hGOCU?= =?us-ascii?q?oR9gl0FkAGKQzWGUoZwg3iBdVGENolWhUCELYQ5gkkUHoEUNYEpURKDRyCCBiA?= =?us-ascii?q?0AYcZgU8BAQE?= X-IronPort-AV: E=Sophos;i="5.33,389,1477954800"; d="scan'208";a="251230416" Received: from mail-yb0-f169.google.com ([209.85.213.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 22 Dec 2016 17:01:15 +0100 Received: by mail-yb0-f169.google.com with SMTP id 84so15111978ybe.3 for ; Thu, 22 Dec 2016 08:01:15 -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=SpZr+CdP95ZS0hol0zmmf0Pt6icH9o+UVK6hwTAYz98=; b=WY1fYj4sQXdr8AF/C1dFYXiMW2AMwSbvVCH4OcRRoI8wY77ubnT9uKONd7eSeM/nZ9 Cy8oHv4fcgVIDiqTHbdKj4YQ0SrtQa2cxUur1TqYASJVLYEsC3sZhReW/z7KozWGka58 CNGSGQrI2uCAGbIWi7B1rp+KaQjlyU9d3KOCczFAr9rKVECAJIcrxeKMils12N/x80gF 5rjbyN7ynkPTiH7CgF3/czgyQNnWaAlsvBKFc+76gMpP2m4IxONUZMTEUQM3vjFXvAfj ob5TneXm6sQrlXqyJi/8djsECNvqaOX8gWg4R0yFwIYbK/xl7mWZrS32M3RqEOMYnoqt ILtQ== 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=SpZr+CdP95ZS0hol0zmmf0Pt6icH9o+UVK6hwTAYz98=; b=UfwR+rxK/eF7Oz1C82zPEDRUTQfuiEzsXeqllLhG2WNdWOl+/BGVJSv7L+hqKF8P8q 8JOYLLcV9ZNBFGPU5bJhBZMq2+Z/5MLnD/BIwUM0hn7RSMZphJfdyw/SUGgGdcvp9FBd ylZUG6ROVobgescE21GEp/7KBMBJ1W2AFs3nDoXopIhpHpd9AApKeGeHnBYl4+Q3XCZV oJ7C5Clwaf+YQwwHWLyHY2VYHnwyKP3YDhxS/v9FQ/5zhEaQ4/0mSVxTjbenMu3ehwlM GOyVG656OsV3b/S4nrmB6cJMUT9CwESVkrw1hIJbQ+5ypuPtm7sDLY4jnGP6PZOSfeUu gyrw== X-Gm-Message-State: AIkVDXKMjkAZArXJc7cycs288BN+LMwpwT73jZ6Ii1LdWa8+DigDaeABKUWC0XAgT/wp28nueuJ10Z20jFu+iA== X-Received: by 10.37.3.207 with SMTP id 198mr6979898ybd.15.1482422474463; Thu, 22 Dec 2016 08:01:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.18.86 with HTTP; Thu, 22 Dec 2016 08:00:53 -0800 (PST) In-Reply-To: References: <20161222011231.GA26221@topoi.pooq.com> From: Yotam Barnoy Date: Thu, 22 Dec 2016 11:00:53 -0500 Message-ID: To: Evgeny Roubinchtein Cc: Hendrik Boom , Ocaml Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] off-brand use of ocaml bytecode Check out Stephen Dolan's Malfunction (https://github.com/stedolan/malfunction). You essentially compile down to OCaml's internal representation, and the compiler takes it from there, making either bytecode or native binaries. On Thu, Dec 22, 2016 at 10:48 AM, Evgeny Roubinchtein wrote: > 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 >