Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72198 invoked from network); 10 Jan 2018 17:08:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2018 17:08:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.216.173 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.216.173 mail-qt0-f173.google.com Received: from [209.85.216.173] ([209.85.216.173:35816] helo=mail-qt0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/A5-39025-D98465A5 for ; Wed, 10 Jan 2018 12:08:47 -0500 Received: by mail-qt0-f173.google.com with SMTP id u10so22874558qtg.2 for ; Wed, 10 Jan 2018 09:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=JLYhteYiCH9gGA2HJN9XXymL66u7zKKxdbRr0AEEVqQ=; b=MBU6/XP/w8lJIq9ts0qliS/66HaNeIAC6dSvT8xXuV0mlKk90LA5CtyFV7JWrSTzzc uQS+E9cgrcMDDLjaRTS+b5JQ/uX7utRC7w3bftS4cThafTMN471nbMEuD5g4uT8F1JFf 40TNi9fXVavQ5UaYjCGU4dPNXL2IMZ1h5Ncq+xAxBbUKU1t87E998KENcdUQrfmd5AIR SsqvRcmCcaL7ECHfhxiBtr0EwaE9l259jk6/1GZ+7teNvCYylgII9RcCND4RMann8D40 HNQFn+/iDbDjcIYT9CPmbq5XW0HnT+kbQKMPK5i+uElAnKPh7Ce3cpqmG5JmTUhODdFs Bq7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=JLYhteYiCH9gGA2HJN9XXymL66u7zKKxdbRr0AEEVqQ=; b=ttKLzrc+HjcMnWvj6EOIJMQW9+Szu5KxeDCN+vBQDHGdf8pG/9UBFVcLLg/kQM1adX GImBpkLYkjXMfK0c1gqbk9TEtI8nwydxCuufzHOuZndfd1guWKyOmcfbuGJM8UNPaW4e 75vks7ngb7kasGgtVeJlH3czH4sH8s02Yr3hBe3OlJbWjR88GxHvqU+gFbKGwTHWPA2q 6HdYQkIODWtU6nDr4qr10x/E6DlLu05UDJI5x6jd+Y2iWqyIYkBIlbd/6+L2RBydED8a UBgpUJu3pnRBVH0xRFj+ab2EZXxY4MPUSLye8L1Ot78goaVxfaIxqoDLuLOxZJiGpIKz K72w== X-Gm-Message-State: AKwxytcNCS4uRasBSzcNGMOzHeo6quanCNHeLEMF6z6/CX3kSYIoD7uq AeyAqW8HMooeDi77cGQ3GtHVGHuEpJuMoX2KHPbw3A== X-Google-Smtp-Source: ACJfBosF8N4x1V05fnREhi+GAqsrVh9rcza3RRK24vc3T9ot1gLkX0GYYKicETUoEwrU0Qr/K+0ZNWiOWx8ye7JGmw4= X-Received: by 10.237.44.226 with SMTP id g89mr26437639qtd.108.1515604122503; Wed, 10 Jan 2018 09:08:42 -0800 (PST) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.12.158.145 with HTTP; Wed, 10 Jan 2018 09:08:41 -0800 (PST) X-Originating-IP: [206.252.215.26] In-Reply-To: References: <9a3a8760-f65a-a5c0-b318-1830a9a986c3@gmail.com> <9352F6DF-9940-49A2-9B1D-FA9258E9738E@lerdorf.com> Date: Wed, 10 Jan 2018 12:08:41 -0500 X-Google-Sender-Auth: uB7GTDagdfqxwjV6ot9F9e0zeuQ Message-ID: To: Rasmus Lerdorf Cc: Andreas Hennings , Rowan Collins , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Strong Typing Syntax From: pollita@php.net (Sara Golemon) On Wed, Jan 10, 2018 at 12:01 PM, Sara Golemon wrote: > On Thu, Jan 4, 2018 at 8:21 PM, Rasmus Lerdorf wrote= : >> I think you, and many others, commenting here, should start by looking >> at the engine implementation. Any successful RFC needs to have a strong >> implementation behind it, or at the very least a very detailed descripti= on of >> how the implementation would mesh with the existing engine code. >> >> The reason we don=E2=80=99t have typed properties/variables is that it w= ould >> require adding type checks on almost every access to the underlying >> zval. That is a huge perf hit compared to only doing it on method/functi= on >> egress points as we do now. >> > > **agh-mistabbed into a send I'm going to underline Rasmus' comment here. zval assignment is a deep/core element of what the engine does. Even when it's not a literal `$x =3D "foo";` in userspace, zvals are flying around the engine constantly. Adding so much as a Z_TYPEINFO_P(val) & ZVAL_FLAG_STRICT check to EVERY ONE OF THOSE accesses is both heavy-weight and massively complex. On the order of the php-ng rewrite complexity, because EVERY assignment needs to be dealt with, and there WILL be some misbehaving extension out there which gets it wrong. The implementation essentials are not a trivial part of such a feature. You don't need to have the entire implementation written and tested, but you do need to have a clear plan for how and what will be done and vitally, what the impact of that plan will be. You can't just waive your hands and say: "We'll sort this out..." "How does HackLang do this?" has been asked of me offline, so I want to put my answer here: IT DOESN'T. HackLang relies of static analysis to prove "$x will never be assigned a non-integer, so we can always assume it's an integer". This is done by the static analysis tool before the site is ever run, not at runtime. Why? Because the HHVM could see the same thing Rasmus is telling you. Runtime type enforcement is damned expensive. -Sara