Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101659 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21170 invoked from network); 22 Jan 2018 21:12:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2018 21:12:07 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.41 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.41 mail-pg0-f41.google.com Received: from [74.125.83.41] ([74.125.83.41:39027] helo=mail-pg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/4A-28995-5A3566A5 for ; Mon, 22 Jan 2018 16:12:07 -0500 Received: by mail-pg0-f41.google.com with SMTP id w17so8050285pgv.6 for ; Mon, 22 Jan 2018 13:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=oY2Chowc4SQySw+6C+5DRyDl0UARJ+U4ZlKIcsKMNC4=; b=fjUeTPvCG0A3FNvsj7amrZTCNfoMAqmWEoBHl5K7SYhXRdhYpf8BiTaitfhfbE6Jpi REki1Ey0O9E+moDQhweBCja/RYQBVqnf+J3tGA5X72vsuH1k+MtHMJbnOK+Rki7VCnft KKSkJVAXq3Ip3xS7Vc1KHUE0c30fskiaN4EYTUvDA3a9IFxlw6zIpWREBQolY345BJaZ dKhbzuNjAo2+EFei4S5QXXbF41dRxxTyWUEqgM0SN8J2Ih1F/ooQjYSMjDlA8aOg23Pa 7AL5I9S/zG8iToiyAdOC6xWvCVE86vTQjy9rW0/eOkMoPxEfWhQKY0qNUPJQ/hFnGtHS iESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oY2Chowc4SQySw+6C+5DRyDl0UARJ+U4ZlKIcsKMNC4=; b=EViTJLrjuXQ5iS+qix3FZtItxlYYraBHq7vxeQDUPd00tN6Yg5tiHmJWwjl9C655Id 3F9uP0nxBg3KWbkO2KucJzInHS8PlgsYHnT8hfR3jvDoU0y9pAXcV7Tn9W3qdPgIBdPv Kxu3k1iVov5sIJlco5bl51W4wimsxCdKXmLbmnHfN3lH0AwfTSguNWx/6M17D/1W2hMN oUyuXqRNXnvSGps+gOQ5OVMongBc0Nb2bYFgxHm7L0/12PyC67C1G8R9oczVUSPF4q9C 4ct/CWKQHO0UIenyR47WvUWadV+qdm62Nd6NHVHI2lQhfAmc6eHgsU1+49MYESOrVtpE Mamg== X-Gm-Message-State: AKwxytdnJH2bvHpk8TuNMAM1IBUnW/Pxn/icWavC9knKuCtYRbYAXRRN PjH/VsJFe9DZyam4wONuAMgypic= X-Google-Smtp-Source: AH8x227YpFojAvElCU0lawnPgrzzoeNu3LEtSGY6ZWSo/qOKc58/ynvpyT0/gDAuMLWnLs2bU7l14Q== X-Received: by 10.101.101.26 with SMTP id x26mr7753516pgv.149.1516655521767; Mon, 22 Jan 2018 13:12:01 -0800 (PST) Received: from Stas-Pro-2016.lan (c-73-71-144-171.hsd1.ca.comcast.net. [73.71.144.171]) by smtp.gmail.com with ESMTPSA id 12sm2573007pfr.147.2018.01.22.13.12.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 13:12:01 -0800 (PST) To: Michael Morris , PHP internals References: <9a3a8760-f65a-a5c0-b318-1830a9a986c3@gmail.com> <9352F6DF-9940-49A2-9B1D-FA9258E9738E@lerdorf.com> Message-ID: <8ce8f4d4-8240-4d0b-dde7-5ba6e0d78ff4@gmail.com> Date: Mon, 22 Jan 2018 13:11:59 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:58.0) Gecko/20100101 Thunderbird/58.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Strong Typing Syntax From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I want to see strict typing as an option, not a requirement. You seem to be under impression that this somehow makes things easier. It does not. To explain: let's say you design a strictly typed language, like Java. The compiler knows which variable is of which type at every point, and if it's not clear for some reason, it errors out. You can build a compiler on top of those assumptions. Now let's say you design a loosely typed language, like Javascript. The compiler knows variables have no types, only values have it, and builds on top of that (as in, it doesn't need to implement type tracking for variables). Now, you come in and say - let's make the compiler have *both* assumptions - that sometimes it's strict and sometimes it's not. Sometimes you need to track variable types and sometimes you don't. Sometimes you have type information and can rely on it, and sometimes you don't and have to type-juggle. Do you really think this just made things *easier*? To implement both Java and Javascript inside the same compiler, with radically different types of assumption? If you have desire to answer "yes", then a) please believe me it is not true b) please try to implement a couple of compilers and see how easy it is. Having two options is not even twice as harder as having one. It's much more. So "optional" part adds all work that needs to be done to support strict typing in PHP, and on top of that, you also have to add work that needs to be done to support cases where half of the code is typed and the other half is not. And this is not only code writing work - this is conceptual design work, testing work, documenting work, etc. Without even going to the merits of the proposal itself, it certainly looks to me like you are seriously underestimating what we're talking about, complexity-wise. I am not saying it's not possible at all - a lot of things are possible. It's just "it's merely an option" is exactly the wrong position to take. > Create a symbol table that holds the strict variables and the types they > are locked into. The strict keyword pushes them onto that table, the var > keyword pulls them off. When an operation that cares about type occurs > check that table - if the var appears there than authenticate it. And now every function and code piece that works with symbol tables needs to be modified to account for the fact that there are two of them. Every lookup is now two lookups, and no idea how $$var would even work at all. -- Stas Malyshev smalyshev@gmail.com