Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124142 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 7F5D21A009C for ; Mon, 1 Jul 2024 13:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719841163; bh=RPhk3pOJ9pJt5W4R7nlJWym6cl+feEem/4pblaJ2Lj0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OxWb+9k5A+kkQbzGgsYGk/+Txtjp7/KB47YimLr/DhuwAc4hZlBs7lBTMCU4w54Pj +KXpDW4uGNu84VWD1nkSfDVOxs7KXSWlV7y+iX/Ky++rOrHssQp7H04D5GEnfW6mTl Wdt7BxIRbUqu0HgLROHk3VHzIOYypyHteYGyzcFjAEncspxtvhBOtpOBLdeZy8DYW8 MsCG5nsw9GYkUrR4+mVR/NR0DHB5rYJ1Of78zZiebNFAHy3q05Ia0L6efB3Gtcqkox 2kR7JYZdeTKTt3m/SoBR7cDMghZurHUorN2azQmhda9cpaU7z7ogq1QqZFVTbaEu0Z oNImfY+dEsNdw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3DCD180732 for ; Mon, 1 Jul 2024 13:39:22 +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-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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 13:39:22 +0000 (UTC) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-64b29539d86so26259567b3.2 for ; Mon, 01 Jul 2024 06:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interi-co.20230601.gappssmtp.com; s=20230601; t=1719841081; x=1720445881; 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=RPhk3pOJ9pJt5W4R7nlJWym6cl+feEem/4pblaJ2Lj0=; b=2nyqoNWxwk79kjndRPfvTqRsIxwKnooyFHig3+DoOQi/rQRPDVNDFi4tTieqcmYfXz ZGTrq4YPzf28TDdD1XJI5rPL+8CU+J5SL2w5y9hrjH+Iuk22Z0pewZcLzvfHs+1E6lKA V8HMqjM03Ypu+QKffoXD8VA+eXnkHupZ5j2VfELAaRbXvRcUBQIFGIWzz4Kr88Seg3mh mFrZKyb6wApZ1PC7jLiSg4fJtodnFcb8j+ES9K9Zs6iRENL3XJhfD2ONamNSApe8d3ZF kAlXX5nlRzwBZIs6bULEvfgh57iNeKWK64jT5b6Gsluy9MUt5fm71lUlEklHi4E436Tn iLDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719841081; x=1720445881; 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=RPhk3pOJ9pJt5W4R7nlJWym6cl+feEem/4pblaJ2Lj0=; b=AqSAS0glXsaXgw5AHcU2n/lDDnFHr8Pn7INhcGXuQFuHfmWLJjjnf3JGAXie0xpndz MfINKJP9WML0uBREMUgxRENdJiRsRxHM3hRtTgfmlzxlQwZNZoJIODHObYs902D7ypjI f9MttZlL/jpty8CuXJxhRXRCuUCnMXlj4ATCtLZb5AtcjECCsPW32dHC5XjdH7B4GgVv GASVgHel5+DGIyI060cTcrEfVs4ivp+cgQpeMzJp2yf6KZraZRvvASFTSClfiIc0VjzV 00Sk8fa7I3ryddqhv3g0JPh8iEpbxniZP1Uv0PYVZBh7LPaX0kjKIKauqraQUfcVaeOs tdvg== X-Gm-Message-State: AOJu0Yzmr4E4rX0KiHRmAsylkzE5AVQhqsg0I9NGKHNbggfPXC9ais3R 7mVGsVc5OiRgyZXLQ1sOO+iqrxQxD2TWge9qAE4z7bPceyHOEnhIXh/PpoK9f7hcQg+JEMNKRD+ zCzxLqusFZKOt+jC6pcTupRj3y1aF4lPUiZgTUpoFBzTxkYop X-Google-Smtp-Source: AGHT+IGi+FWgXoqkinUyPb7uiR2V9nSeF+L09CDAQB59cRDYoBZ2NRDAF0P7sNXOyZIOx4tlopzmrsUOWkhMIsy7y8E= X-Received: by 2002:a81:bf54:0:b0:615:bb7:d59c with SMTP id 00721157ae682-64c718f8409mr54410757b3.22.1719841081025; Mon, 01 Jul 2024 06:38:01 -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> <217db044-e356-4e18-ba68-c18dce6381a5@app.fastmail.com> In-Reply-To: <217db044-e356-4e18-ba68-c18dce6381a5@app.fastmail.com> Date: Mon, 1 Jul 2024 22:37:49 +0900 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: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" From: alex.pravdin@interi.co (Alexander Pravdin) Sorry for getting into this hot topic. Just wanted to add my two cents. > Really, the only targets we should be looking at, IMO, are: > > 1. Package-level visibility. > 2. Giving the compiler/optimizer/JIT a larger "scope" of code to compile/optimize at once, so it can do smarter things. > > I think everything else is a distraction. As a userland developer, I like one of the author's intentions - to allow writing modern PHP code without poor legacy, without opening tags, which will also enable the compiler to apply more magick and more optimizations. I could see it as a new file extension, for example, "phpx" and release it in PHP10. This will not drop BC and at the same time, users will have the opportunity to explicitly tell the compiler that they want to use the new format. The inclusion of old-style files will still be allowed. In the far future, we may feature-freeze old-style files and gradually migrate to the new ones. I personally support the movement from the current "plain-text template-first" language to a "coding-first" language, where files contain code by default. We already support multiline raw strings in PHP code so the usage in templates should not suffer. Or it can even be simplified by introducing a better way to craft templates in the new "coding-first" format of PHP files. I also support the idea of having packages with private members, autoloading constants and functions without using classes. -- Alexander.