Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120085 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27869 invoked from network); 20 Apr 2023 19:30:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2023 19:30:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 12AE2180503 for ; Thu, 20 Apr 2023 12:30:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 20 Apr 2023 12:30:51 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5067736607fso1340992a12.0 for ; Thu, 20 Apr 2023 12:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20221208.gappssmtp.com; s=20221208; t=1682019050; x=1684611050; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rcnw3baG6AlwJZeUyKoss9/62Jf7E2kzDBjD7i8Bl84=; b=KkDi9KlvRFKIQ2hEnfkYa9XEvly/sgifZ0f3KL9wp3jOdj5sJZBSVq+eZ7R94Fhcw2 2mMCt2tBkJD7brpVk17At7J3vIoy3yr4XX9luRBIa8QWONcyMfFnK9fOdxRlHA4lFK5j 3OJ6SKd6Vim5WuaV+I7389GHZT6QU+CY3PRPZtyJgRdkDqba2x4Smspa73gIn3DboWQR Wev8+u4fk1IvCiJrPQvRpU7HAY4ozlfjaxh2+wDGXbhAX4wVmnPuLUitJE6+ysMVieA1 iL76VqZRh/QcUB1UqsTOMLrHzPi2+qiOGwc5NAxKP6qjFAmI/mDiqhMEAPfKX+fyikRn XECA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682019050; x=1684611050; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rcnw3baG6AlwJZeUyKoss9/62Jf7E2kzDBjD7i8Bl84=; b=WHfyyQzm36qtI+cU8EUP8GlgE1N7LPvjd1NNNRR3gRD+ZaWOx6R057bHLrJz2hl0nA nEF+brkIJuMGxBcHFb25fD1f9RTR3LTfP152kCL3wQG53of9xJqXY744KG987YU14DjL VA7wDqJV35lZ+DIZm6HeY+LlU9d87/7LBS+uHdhHzRqtu/e6SJz/9Dr7M144wGKhTrIv 9LTuzGq2qSdgO0VEaRKE5stHLVtTZicVA0EWAj8E5e2mf5GaLnpatoqO7mqT/dXe4iK2 XyAi58y4VsHWCp3NQeeC7WeJHchrmPtU/dAr3sFG5tw/BONBAHQa7D1cFUEc5KTMzKO0 bNGQ== X-Gm-Message-State: AAQBX9cJVHEtDl4V1Didc9VpN3OEg1dZftzbwrT7gsPzqJXyF6wNjukF rQyaforwF+rEQlo7v1HRtMUDWtTVhBCiP5OSCiQJTWGzw5g0jgPTUSc= X-Google-Smtp-Source: AKy350Zu0jc1r8SZt6OhzQ/uDAH1szotBMi7laZ+2EohiyZAmwwWkf+qdbr9OXg2yyEmgU3bYI0vey3/veG2oSP6bl0= X-Received: by 2002:aa7:d89a:0:b0:504:8efb:c103 with SMTP id u26-20020aa7d89a000000b005048efbc103mr2534819edq.0.1682019050263; Thu, 20 Apr 2023 12:30:50 -0700 (PDT) MIME-Version: 1.0 References: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> In-Reply-To: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> Date: Thu, 20 Apr 2023 20:30:39 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [Discussion] Callable types via Interfaces From: Danack@basereality.com (Dan Ackroyd) On Thu, 20 Apr 2023 at 18:25, Larry Garfield wrote: > > Hi folks. This is a pre-discussion, in a sense, before a formal RFC. Hi Larry, The "Allow casting closures into single-method interface implementations" one seems a complete non-starter, as that seems really hard to work with. You'd have to do lots of "wiring up" to do any significant amount of programming. "Allow Closures to Declare Interfaces they Implement" That sounds bad as it doesn't allow arbitrary functions to be used as callables. > We feel that the interface-based approach is strong All three of them are using interfaces...? But if you mean the "Structural Typing for Closures" one, then I'd probably agree. But as currently proposed it seems like a hack, that would be predictably regrettable in a couple of years. > and a good way forward for getting typed callables > without a bunch of dependent features needed first. Maybe list what you think the dependent features are, so that there isn't confusion about them, but I suspect that we're going to not agree on how languages should be designed and evolve. Although I really want to see typed callables, and other forms of type aliasing, as they would be huge improvements in being able to write code that is easy to reason about and maintain, I don't want to seem them as soon as possible, having taken short-cuts against good language design. "No is temporary, yes is forever". cheers Dan Ack