On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote:
> PHP User Modules are php files that are brought into the runtime through a 
> new parser that is able to generate faster and more concise runtime code by 
> removing support for problematic features and imposing a strict mode by 
> default. They focus on PHP as a language and not as a template engine.

I think the problem I have with this proposal is calling these "PHP User 
Modules". Here's an admittedly uncharitable rephrase of this:

"NewLanguage User Modules are NewLanguage files that are brought into the PHP 
runtime through a new parser that may theoretically be able to generate faster 
and more concise runtime code by implementing a different language based on 
much of the syntax from PHP. This new language does not prioritize its use as a 
template language for HTML."

> The only background compatibility break is the introduction of three 
> keywords: "import", "export" and "from"

"We will add three new keywords to PHP to support accessing variables, classes, 
and functions implemented in NewLanguage."

> If you got this far, thank you. This overall idea to take one of the better 
> things to happen to JavaScript in the last decade and incorporate it into PHP 
> has been bothering me for awhile so I figured I'd share.  I don't know how 
> much merit there is to this though.

I think there is a lot of ground to be covered in improving PHP's concept of 
packages or modules that has largely been punted to user-space with autoloading 
and Composer and it's always good to address the seams that has left, but I 
feel like this proposal, as sketched out so far, reminds me more of what became 
Raku (from the Perl world) or perhaps Hack than an actual way forward for PHP 
itself.

Thanks.

Jim

Reply via email to