From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id DEAFBBBAF for ; Wed, 24 Nov 2010 08:59:04 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlwHAFxU7ExQDPIaZmdsb2JhbACidCILCAgSAx+9C4VMBIRaiRQ X-IronPort-AV: E=Sophos;i="4.59,247,1288566000"; d="scan'208";a="80090478" Received: from smtp20.orange.fr ([80.12.242.26]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Nov 2010 08:59:04 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id 0B78C20000A8; Wed, 24 Nov 2010 08:59:04 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id EFE5A20000B8; Wed, 24 Nov 2010 08:59:03 +0100 (CET) Received: from [192.168.1.114] (c-67-188-213-250.hsd1.ca.comcast.net [67.188.213.250]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id 9B5A120000A8; Wed, 24 Nov 2010 08:59:02 +0100 (CET) X-ME-UUID: 20101124075902636.9B5A120000A8@mwinf2002.orange.fr X-ME-User-Auth: padator@wanadoo.fr Subject: Re: [Caml-list] OCamlJit 2.0 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Yoann Padioleau In-Reply-To: <4CECBCCD.4000609@frisch.fr> Date: Tue, 23 Nov 2010 23:59:00 -0800 Cc: Dario Teixeira , Benedikt Meurer , caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: References: <980786.74593.qm@web111507.mail.gq1.yahoo.com> <4CECBCCD.4000609@frisch.fr> To: Alain Frisch X-Mailer: Apple Mail (2.1081) X-Spam: no; 0.00; frisch:01 compiler:01 compiler:01 2.0:98 23,:98 javascript:98 javascript:98 wrote:01 wrote:01 caml-list:01 alain:01 alain:01 compiling:02 idiomatic:02 codebase:96 On Nov 23, 2010, at 11:20 PM, Alain Frisch wrote: > On 11/19/2010 8:46 PM, Dario Teixeira wrote: >> Actually, Facebook has a compiler that transforms PHP source code = into C++ [1], >> and they claim a 50% reduction in CPU usage. >=20 > I haven't looked into this project, but I've a hard time believing = this is a better approach than compiling PHP to Javascript. Web browsers have to implement a JIT: they don't have any control on the = javascript they get (it can come from anywhere). This is less true for server-side scripting languages. In the case of = Facebook the PHP compiler has access to the whole PHP codebase and can do some whole-program analysis. > The translation would probably produce quite idiomatic Javascript code = on which modern > interpreters do an amazing job (and they keep improving). These = interpreters focus on optimizing what made naive Javascript interpreters = so slow and I assume the typical PHP interpreter has poor performance = for the same reasons. >=20 > -- Alain