Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120829 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82331 invoked from network); 17 Jul 2023 16:59:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jul 2023 16:59:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 893801804BE for ; Mon, 17 Jul 2023 09:59:17 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 17 Jul 2023 09:59:17 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B30AD5C0089; Mon, 17 Jul 2023 12:59:16 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Mon, 17 Jul 2023 12:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1689613156; x=1689699556; bh=tDhw1BWew9 JQgSAKzuslVKFYXBrG7NXfzU0iLT1aT00=; b=sKnnV50ZRPpsa1aDauBs3iLQr3 +aSphFLQ0BRh2s7vDE2bsydoFIxPngeXB63Cgpg+baQ8n//DgCCvrzq2S50T6DTK aUeF5gsAz12ZjlldOW/qT1spWz2ksPSKq3YBICzRWGZj7E1Cm0zXvByFY7uLwbgE bZM8yJnK8XSKyrg3XRtwV2DPKGoQiXdfPQKyB9KC5Y+ih45Ri9qgXH/x1lIP+OC+ uyrW+t4YN0EjeCrvLcg1yDepwdVHyM9h0CVhq/GxAtCKGCW25qejP6g+dq/Cr6rT TUD3kjXylnTy0capZIy/xUuxKv6ma0WxiI7jj3sPV7ux8FC01xago+7GkYUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1689613156; x=1689699556; bh=tDhw1BWew9JQgSAKzuslVKFYXBrG7NXfzU0 iLT1aT00=; b=c9aLSZdmTO5KaZr/A2xPqh70LZ9bqgLDpJOJ+6NJTVvW4ry4hk9 5nRzoK4Uo2k8v3BpgY/95zH53WQsQvbu5rz3JanZpm/IHTMnfuzdiALN6FqZq/vC uThPnyvdMy/UQQfmqA6dP2vQwsPwev1r63u4DmxPqZn6MuTH3ZJBt6p42/CJxr0y vWSu2qK0f4wnTv2pR6rfHn9JWEe2DEvMn+6m/mZaPqgYslIta2rXtW1v+kznbgRT UUhTNFesqkhuHbNBJpwGKQ9GZQxzsEad4blTcsenQk1vGYXheMUHIRTl6lDWzbSE h6VO/qnNd2BCh05s7n8lyP67WE9uhqP6OeQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgedvgddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfn rghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrd gtohhmqeenucggtffrrghtthgvrhhnpeffudduveeggefggeffudekheehheelvdejfffg vdekheduteejtedtuedtheehudenucffohhmrghinhepghhithhhuhgsrdgtohhmpdgvgi htvghrnhgrlhhsrdhiohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 42DF41700089; Mon, 17 Jul 2023 12:59:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 Mime-Version: 1.0 Message-ID: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> In-Reply-To: References: Date: Mon, 17 Jul 2023 16:58:55 +0000 To: =?UTF-8?Q?Olle_H=C3=A4rstedt?= , "Karoly Negyesi" Cc: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] pipes, scalar objects and on? From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jul 17, 2023, at 2:57 PM, Olle H=C3=A4rstedt wrote: > 2023-07-17 14:25 GMT+02:00, Karoly Negyesi : >> Hi, >> >> I tried to read on why the pipe RFC failed but by and large I also fa= iled. >> >> The discussion on https://github.com/php/php-src/pull/7214 is very sh= ort. >> >> https://externals.io/message/114770 is not so short but it seems not = to >> cover the latest version which uses first class functions? >> >> Could someone please give me a summary why it failed? I really would = like >> to see it succeed :) I am writing code if not daily but certainly wee= kly >> that certainly looks like a pipeline. > > The pipe RFC was kinda forced in before a deadline, no? > > My own two cents: > > * It's trivial to implement a pipe() function or a Pipe class > * A Pipe class is better than both a function and built-in operator, > since it can be configured with custom behaviour, e.g. stop or throw > on empty payload, or repeat on a collection, or even with parallelism > or concurrency > * If I had voting rights, I'd vote in favor in a pipe operator :) From my recollection, there were a couple of things involved. 1. It was intended to pair with the PFA RFC, which didn't pass, which ma= de it a bit less compelling. 2. It was close to the RFC deadline, and it seems people get squeamish a= round that. 3. Some folks wanted Hack-style pipes instead of the pipes used by every= other language with pipes. I've written before on why that's a worse de= sign. 4. Arguments that it can be done in user space, which is not true, as I = have a user-space implementation and it's comparatively cumbersome and d= efinitely slower than a native operator would be. 5. General "meh" attitude on FP features in general from some people. Side note to Olle: If you want a customizable pipe, you've just describe= d a Monad. :-) It's literally "contextually-sensitive func concatenatio= n." A monadic bind operator would be harder to do with PHP's weaker typ= e system, but there are ways it could be done. I'd like to bring the Pipes RFC back if I thought there was a reasonable= potential for it to pass this time. I would use the crap out of it mys= elf. Though I've also since decided that we do need a straight up func = concat operator as well. (I previously thought one would be sufficient,= but in practice I think we do want both.) --Larry Garfield