Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94211 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74325 invoked from network); 22 Jun 2016 17:46:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2016 17:46:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.220.52 mail-pa0-f52.google.com Received: from [209.85.220.52] ([209.85.220.52:34623] helo=mail-pa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/B4-43024-B0FCA675 for ; Wed, 22 Jun 2016 13:46:51 -0400 Received: by mail-pa0-f52.google.com with SMTP id bz2so18837280pad.1 for ; Wed, 22 Jun 2016 10:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=qK4XDvIOnn5aR/SR7A7Cn2Mf9fCWu61eiwOw96zpk7k=; b=YEvdmRb8sjW9KV5LfKXysp9DTnHX60KHzujKBNbNGwmszAYzv0TPgyhGCC99oFXjoR LwIbDPbN/iPaCktRVIcbtRnbYWRRrUk/CVhsf0vNa7StHQbU9v2Pz53nxDi5ZhAM09bp p7ptNedjSX7K3XsyPhsPzG6MGuyKzZq9LdD7FtJLDpyvlcQNCsn8xMQfPxrliXYS/WEi v0e4KFbcCKEHa4uXZ4wSqLdcbbIvFgnLcE/cp6gsEFF/sx0uUx4En5qNixpbVBqY5x78 9UG/YKuMpV1VuScXecK84ycHNxyNdX0htHpW2LR9saCcoHBa+Idpx9GOmpLQ6kqxG9WA kerg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=qK4XDvIOnn5aR/SR7A7Cn2Mf9fCWu61eiwOw96zpk7k=; b=OY/fnSMDMbiddsXdcq+50xB3nCK9Xd/JxJCKspPUcfgQ7yv19lG9DYBZqS9T4hJ7Fj yhq6ClkoxE70e6hPNDmcHUsU2RywjHMNLEO8K+UPz1a00hPu+vBnLhWMn3JWEDap910e g0DttGwUbTmc0bTMTq7xPCmFay6QAqgBw22QXRrIdiepcr1nD6Sgmn7gtGg7Jc7QFLB/ StR56vi5+qchJcLNx0OOsI8CXDXWZN4xLDps2TCO9VTdWM4bEbLpe/rb9maDSmjsGlJ5 zSXMKZg89j6RwGUEKWAIylDxEjW/9FR3EDSErqfBFkz/0amZYzF4Ga6iB0hcmqDafgEZ sncg== X-Gm-Message-State: ALyK8tLXgBkXFrp8+CfuDQ3bwWQ0XV/RyuGPd0iZJEHOqMXqkv7xn3eLaTy8wW0ADyJHtA== X-Received: by 10.66.150.10 with SMTP id ue10mr24478613pab.71.1466617607785; Wed, 22 Jun 2016 10:46:47 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id 144sm1173886pfu.83.2016.06.22.10.46.45 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2016 10:46:46 -0700 (PDT) To: internals@lists.php.net References: <576A6165.8090904@lsces.co.uk> Message-ID: <20376416-aa04-766d-6178-189d1a088b01@gmail.com> Date: Wed, 22 Jun 2016 18:44:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: rowan.collins@gmail.com (Rowan Collins) On 22/06/2016 16:58, Rasmus Schultz wrote: > On Wed, Jun 22, 2016 at 11:59 AM, Lester Caine wrote: > Having worked in other gradually-typed languages like Dart and > Typescript Out of curiosity, do these languages perform the type analysis at compilation, or at run-time? I'm trying to collate some examples of how other languages have approached the problem. > PHP feels crippled on this point - it's gradually-typed, > but inconsistently so, and inconsistency is the worst kind of evil you > can have in any programming language. I absolutely agree, we need a plan for how to introduce a consistent gradual typing system. But this RFC is not that plan. > The learning curve for new users isn't increased by the introduction > of property type-hints, it's *decreased* Except that this proposal doesn't actually make the language consistently type-checked. It adds a few more special cases where you can use type hints, with slightly different behaviour. To carry on your imagined conversation: - ooh, I can type-hint properties now! - wait, what does this error mean? why would I not be able to assign this property by reference? - oh, because the variable holding the reference would have to be type-hinted; how do I do that? - oh, I can't... > and then in addition they need to go and learn about > php-doc and offline inspection tools and IDEs and so forth. Interestingly, this is the direction that Hack and Python have both apparently chosen to enshrine - the syntax is baked into the language, but not actually enforced by the standard compiler or run-time in any way. Indeed, "gradual typing" as defined by Jeremy Siek only really makes sense in the context of static analysis. > Sorry, for the rant, but anti-type-hints is just anti-consistency. We > have type-hints, now let's please take another step towards finishing > the job! Taking lots of little steps "towards" a goal that we've never even properly defined is exactly what leads to *inconsistency* in the language. I think a number of people are not "anti-type-hints", they just don't agree with this particular implementation. Regards, -- Rowan Collins [IMSoP]