Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83506 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88569 invoked from network); 22 Feb 2015 23:30:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2015 23:30:56 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:40146] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/FC-18531-0B66AE45 for ; Sun, 22 Feb 2015 18:30:56 -0500 Received: by iebtr6 with SMTP id tr6so19534192ieb.7 for ; Sun, 22 Feb 2015 15:30:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=f/sGYCOW8n6crOs/JwSQPOmk3oWLNUrYK5veSxKcKJI=; b=DypkXEjHo+uRYQAvl+PQUqHyzeAxYc26ThjRsl7S3WC6ZKTXKrFzfHM+t7ZcbplRKn FOUPJ8jn1FZGKwApu4MqVUPu0Piizn6SMXPEd4/gFVbaI0UruPp35tSTWTYe6+UwaNw6 FFIX4xB362wbcVl2Od1JJjjae8Fjc2GWFVvUC7WQ+BcsEqI+mc+ZV6Ro+Cl9snv2zL3q Mpfu9e2PQ+U3a5DX/K7jJs7zPab01ojUbEJIuvzNjf/FOEZrXGPM26LFK6CExIOEQH7X 9nXPFKQacGA/397B2IC65q3eiqUs8OnGLH0w7NMEFa6ozlAaU1nyDSEF3jewzsBDsexi /aOQ== X-Gm-Message-State: ALoCoQmv5XmM/BlWVWSf4t2/yl/+kWejp3vq+tY3pLfCvXA/Kfp8HpsFaXki9uQ7r3UAhaMJ0Q74PAu65EMGA5BeYjFMOVRkpODVv6n8HYNnL1ZhcdMfWBaOn6BSCO7pyKtx2UEqPUpKTWHjCMgUfY2An3YhgzlFMQ== X-Received: by 10.43.67.3 with SMTP id xs3mr8696040icb.39.1424647853321; Sun, 22 Feb 2015 15:30:53 -0800 (PST) References: <2e4694f9805ee81ea0b2c79eab06c2d6@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIDXD7ehmaYKzbAddTs7O1sB4MzmgIw+OLdnIWrpVA= Date: Mon, 23 Feb 2015 01:25:31 +0200 Message-ID: <83921f861c3378dfc6ea34b6681f2edd@mail.gmail.com> To: Anthony Ferrara Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] JIT (was RE: [PHP-DEV] Coercive Scalar Type Hints RFC) From: zeev@zend.com (Zeev Suraski) Anthony, I started writing this long response, but instead, I want to localize the whole discussion to the one true root difference. Your position on that difference is the basis for your entire case, and my position on this argument is the base for my entire case. There we go: > And note that this can only work with strict types since you can do the > necessary type inference and reconstruction (both forward from a function > call, and backwards before it). Please do explain how strict type hints help you do inference that you couldn't do with dynamic type hints. Ultimately, your whole argument hinges on that, but you mention it in parentheses almost as an afterthought. I claim the opposite - you cannot infer ANYTHING from Strict STH that you cannot infer from Coercive STH. Consequently, everything you've shown, down to the C-optimized version of strict_foo() can be implemented in the exact same way for very_lax_foo(). Being able to optimize away the value containers is not unique to languages with strict type hints. It's done in JavaScript JIT engines, and it was done in our JIT POC. > With lax (weak, coercive) types, the ability to do type reconstruction > drops > significantly. Because you can no longer do any backwards inference from > other function calls. Which means you can't prove if a type is stable in > most > cases (won't change). Therefore, you'll always have to allocate a ZVAL, > and > then the optimizations I showed above would stop working. Again, using the scientific method I'm familiar with, that would be a theory, and it would require proof. So far I haven't seen any proof, and I believe I pretty much proved the opposite with my example. Zeev