Re: Better types without runtime checking
| From: | Michael Morris | Date: | Tue, 05 Jun 2018 15:26:57 +0000 |
| Subject: | Re: Better types without runtime checking | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-102171@lists.php.net to get a copy of this message | ||
On Tue, Jun 5, 2018 at 2:22 AM Rudolph Gottesheim <r.gottesheim@loot.at>
wrote:
> There's always a lot of talk about types in the PHP community.
> Specifically, many developers want property types, generics, function
> signature types, union and intersection types, and more. Those talks
> (and RFCs) always end with the same result: "We can't do it because
> performance issues."
>
> Has there ever been a discussion about adding some of those features
> syntactically, but ignoring them during runtime? At least until someone
> finds a performant way to check them at runtime. That way we could have
> advanced type checking in our editors at least.
>
> The idea will sound familiar to TypeScript users. It works great for
> that language.
>
It's an interesting compromise, but I worry about the confusion it may sow,
particularly for incoming programmers from languages that do enforce such
things - such as Java.