Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124185 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 3A6D51A009C for ; Wed, 3 Jul 2024 05:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719984824; bh=6lTWSvrUVowEv+Ayb5lbaUEUYzPDDfcmVHkI1gxJlUM=; h=From:Subject:Date:References:To:In-Reply-To:From; b=j3J+WDsEvtZkZjBhPBfp3DAZZ5rq57Stc5Nn4MfqlKoHTBzWs4Az5NYMnDkT8O9f3 pngR1aDcx75Y/XB3XjXtys4+94/lNA2BCVbhWqMojFfg+A9eTN7wesqX//EWZJMAD5 FlQnleace+wlXtcTiu5t+5y2b133STg/zrCgYHVrjd2wPEqGr3RpXEv5W1CsWa76u0 c+j3dmLpgC0td7MWDZiI1TqXs+CA2DpLnNNgLkNrusjwQSIY35wiq/ZW9ElVCDKn83 52RsBwnBKi+KuBpR/ccLqQm59TZTB1h981/VgyLUEN5zbTHQbSZ4H1uq0Nv+piqTvl VPYE092s1GeDA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7FBBD18005C for ; Wed, 3 Jul 2024 05:33:43 +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_MISSING, 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-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 ; Wed, 3 Jul 2024 05:33:43 +0000 (UTC) Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-376012bcc33so20476735ab.2 for ; Tue, 02 Jul 2024 22:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miles.systems; s=google; t=1719984740; x=1720589540; darn=lists.php.net; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=6lTWSvrUVowEv+Ayb5lbaUEUYzPDDfcmVHkI1gxJlUM=; b=UpBe5kwfGwgqyI5Yi7VZ2tVzRqqe/O6KbJYOdzHdhTCjSrIP4cmzinuAjQPe6otIGu gNtk0kFzbD+PYmVK1Tl1pEB/uv4IRnFReHyUGHMEKXmZvbWcc7HnM09UsqbIqG/51F4t yAJHnEsPzq7wqlCPr6dk1zMCRR8FjlTJPprNO7JGMiwc/kXT6AsFKfc22Io6HbwCr53B 54yeXGL980qY3JbwPGzhcpRXzSne5C0hy6IvV1AC7l6Mkx+bePFvn1X+N5SeEd6q6o6I OY9zGkoyeknw7KZi0DsrIDQn3EqMZslUMk2tGiIu8PZDwfZ8LDQ6L4o4bUEHBa3ohHwg 7f/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719984740; x=1720589540; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6lTWSvrUVowEv+Ayb5lbaUEUYzPDDfcmVHkI1gxJlUM=; b=m4iSxziazX4YNSLACwj7IPKmSTsBLaK0QnZd268OTjfNoCKEi4KBTJWsvteU6r0nvO 0H+kkNsDIUBdcOTtAq8xiFEdGT2P7BxoI+DmKxeg1UCqMwOQG0A6vu0CaKdAQKqbYMhr 8WJQWJGxTu0nlHdMo2s0KS+jLDaMKj0wBtpybbuF7NO9Of5x8uBTNc5Ai1Xmn2lyAZNz zVlMIrm2PWcZ2E1z8G/Gj2YE4arWeQlO4rO+DC4UlWyjeoi0hig92gxfIQPtE4EsFeEg juXHACOlsOfImpaMYEbYWb55R1DyR90fGJVAXSrdCvwtw8S+pJHVIadZt1yLKFxAKHgH Mn5A== X-Gm-Message-State: AOJu0YwuyySskKsqdEb6rA/ZUn2Nyio6rYhcQjO07dPt/FFCdi69/xN6 PreT/J6TuT+4e8nZ9iS4tN4GyPZAz+Tg7daGbCLIeHXuXGax+gDfGiOPDzytBTT8nIjuptYs0fl eoaVH5EXztzeMVksVa/2wTYgNKBRuhuf4+3J/W+YXDewWkkeXQmvTys/2Kyxli0jm1WWRqvyMzN yusGDuQWSjV1LSyLy/ex+hyqLaeIZA4Il2b/KgO/+t X-Google-Smtp-Source: AGHT+IF8TDu4esFLP35Ntf71B5+9QwoOU4blciisr3yw+BCkHbFFQ0DeuFsV2UjePZL7s202paObag== X-Received: by 2002:a05:6e02:2190:b0:376:24b1:174c with SMTP id e9e14a558f8ab-37cd0bf5879mr115034455ab.3.1719984739770; Tue, 02 Jul 2024 22:32:19 -0700 (PDT) Received: from smtpclient.apple ([2601:283:4600:6770:e964:38aa:2975:2415]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-37ad483bffdsm26725685ab.86.2024.07.02.22.32.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2024 22:32:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) Date: Tue, 2 Jul 2024 23:32:08 -0600 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> <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> <4D45294E-78BA-466A-B2B4-F17BA4E1ED73@woofle.net> To: php internals In-Reply-To: <4D45294E-78BA-466A-B2B4-F17BA4E1ED73@woofle.net> Message-ID: <6C3C9DCE-0DC8-4470-AE2B-28E550E08774@miles.systems> X-Mailer: Apple Mail (2.3774.600.62) From: richard@miles.systems (Richard Miles) Howdy people, > On Jul 1, 2024, at 11:07=E2=80=AFAM, Dusk wrote: >=20 > On Jul 1, 2024, at 09:22, Mike Schinkel wrote: >> 2. Autoloading effectively necessitates that every symbol be in its = own separate file. >=20 > How so? While Composer "recommends" PSR4 autoloading with one class = per file, other configurations are entirely possible, either with = Composer's autoload.classmap (which uses a precomputed class -> filename = table), or with a custom autoloader. If I'm understanding the main issue, we need package-level scope.=20 Rather than build a whole new thing, what if we solve this problem?=20 Thought: What if php implicitly prepended namespaces with the composer package = version? If two incompatible versions are required, the composer downloads both. = Enabled/Disabled with flag? Maybe: org/package/version/ This implicit version would show in debug backtraces. So importing = Example\Example; might look like this in the trace: 1.0.8\Example\Example Packages imports by namespace could automatically resolve to the version = defined in that file's local package JSON. Reflection to know where the code is running is easy enough, but this = would require interpreter-level changes. It=E2=80=99s a little late, but off the top of my head, it seems fairly = backward-compatible.=20 However, if someone relies on parsing a stack trace=E2=80=A6 hmmm (trace = flag too?) Contextual sidenote: Mac doesn=E2=80=99t ship with brew. Windows doesn=E2=80=99t ship with = Chocloaty. Python ships with pip, and Node ships with npm.=20 Python didn=E2=80=99t start shipping with pip until version >=3D 3.4.=20 I would be happy to see PHP shipping with the composer as a = default-enabled flag. Best, Richard Miles=