Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124134 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 36FFA1A009C for ; Mon, 1 Jul 2024 11:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719835145; bh=8/sjKluRd8U94p2zwQKi3moKkMq8wf/a1XNNF8dSnYo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HzaoVQ6Z+tcTFtRcrzjcm51SFimmgI11iclZyu3UogzVKXDEE2PNIMAmNcHCNieHV feWffV4X1FxSuAWcPyV26SIW3/Bk5btnTFuX6N/MNySMdrKTKo3p2pl7EKV10YHckT kGq7+yyjxAtqNvesmXmMwGSZ0kLppHUDbcWvIczGoTyaDp4ITbDw0ymCUIZcVQzmo2 gur3a+G97xS+sSwZSfRl/zBpCdHHvW0bB2GEgpyXGz/BFx8ZMFtWbUun8mfftvhKdX 5cqCfjjcsFaoJJ0bnA9XXxWvS/q53eizT2uh9Em9BN68ctl0/U3E28bhjQet407e+M lCkWQytZWTuUA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A25AF18068A for ; Mon, 1 Jul 2024 11:59:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,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=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 1 Jul 2024 11:59:04 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-36743abace4so2536452f8f.1 for ; Mon, 01 Jul 2024 04:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719835062; x=1720439862; 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=GsEPkYhG9kntCcIXvVuURttDPI0g0S1+g33bh56ND6M=; b=RjAhVS8kR8XCzMqRXxpBHzalF6/gVM3fd3BN8aC1rGy99QHV55qHmujGRKIfxpKNxJ RWDtn6qkBFZh5Re7G73wZr1+IU8MTojnkYvWj4U1Cmj4JAL2CDQQ4i0XA3HTG5j+rmIU q8V9ZHxkHZTwGgDqMu5BhbGrfpTLIO4kLG4MSyhsoLbtDVrwEZWLBZG+0JD8Mft8ILUD L9rP1+3DnCgFbC+3Pdla/S5fVdG8DVqutYB8q/ItcY6WPqvdPNLzuBYUMpdBGlEI2nMd TEnuptK7WQEXko46yGUfCdGO14oTrYq09iW0uPyxEyrSIQ8TawE/GrkJhXgHTON62dPM 3ujw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719835062; x=1720439862; 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=GsEPkYhG9kntCcIXvVuURttDPI0g0S1+g33bh56ND6M=; b=p0fm5m1A+b0r1Nb6ld61Hwxvba7SrQ718PE/02Q9xIX4nyUaRqVVcRZWgRT0pzwXsk eoTJIVw/4hSWvXkiy1VaPWyEY16CH3s1WkD+ZhTy+0pG6kU1bYrXTcjsoYoaIx6MV+wj dc6+1tLoAqEf75z1RhPNefoTLfZEWuk2/hj2D4FWW2lMXZozBHtj2v5LC2M3YYSEKbI8 h3rK21pBufLnFSIc8OUlyecuEoXaCBolg5KHE9TRk0KSQKzrZUCVa10f6Sm7YHi73jwZ ntttrHgzPcJ3kZDwiSQZ4JxxwqBjXipa8xL/A+lXHDSdL3M77OqDwQShydxfZpWrqvOY JUvA== X-Gm-Message-State: AOJu0Yw2dpwLYFCG/3EwU2LVPkKfhlaBSWJwTKbZUOvuQxZHIskQ+2dF uIcGh6jJ/9c58w/WFmzgFEE72H5Z9OiPH2y1WjfP2U/MIPik+iDJluLBivvMz8IFlZNGdK8BejC CC4tzSt2cluNe4enf0b5//xfnx+WPnwx+ X-Google-Smtp-Source: AGHT+IGrQh8tfM8Da3C8EOI8Nq90g8ZrAKFzIWjSCH3JiQllqLUD4bbbVIt5uPnTuIGvFOz9ZHtdNDt86n5NHhNKLwI= X-Received: by 2002:a5d:4e51:0:b0:367:409b:1d1e with SMTP id ffacd0b85a97d-36760a722eamr7904206f8f.12.1719835062180; Mon, 01 Jul 2024 04:57:42 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <1917CF7C-26D8-4DBE-B05C-5AA650AC6C9F@rwec.co.uk> <551cd5b0-1c00-4818-a9ca-97f6b7e8c3dc@app.fastmail.com> <39B496F8-062E-4848-9B3B-529BE8D3415A@newclarity.net> <856F4F70-DC81-4098-82DD-5F6D47CDF3F0@newclarity.net> In-Reply-To: Date: Mon, 1 Jul 2024 14:57:06 +0300 Message-ID: Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) To: Michael Morris Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000f4267d061c2e4dfe" From: arvids.godjuks@gmail.com (Arvids Godjuks) --000000000000f4267d061c2e4dfe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 30 Jun 2024 at 23:30, Michael Morris wrote: > So let's take another crack at this based on all the points raised in the > thread. This should also underline why I don't consider this an RFC - I a= m > iterating until we arrive at something that may be refinable into an RFC. > And I say we because without the aid of those in this conversation I woul= d > not have arrived at what will follow. > > *snip* > > TL;DR: As a userland developer, in my opinion, this is just a downgrade from what we have now. Enhance namespaces to have the ability to have internal/private classes, interfaces, enums and constants. That's about it. Autoloading is one of the best killer features of PHP - love it or hate it - it's your personal preference. I've seen a sizeable chunk of developers that come from other languages discover PHP's autoloading and their minds just get blown. Performance has not been an issue for a long time due to opcache and all the optimizations that have been done to it and ability to preload bytecode. Then there are things like FrankenPHP, Swoole, ReactPHP and others that entirely sidestep that issue. And then there's the active development of JIT engine - just let the people working on the implementation time to cook. It works, worked for a long time and there are not so many things wrong with it to entirely upend the whole ecosystem and split the language. Here's your HARD REMINDER about Python 2 =3D> Python 3 and how that went an= d is still somewhat ongoing. Sometimes copying things from other places is just wrong and does not fit the ethos of the language you want to change. PHP always was and still is "doing it's thing". Practicality is on the high list of priorities here and that is why many of us have chosen the language and stuck with it 2 decades in. The only thing I want to be added to namespaces is the ability to define internal classes, interfaces, enums and constants so that when you write application code, the internals of packages and your own code's "private" details do not leak to the business level layer via autocomplete suggestions and in general reducing the cognitive load of that aspect. And there are obvious advantages of locking down the internals of a library so people do not abuse it and then complain when things get broken. And i don't even want to comment how you want to bring composer functionality into PHP code and make it a weird combo of PHP, composer, docker-compose.yml - insert the "WHY?!" meme here. What I love about PHP ecosystem is for the most part, every tool has its main job and it does that job exceedingly well. PHP core is developing the engine and doing a great job. Composer is doing its job and it is the best package management tool out there. And so on - we have one of the best quality ecosystems around because things are not jammed into each other and trying to create a "supertool". There is something to be said about Internals refusing to if not endorse, at least acknowledge the popular tooling and lean on it more (like rector for upgrades and so on), but that is a completely different discussion. The PECL is being worked on to be replaced, so we can't even raise that point any more - PHP Foundation is taking care of it. --- Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Telegram: @psihius https://t.me/psihius --000000000000f4267d061c2e4dfe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, 30 Jun 2024 at 23:30, Michael= Morris <tendoaki@gmail.com>= ; wrote:
So let's take another crack at this based on all the points r= aised in the thread. This should also underline why I don't consider th= is an RFC - I am iterating until we arrive at something that may be refinab= le into an RFC. And I say we because without the aid of those in this conve= rsation I would not have arrived at what will follow.

*s= nip*


TL;DR: As a userland developer, i= n my opinion, this is just a downgrade from what we have now. Enhance=C2=A0= namespaces to have the ability to have internal/private classes, interfaces= , enums and constants. That's about it.

Autolo= ading is one of the best killer features of PHP - love it or hate it - it&#= 39;s your personal preference. I've seen a sizeable chunk of developers= that come from other languages discover PHP's autoloading and their mi= nds just get blown. Performance has not been an issue for a long time due t= o opcache and all the optimizations that have been done to it and ability t= o preload bytecode. Then there are things like=C2=A0 FrankenPHP, Swoole, Re= actPHP and others that entirely sidestep that issue. And then there's t= he active development of JIT engine - just let the people working on the im= plementation time to cook.
It works, worked for a long time a= nd there are not so many things wrong with it to entirely upend the whole e= cosystem and split the language. Here's your HARD REMINDER about Python= 2 =3D> Python 3 and how that went and is still somewhat ongoing. Someti= mes copying things from other places is just wrong and does not fit the eth= os of the language you want to change. PHP always was and still is "do= ing it's thing". Practicality is on the high list of priorities he= re and that is why many of us have chosen the language and stuck with it 2 = decades in.=C2=A0

The only thing I want to be adde= d to namespaces is the ability to define internal classes, interfaces, enum= s and constants so that when you write application code, the internals of p= ackages and your own code's "private" details do not leak to = the business level layer via autocomplete suggestions and in general reduci= ng the cognitive load of that aspect. And there are obvious advantages of l= ocking down the internals of a library so people do not abuse it and then c= omplain when things get broken.

And i don't ev= en want to comment how you want to bring composer functionality into PHP co= de and make it a weird combo of PHP, composer, docker-compose.yml - insert = the "WHY?!" meme here.
What I love about PHP ecosystem = is for the most part, every tool has its main job and it does that job exce= edingly well. PHP core is developing the engine and doing a great job. Comp= oser is doing its job and it is the best package management tool out there.= And so on - we have one of the best quality ecosystems around because thin= gs are not jammed into each other and trying to create a "supertool&qu= ot;. There is something to be said about Internals refusing to if not endor= se, at least acknowledge the popular tooling and lean on it more (like rect= or for upgrades and so on), but that is a completely different discussion. = The PECL is being worked on to be replaced, so we can't even raise that= point any more - PHP Foundation is taking care of it.

---
Arv=C4=ABds Godjuks
+371 26 851 664
--000000000000f4267d061c2e4dfe--