Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124146 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 5EB361A009C for ; Mon, 1 Jul 2024 16:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719851031; bh=Y3N9ecyaoIWPJDXfz9Q1ItzkV5YtDEqm/1lwIDABEsc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=XsciuDUC9KQG+8dCzyrAJJ84Fmo4TLXjswK3u1w0npDAWDm5xzKFUYPF0hE0KLdTj YSxZYa5O/5t/KAlaFMCDTx3oP/vRkjfYW2p3kG1rH3+XA6uocRdgLtFFNBVujmgTkO tAZCATOJ/rJRy5VKT5I59dOOJzMb4Pg0LiiXsWraiAMLd18sdBynw2BmMg0kAHi29P cHaBD1ic4vFt7reaQF4vpMb73krXDFnxU7qjO1evLXbKDvMTMgvPNK+r7wdE6CD6T9 v7Akw8ywF7uVwEST9qxu3mOlcGMJ1OQIHJnOxatE/1Y+FOPOEXaDlVRO6bHbJ+rJMl zYNJdaqoJNJcw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17F5B18071A for ; Mon, 1 Jul 2024 16:23:49 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,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-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (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 16:23:47 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-dfde5ae0aaeso3225308276.1 for ; Mon, 01 Jul 2024 09:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1719850946; x=1720455746; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3UvRtoXJugOLueIU1ORCMagIRmhpmCfxoTOuyI2n1zo=; b=rUPL1bGQZtU/ldURCkpQ5zvQpc8GffdgS10UINK8/JwBctQ7zqGRlAmWoR0kF81nwr Gv8w5psMOJQfvfcP8Yh2ByxwSXquUL0FTsiZKkpBesQGjP9f3A3X9DGDXWdrSFyoYW1e eBRuxdaOONSHGa1GNYMp6AQzF2XAXLxfyoE4iI7Zi9XQwJQBie1JjTHOKW2Dt+eaCCbv Bon3V04W7242lelzUz70BKUTNJxBwu2vV98XuPEn7V8SPJgVzPGezX1BXmdd+aa5tg/o itUj5t0NZqRAvqh/ZvyOZfgMjUt2uUZNkkG777DAv/HmQu6iiRffBGoMbHYLlYmCTLlY WqTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850946; x=1720455746; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3UvRtoXJugOLueIU1ORCMagIRmhpmCfxoTOuyI2n1zo=; b=Rzi3t4jrXvvWTMvTXWXkruBfOfGP1JyGorKlcr3/V0BMgYEhKWBn/K0pKtu58/eEHm LbjP6L1H9O7KRDqQPXULzt9zbjh7rL0THyuzLGwLs+SX+RLDb9lLw3uAJHZo7TrERg0i VLaHBqPcAWZrKbysiKjSrzSxvMtvdkDh4K967jdD0aTsrj4hro3YKW4M6QXCoi0yQz2y 72hrJYBOAjnP+V6zQpudjBdm8/y17xw4DASouNG3CXfudtRRpS3Urg3Rprh7wh5cE4Te eJndKJVgWJcYmnWrVqSrGyPu1JQsF87l7sMGjqhNrJxf0BLJ9cQxi0IxbEPEofSx4dQu X0/Q== X-Gm-Message-State: AOJu0YyV4q0QREPUKrNxw141XR5/toZLDbH9l//b/Ak7hDw95D0Z/qnB YmAtxMfxgf5cMOupV85lnbMsUNNLn3ow5+UGVRKbYoQRKa+4rlyu0drqsPfjL+SLKu4ogaNGjsl fVQY= X-Google-Smtp-Source: AGHT+IFHS0nCt+ixsuF8aD2+mxJfI32ouPtwMSks7AGTdEPVgRojpKkoO2LgmNTddCD9cx/esi3BJg== X-Received: by 2002:a25:df47:0:b0:e03:5130:a498 with SMTP id 3f1490d57ef6-e036eb6f9ebmr7591860276.34.1719850945883; Mon, 01 Jul 2024 09:22:25 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e0353d6abd9sm1405366276.14.2024.07.01.09.22.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jul 2024 09:22:25 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) In-Reply-To: Date: Mon, 1 Jul 2024 12:22:24 -0400 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> 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> To: Arvids Godjuks X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) > On Jul 1, 2024, at 7:57 AM, Arvids Godjuks = wrote: >=20 > 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. Please note my comments that follow do not mean I am in support of this = package proposal as presented.=20 > Autoloading is one of the best killer features of PHP - love it or = hate it - it's your personal preference. Two really solid reasons to hate autoloading as implemented in PHP: 1. Autoloading runs userland code. This means it has the potential = conflict between different packages with different autoloaders, it means = there can be buggy autoloaders, and it means that when using XDEBUG = every time a new symbol is found when the developer is single-step = debugging the developer will be dropped into the autoloader and then = best case they then immediately trace out. All of these aspects a major = PITA and time waster and make debugging more exhausting than it needs to = be. 2. Autoloading effectively necessitates that every symbol be in its own = separate file. This needlessly bloats number of files and directories by = more than an order of magnitude =E2=80=94 see my numbers from recent = discussion =E2=80=94 and that also mean related code is located farther = away from other related code. This can be worked around but the = workarounds I've seen are all fragile and unable to be generic, and few = 3rd party packages do this. > I've seen a sizeable chunk of developers that come from other = languages discover PHP's autoloading and their minds just get blown. It is unclear to me if by saying their "minds just get blown" if that = means you think they see it as a positive or negative? As a developer who spent a decade in PHP and then branched out and added = Go to my repertoire I can tell you one of the nicest differences I = experienced was not having to deal with an autoloader during debugging, = and not being so constrained was to have to create a new file for every = symbol. Go projects need an order of magnitude fewer files. It is just = so much easier to grok the source code of a Go project compared to a PHP = because of this one simple fact. Now when I program in PHP I find myself = constantly cursing the fact that I have to deal with the autoloader. BTW, I know Go is a pre-compiled language unlike PHP, but that does not = necessarily preclude PHP from having a better solution for code loading = and organization. > 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. This reads to me like Stockholm syndrome, e.g. "My captors still hold me = captive, but they no longer beat me every day." > 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 and is still somewhat ongoing. Totally agree on that. -Mike=