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 C6EF47F1AA for ; Fri, 11 Sep 2015 18:26:51 +0200 (CEST) IronPort-PHdr: 9a23:eFVePx3XnVV406PbsmDT+DRfVm0co7zxezQtwd8ZsegRKPad9pjvdHbS+e9qxAeQG96Lt7Qd26GP6/6ocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC04Luh6vro8ObSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzoRA6Lrl8dSXlexhFBBgyA6BDhQr/wtDH7v6xzwn/JE9fxSOUeXj7q3adiThCg3C0APSw5+WfY050g3IpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEEnUZWo4= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=bobzhang1988@gmail.com; spf=Pass smtp.mailfrom=bobzhang1988@gmail.com; spf=None smtp.helo=postmaster@mail-yk0-f171.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bobzhang1988@gmail.com) identity=pra; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of bobzhang1988@gmail.com designates 209.85.160.171 as permitted sender) identity=mailfrom; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yk0-f171.google.com) identity=helo; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-yk0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AfAgBaAPNVlKugVdFdg0I1aQaDJKlRhFuNXYV9gVAHPBABAQEBAQEBARABAQEBBwsLCR8wgh2CCRYRHQEbGAUBAxIDBgc3AiQBEQEFASI1h3YBAxKbFo9DgTA+MYtBgWyCeYl9ChknDVaEDwwBGQEFDoRVhgeGE4JwgUMFlU8HhQqHcIISkTWFZhIjgRc4gi+CGSIzih8BAQE X-IPAS-Result: A0AfAgBaAPNVlKugVdFdg0I1aQaDJKlRhFuNXYV9gVAHPBABAQEBAQEBARABAQEBBwsLCR8wgh2CCRYRHQEbGAUBAxIDBgc3AiQBEQEFASI1h3YBAxKbFo9DgTA+MYtBgWyCeYl9ChknDVaEDwwBGQEFDoRVhgeGE4JwgUMFlU8HhQqHcIISkTWFZhIjgRc4gi+CGSIzih8BAQE X-IronPort-AV: E=Sophos;i="5.17,511,1437429600"; d="scan'208";a="145509234" Received: from mail-yk0-f171.google.com ([209.85.160.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 11 Sep 2015 18:26:49 +0200 Received: by ykdg206 with SMTP id g206so96254298ykd.1; Fri, 11 Sep 2015 09:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=RsNDYmyLYUObHx87SxKOf7+vk4PQb0kKhg7BFeQab4U=; b=PzKJnuNyVv+eC+K+rW9Y4s4BCI9n0LQJmwViJhNi6bH+D09qNxT5V4V6AExeiHLpy4 wKWwhMuCPAiBj4sov4qvRxFiyw3R2xonx+dsFmQ6VJQu+YtBdPpETNKr8YtW8UId4TiQ PfJQinSIeAOvSb8aPMP16WvQ6DIv5efscG96EPITkX8WuC+m8xsN66hGL+v1ZorQe7CY fSfmulagROM8TOsJhC4i6ZbAEVcpFeCsKYlDlP9SJNXuoH+uIsYzx6ocBVBm5UbSl482 LQYpbH8ZlDdrvetUrjhCCLgzusdtBoGr4BhZWruDQmHKsouefTAwtWoWVaYPX1h8trsz 8B8g== MIME-Version: 1.0 X-Received: by 10.129.41.4 with SMTP id p4mr55060803ywp.131.1441988808538; Fri, 11 Sep 2015 09:26:48 -0700 (PDT) Received: by 10.37.4.148 with HTTP; Fri, 11 Sep 2015 09:26:48 -0700 (PDT) Date: Fri, 11 Sep 2015 12:26:48 -0400 Message-ID: From: Bob Zhang To: Caml List Cc: Damien Doligez , Alain Frisch Content-Type: multipart/alternative; boundary=001a1141286cb40ac2051f7b2ef2 Subject: [Caml-list] OCaml to Readable Javascript Playground(http://zhanghongbo.me/js-demo/) --001a1141286cb40ac2051f7b2ef2 Content-Type: text/plain; charset=UTF-8 Dear OCaml devs, (Disclaimer: This is my personal project at home, does not represent my current employer's opinions) I made a OCaml to Readable Javascript Playground( http://zhanghongbo.me/js-demo/) you may find interesting, you can do live coding inside the browser and see the output of Javascript immediately. It's still in very early stage, but it already supports the full language (with tons of bugs). Javascript is a truly amazing platform(not just in browsers, Bloomberg has millions lines of in-house Javascript code embedded!) and interests me a lot recently. The motivations is listed as below: 1. Readable (at least most skeletons are preserved), so that we can make use of existing Javascript tools, for example, I can use webstorm as GUI debugger to debug my OCaml code. 2. Easy FFI, all OCaml functions are plain Javascript functions, I borrowed some ideas from Alain (gen_js_api), so if you want to call Javascript from OCaml, just annotate types, even better, minimal code is generated, the user can call the function on the fly. 3. (working on) Dev mode/Release mode. Another work on the road map is do optimizations on lambda layer, cross module inlining, data flow anaylsis, global dead code elimination. 4. (to-do) Compile OCaml objects into Javascript Objects, better FFI for existing Javascript code base. There are some changes needed from OCaml compiler, but those changes are non-intrusive and mostly just pass down more information from front-end, I would clean up and submit some patches when it's ready. If we do some refactoring for the OCaml compiler (mostly use inline records instead of tuples for typedtree, that will the maintainance much easier in the future) Any feedback is welcome! Thank you -- Hongbo -- Regards -- Hongbo Zhang --001a1141286cb40ac2051f7b2ef2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear OCaml devs,
=C2=A0 =C2=A0 (Disclaimer: This is my = personal project at home, does not represent my current employer's =C2= =A0opinions)
=C2=A0 =C2=A0 =C2=A0I made a OCaml to Readable Javascript P= layground(http://zhanghongbo.me/= js-demo/) you may find interesting, you can do live coding inside the b= rowser and see the output of Javascript immediately.
=C2=A0 =C2=A0 =C2= =A0It's still in very early stage, but it already supports the full lan= guage (with tons of bugs). Javascript is a truly amazing platform(not just = in browsers, Bloomberg has millions lines of in-house Javascript code embed= ded!) =C2=A0and interests me a lot recently.
=C2=A0 =C2=A0 =C2=A0The mot= ivations is listed as below:
=C2=A0 =C2=A0 =C2=A01. R= eadable (at least most skeletons are preserved), so that we can make use of= existing Javascript tools, for example, I can use webstorm as GUI debugger= to debug my OCaml code.
=C2=A0 =C2=A0 =C2=A02. Easy FFI, all OCaml func= tions are plain Javascript functions, I borrowed some ideas from Alain (gen= _js_api), so if you want to call Javascript from OCaml, just annotate types= , even better, minimal code is generated, the user can call the function on= the fly.
=C2=A0 =C2=A0 =C2=A03. (working on) Dev mode/Release mode. Ano= ther work on the road map is do optimizations on lambda layer, cross module= inlining, data flow anaylsis, global dead code elimination.
=C2=A0 =C2= =A0 =C2=A04. (to-do) Compile OCaml objects into Javascript Objects, better = FFI for existing Javascript code base.
=C2=A0 =C2=A0 =C2=A0There are som= e changes needed from OCaml compiler, but those changes are non-intrusive a= nd mostly just pass down more information from front-end, I would clean up = and submit some patches when it's ready. If we do some refactoring for = the OCaml compiler (mostly use inline records instead of tuples for typedtr= ee, that will the maintainance =C2=A0much easier in the future)
=C2=A0 = =C2=A0 =C2=A0Any feedback is welcome!
=C2=A0 =C2=A0 =C2=A0Thank you -- H= ongbo
=C2=A0 =C2=A0 =C2=A0=C2=A0

--
Regards
-- Hongbo Zhang
--001a1141286cb40ac2051f7b2ef2--