Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92394 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72157 invoked from network); 18 Apr 2016 05:20:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2016 05:20:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.218.47 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.218.47 mail-oi0-f47.google.com Received: from [209.85.218.47] ([209.85.218.47:35007] helo=mail-oi0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/20-32052-58E64175 for ; Mon, 18 Apr 2016 01:20:07 -0400 Received: by mail-oi0-f47.google.com with SMTP id p188so177434092oih.2 for ; Sun, 17 Apr 2016 22:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to:cc; bh=z50BFDrD9a6xOJI4EyVevITIAlSdfszddomzrfJOh6k=; b=v8swAsG/KCb43fKLClOE7rKFbYoStXqacaUCBvE4NUypTZJyHb71yKPysRHCvvF4gl GN4yXNtQsLmiO3PAVL/5PuD4kGb++iwkuHa/40KWEX1x5UpRHEy8Y+U3FT0akvku+7cf n2KO2Ac/RrLlJ8qucQXKXkfQR6wGdcekjDVuoIBG4DnHYCUb7wP3AHT/75K+19ul6lfj aAdGccL+GrX7fCqyvoOHudSEIKaqt+E7LL28XiPzno9qDtgT4m1e8SyFCAXve/wZewit eT2Koy1FpRY+3lp2lIKsuCJybiJuWke8ighN5bedUdeqHR6GfsmIlOzQuuArcmS4aFaG vP/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=z50BFDrD9a6xOJI4EyVevITIAlSdfszddomzrfJOh6k=; b=JmhGfhbZPyKNJUIj/JEniSJSDSFEHRiYAWPcTfdM/07lgHVIPKsm5tVhaEhku5ZanR SP5EgKglmo9chfq57mdGR7q7WW1H2AwDDAuvDEIQTGwznvkHks18t0Ajozk5rsrLjTrB N3fyij9HWTghx/fxgPhmBG5/iIlAJwMsmrIKfaLv5XomFJenlalrLf5Px78OIbUn9Fb3 NdRWXRXxHZ3Y5ODtB22Tmbpj+PvwRlVPYZdRZRU2v8QxGoyKuQKLTzE803KFhF/b9fm2 CecNNJu06kAurNp1cANQ0yA841bOqD4ZI2ZUAfVNa+7Z5CFNKwiNuv9UUXZaZcWer1OT Ayow== X-Gm-Message-State: AOPr4FWgW7fw0p+yIxt5AAHeU4Rb7Iof5Mo/19ZZae9PdVPskPVSagtzxWOLhe4olR9KXZYPlHP9rz9gmpbqzw== MIME-Version: 1.0 X-Received: by 10.157.58.100 with SMTP id j91mr16490103otc.43.1460956803291; Sun, 17 Apr 2016 22:20:03 -0700 (PDT) Received: by 10.157.37.120 with HTTP; Sun, 17 Apr 2016 22:20:03 -0700 (PDT) Date: Mon, 18 Apr 2016 07:20:03 +0200 Message-ID: To: PHP internals Cc: Ben Scholzen , Dominic Grostate Content-Type: text/plain; charset=UTF-8 Subject: [RFC:generics] From: rasmus@mindplay.dk (Rasmus Schultz) Hello internals, I'd like to introduce an RFC proposing the addition of generic types and functions: https://wiki.php.net/rfc/generics Ben Scholzen started this RFC as a quick draft with a few code samples in August last year, and I have since then worked with Dominic and Ben towards a more complete, detailed RFC. There are a few holes still, which is why it hasn't moved from Draft to Under Discussion yet, but we feel that it's complete enough that we can start a discussion about this feature and try to iron out the remaining details. The RFC was previously "unofficially" announced on reddit - this thread generated some good questions and may answer some of the most immediate questions: https://www.reddit.com/r/PHP/comments/3zx8qs/php_rfcgenerics_update_03_please_comment/ One of the most common criticisms we've heard, is that the syntax would be hard to implement, a few have said "impossible" - but we feel that, if generics are introduced, it's important that the syntax and features be as familiar as possible to developers who are experienced with other mainstream web industry languages, such as C# and Java. To that end, Dominic Grostate has worked through most of the tokenizer/parser issues - save for one very exotic edge case, his fork demonstrates that the proposed syntax can be parsed: https://github.com/orolyn/php-src/commits/generics Note that this fork is by no means an implementation of generics - it is proof of concept as far as being able to parse the syntax. We're hoping to find someone, with more experience working on the php codebase, who is willing to collaborate on further implementation - and we do also have a partial test-suite, defining the big picture expectations for most of the proposed language features: https://github.com/orolyn/php-src/tree/generics-tests/Zend/tests/generics We look forward to your comments, questions and (I'm sure) criticisms of this proposal! Thank You, Regards, Rasmus Schultz