Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121295 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79441 invoked from network); 13 Oct 2023 02:29:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Oct 2023 02:29:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DC9BC180041 for ; Thu, 12 Oct 2023 19:29:15 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (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, 12 Oct 2023 19:29:15 -0700 (PDT) Received: by mail-vs1-f43.google.com with SMTP id ada2fe7eead31-4526efb9d9eso270113137.1 for ; Thu, 12 Oct 2023 19:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697164154; x=1697768954; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GKRP9MnoDDDBzAB9nuRsjxEp/phewMHOSC+NG8fcbNA=; b=DszgVDci6rZCDT54NCcdCXey/dn8TRiHe5ttjhNmYeKchQGVzNkF4bA4qBJl1+Rcm+ LeIffzibNq3GuNFFDZVtzuZDLkOQf0fimDUZGwriNWkwumNcfKCj1eH5sCk3Xuz6DVZH k+h6MTUEZYQfuJ8XCRMYnqJdpyuFWylwB21CNMqMPK/cIOTr2qvobGhhrzX7YhzGKDUx h8OJjeQxC7C62WEViKxZMa2fgXjseCT6yJauouUvuyMunzRZj7zuqnc2gS0fbTZMU/hF b07hCy94H7wwQzP9d2rjxBoazO+YUpkLTAJwDdBtbVag08fx0wDsMZBPwBDKZpV25lve ERIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697164154; x=1697768954; 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=GKRP9MnoDDDBzAB9nuRsjxEp/phewMHOSC+NG8fcbNA=; b=VbiD3oKoA+zAmPTBFV19AqyncHD3dP+GbNFEEZCRWblWibhU+PjITMvlnSLSJM40+r 26TDzhZf6UtSqRC8QJrU/VXaKoQeGZw4xSRRzNiQvsQh4XONFOkCULAp3yOC3XtOOVAe 1LFDLntQPNtSbJPJNa9qmXqyiUquruOu7AMaxranZkhK2Wzb3ju4bjANkcvdpQPGQRP1 D3WUAWWORylffwK7Q8TgxQzrS+sJGyVaZxnuDW0s65/p0zMVkT+p9T9QBni01Zf6SzZx frrrnY2mhxWBXKvLO/TY1whkN6KO1zYnXaLbIAqcAMOVAzRprZD3Iz6eeBHW2ZQDAVjl BAYw== X-Gm-Message-State: AOJu0YwTYZH1XUskfz0SOs4jyQQJBYFAw/A5dME67Btor1DyNEfHKL60 zsXQ57DPotv9zJYMwy58vlaM4Nimj9/Hk8vWGbU64Ps9 X-Google-Smtp-Source: AGHT+IEs8y8SplxhxgcYk6egnmMB57kOUHYQYX+FEcQr2d4R8T2ptlBkZrATM1avQWEAPhD1njB9JKamOYf+MQjIPUQ= X-Received: by 2002:a1f:6e8c:0:b0:493:69f1:d12d with SMTP id j134-20020a1f6e8c000000b0049369f1d12dmr15191435vkc.1.1697164154520; Thu, 12 Oct 2023 19:29:14 -0700 (PDT) MIME-Version: 1.0 References: <0b72d5e0-94dc-8837-bfd4-d2e24ab9db05@online-presence.ca> In-Reply-To: <0b72d5e0-94dc-8837-bfd4-d2e24ab9db05@online-presence.ca> Date: Thu, 12 Oct 2023 23:28:38 -0300 Message-ID: To: Lanre Waju Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000008e548a06078fd237" Subject: Re: [PHP-DEV] Why did fibers get added to php core over something more fleshed out like swoole? From: deleugyn@gmail.com (Deleu) --0000000000008e548a06078fd237 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 12, 2023 at 10:00=E2=80=AFPM Lanre Waju wrote: > I find it puzzling that the PHP internals have chosen to delegate this > specific functionality to userspace implementation. Fibers, in my view, > seem somewhat limited without the addition of a third-party library or, > at the very least, the necessity to implement an event loop in userland. > This raises questions, as it effectively obliges users to rely on > third-party libraries to handle a fundamental feature rather than > incorporating it into the core of PHP. > Seems like your description here quite matches what the goal/aim for Fibers initially was; a low-level API to help userland libraries to build async PHP code. > Moreover, I'm curious about why PHPDBG doesn't implement the Language > Server Protocol (LSP). Could it be due to its reliance on Xdebug? I came > across this discussion on https://externals.io/message/78456, which > makes me wonder about the decision-making process within PHP internals. > It sometimes seems as though certain choices may not align with the best > interests of the PHP community. I would appreciate it if you could > provide insights into why this might not be the case. > > > Lanre > My personal, non-fact-checked guesswork about the current state is that PHP had a significant history of decisions that made future work on the language harder. As time passed and the language had more and more features naturally the project becomes harder to maintain and navigate, which affected how future decisions were made. The BC promise of PHP has always been significantly high - some edge cases and significant BC breaks have happened, but they're not the norm. Naturally the next step in this history is to become more conservative. Userland libraries can have faster release cadence, requires PHP maintainers (bigger pool than C maintainers) and breaking changes are a lesser problem to a certain extent. Discussions around language evolution, editions, etc has happened as (among other things) a possibility to make BC breaks less impactful to the world wide web and lower the barrier in getting an RFC approved, but these discussions never led to a concrete implementation. As it currently stands, PHP is a solid language with stable and proven APIs with Composer and Community packages covering the gap in consistency, technology evolution and developer experience. I'm a big advocate for having some language changes that makes common and fundamental use-cases part of the language i.e. it's quite unfortunate that a 30 year old language that powers the World Wide Web don't have a Request object, but history has made PHP quite conservative and there hasn't been a significant change that invalidates the reason to be conservative yet. On top of that, some voters are extra conservative when the topic is added DX built-in to the language, specially because DX can be subjective (see multi-line arrow function). Long story short, Fibers being something "incomplete" from a userland perspective is a feature, not a bug. Look at it as the simplest, smallest (while still being feature-complete) way to expose the ability to write async code in PHP while Swoole is almost an ecosystem on its own. --=20 Marco Deleu --0000000000008e548a06078fd237--