Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107711 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75973 invoked from network); 28 Oct 2019 02:09:26 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 28 Oct 2019 02:09:26 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 5AB222C6B13 for ; Sun, 27 Oct 2019 16:56:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-yw1-xc2d.google.com (mail-yw1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Sun, 27 Oct 2019 16:56:41 -0700 (PDT) Received: by mail-yw1-xc2d.google.com with SMTP id i2so1453302ywg.13 for ; Sun, 27 Oct 2019 16:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=RPHxEo/iRcoHjzv0IRchgbqEWAVOrO/XBVGnsZCqQh4=; b=CyBAeCnuBTD4UBL/sw/gGR9FHAhmnSMRMkCM2ZfjyXStBuZm6xlDE4dyBxaglEExsO wBtQXZtv9wwsRaCXj6oUcbONP9l6khmgkvr8iKMCMW4mbjCzMy3qlhcej8PuY2+Z7dOO N5tLJHh4hxlHYl82M4y1fX8hOZf74vgZOGGkQ20Nk2TQX/WLNR+fO0NV057pirhVtV0M pCXFxNgbWbh02tp/WLYxUtzS9TDxpiCePQxVYvsUpJzxn9OtwlsBihJFKSnHr0SX4ySd 9S0KBxGvGPQo1Ke47/FZVg8FeZYtVRPslcBAXduFtIpZatVa7PEggeQXNH5jwRYA56Tc evww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=RPHxEo/iRcoHjzv0IRchgbqEWAVOrO/XBVGnsZCqQh4=; b=TLAQWt62Hwl4c+4HxQnz1H+bk6UAGj6l2vupiwZsSKRgt7RJenGMCMXId734wRRbW9 FX5JEt2hNMS6y98dAHkN8KHtcFZraRcSBhpi1y6FFjHZS0R8g9aOWwhdyuutPovVJGhG Mx06ICP+Csktx1/fAaAq5LjLJ4df1HguxeWslC3CggYlPH3X0Rs0QfR7D/edwBF9BSGy IOgZ2ZbF9GlWvaYNLAEImc87n90bDrDpgMlhCl98Ho286k5VtbQeATVWTge9e04kYBTa uOBcB0IfNNhHDO38TxZiMyAeOyM9pCiO2sYacDJAhem9uALpiEz4OOCaMiQXyNlBIDcX gI3Q== X-Gm-Message-State: APjAAAXjVVsCtNybXnT+8TM2zoFKkrxGh90T81lODSrpXyKS06YokM7f WXPJXhXb9UcDUQIdmNnf6dTpCA== X-Google-Smtp-Source: APXvYqzPReSp4s9oSyFSCJguVUkCnEGE+XHAWJoyZdTmfisA189cXinScA8neh0nPwnWX/cCnYWpEQ== X-Received: by 2002:a81:78d7:: with SMTP id t206mr10005915ywc.177.1572220600879; Sun, 27 Oct 2019 16:56:40 -0700 (PDT) Received: from ?IPv6:2601:c0:c680:5cc0:4846:f50e:1715:5361? ([2601:c0:c680:5cc0:4846:f50e:1715:5361]) by smtp.gmail.com with ESMTPSA id k62sm2891746ywd.72.2019.10.27.16.56.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Oct 2019 16:56:38 -0700 (PDT) Message-ID: <9D2698F0-49A4-4EA0-BEEE-552D28BE995A@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_65727FAB-43AF-4FC5-A4C0-89CD555AE727" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Sun, 27 Oct 2019 19:56:37 -0400 In-Reply-To: <9d3f9895-5ab6-1d75-4eb2-0ba93f13a8fe@gmail.com> Cc: internals@lists.php.net To: Rowan Tommins References: <9d3f9895-5ab6-1d75-4eb2-0ba93f13a8fe@gmail.com> X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Re: [PHP-DEV] Optional pre-compiler for PHP8? From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_65727FAB-43AF-4FC5-A4C0-89CD555AE727 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 27, 2019, at 7:04 PM, Rowan Tommins = wrote: Thank you for your comments. > I chose the phrase "static analysis tool" deliberately, because I = wanted to think about the minimum requirements for such a tool, rather = than its long-term possibilities. Your points are all well-considered. To be clear, I wasn't stating the idea as a alternative to your idea, I = was only stating that your comments inspired me to have the idea of a = pre-compiler. =20 IOW, I saw no reason both could not be done, one sooner and the other = later. > However, combining those usefully may not be that easy. Also for clarity, I was not assuming existing OpCache would be 100% = unmodified, I was talking about benefits that a pre-compiler could have = and was less focused on ensuring it could slot into an existing OpCache = implementation as-is. IOW, if it is worth doing it might be worth extending how the OpCache = works. > So we'd probably need some built-in definition of a "package", which = could be analysed and compiled as one unit, and didn't rely on any = run-time loading. That idea of a "package" came up during a debate on this list at least = once, a few months ago, and I think it makes a lot of sense. And what I = proposed effectively implies that namespaces would be treated like = packages from the perspective of the compiler.=20 But then again a new package concept might be needed in addition to = namespaces, I am not certain either way. > Unlike P++, Editions, or Strict Mode, this would undeniably define = that the deprecated features were "the wrong way". I am not sure I cam agree that it would define them as the "wrong way." =20= The way I would see it is there would be a "strict way" and an "unstrict = way." If you prefer the simplicity of low strictness and do not need = more/better performance or the benefits of type-safety that are needed = for building large applications, then the "right way" would still be the = "unstrict way."=20 And the non-strict features would not be "deprecated" per-se, they would = instead be disallowed for the strict (compiled) way, but still allowed = for the unstrict (interpreted) way. > If the engine had to support the feature anyway, I think we are talking two engines; one for compiling and another for = interpreting. They could probably share a lot of code, but I would = think it would still need to be two different engines. > I'm not sure what the advantage would be of tying it to "compiled vs = non-compiled", rather than opting in via a declare() statement or = package config. The advantage would be two-fold:=20 1. Backward compatibility 2. Allowing PHP to continue to meet the needs of new/less-skilled = programmers and/or people who want a more productive language for = smaller projects that do not need or want all the enterprisey type-safe = features. Frankly it is this advantage which is the primary reason I though to = send a message to the list. The chance to have the benefit of strictness = and high performance for more advanced PHP developers while still having = full BC for existing code and for beginner developers seemed highly = compelling to me. -Mike --Apple-Mail=_65727FAB-43AF-4FC5-A4C0-89CD555AE727--