Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125656 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 989A61A00BD for ; Mon, 23 Sep 2024 17:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1727114447; bh=xu63TinREiPJiyvceEUbfh4Y3ov7TSSHZa2D0hN+wNI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LpMsZqCYr7i8qQ5yE8T3GLKW2AqZUEzq+lqdAVH6fYZB/H35C721ETyTQPEkC//iX NcmAGYUxzMqPRYoMkvSQYCGT6E4diJcfhbW1mul6hk9C+8naJ6wV+bAaGJu40il71Q PaL2Mdu3VwmctD7u+7Ky+VA0rW31Um3UkP4dTTImmQ/nBbOHvEY9cpTeqxjtN5jir3 Mbld+w3TaOTLagTKvVRk9o+8S1yY2P9gylyOhKfq6EfKnK2ZlVScgS5XCmYVYYsPJq vvOSbLD7urCKnvUwvxaSFXhSS3Z9ZphAJbF+rWuyDfS0pw+dtNCju4OxTO81KxzBM6 vpXABoQQfYDpQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 178BD18006D for ; Mon, 23 Sep 2024 18:00:47 +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,HTML_MESSAGE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mx1.dfw.automattic.com (mx1.dfw.automattic.com [192.0.84.151]) (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, 23 Sep 2024 18:00:46 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx1.dfw.automattic.com (Postfix) with ESMTP id AFD39341175 for ; Mon, 23 Sep 2024 17:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; h=content-type:content-type:x-mailer:mime-version:references :in-reply-to:message-id:subject:subject:from:from:date:date :received:received:received:received:received:received; s= automattic1; t=1727114317; bh=xu63TinREiPJiyvceEUbfh4Y3ov7TSSHZa 2D0hN+wNI=; b=H0ZqpbeH+Fv0egHE3kLM98TBaKxCu4ZMGMDvR7zUqAgin2X9R2 DazU1Gldk1lqN+IfNQvVm3FtEkrqpOUXMVuFpitUL/KAgK3or6+5Zyzu/eSsicQu cUKujGyGuafjWxxqdixrfXJjo++zZnfUwzxlaFlHFcPCYfpsrRHXa0mHAG7HsuT6 FtOunY3bA45j4h1qIkhspXR2s9psR6E00bHl99Ls7KB1FRO3qNXulhIlxi1pOGMi /BIxOAbp8UyRGD1FoxxElPrn9s4fuZQXo1XMwLkKUu1t5aRZk9w2snEphsQ6cY93 +L0mYQ0ZQcAwkjuEfx+B1WJxv+jvNCH3zu/w== X-Virus-Scanned: Debian amavisd-new at wordpress.com Received: from mx1.dfw.automattic.com ([127.0.0.1]) by localhost (mx1.dfw.automattic.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fruox9I6qyNZ for ; Mon, 23 Sep 2024 17:58:37 +0000 (UTC) Received: from smtp-gw.dca.automattic.com (smtp-gw.dca.automattic.com [192.0.97.210]) (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 mx1.dfw.automattic.com (Postfix) with ESMTPS id 0D38E341153 for ; Mon, 23 Sep 2024 17:58:37 +0000 (UTC) Authentication-Results: mail.automattic.com; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="mOPcFori"; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="CgFF0FNL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=automattic.com header.i=@automattic.com header.b="XAYp8XVo"; dkim-atps=neutral Received: from smtp-gw.dca.automattic.com (localhost.localdomain [127.0.0.1]) (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 smtp-gw.dca.automattic.com (Postfix) with ESMTPS id A5177A09B4 for ; Mon, 23 Sep 2024 17:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1727114316; bh=xu63TinREiPJiyvceEUbfh4Y3ov7TSSHZa2D0hN+wNI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mOPcForitgiKRjz2aXYx7LuLmPFUw/ROMOIBJRxQC4EvEdKYMZK/COd1h2NwE0CLy YAS11buCBAZT9wh78up2Ys8k7RFio9ZXmPoe/V3iW2PSKnzaCXNrFnZLPOYczrKxen X+X1uwKVT3wavmM9b3Fdi9L5H24/oScRvYlZEU1b8BxAltlmxdsN9/BNCqsJMRnZvP 1BxwvnDmBLWCz8EsPVcur/rk8zysQjiKmxVkh6hnFdQjvlB/phbqEzdJm4FptygRJQ k7o0D7u6EDt0Km1qbtFHMeYEASMliAO1svRnHYqtkHqg1q7g5YQpLhQKrWrCDhc6Nv Luv9afemPECZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic1; t=1727114316; bh=xu63TinREiPJiyvceEUbfh4Y3ov7TSSHZa2D0hN+wNI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CgFF0FNL28MDzd1czwdOC2NfkcfKbiplMtsjHlULlJG1z9PNVzhMgG9URh4dBmjB6 zK9QOh+zo4z0gUpK6Xm4EL4jGu1/iWSD8VPIeW38as6hsEIHAeD2/5bgmTt7AjOzjc ScQjiiPEzT0ZcaFw37eJZJ0QWl7JGS1MuPhDIHEit1nX1eKG0ftx3gVDqElNp6EA5n 0ZpP8GesMrDotjRsbV7aPAZbk5eAzeyyYPuhV67BA7zsNlGFx1tfTYTiuaiKX0u5v6 cLRdCH9N0fgTsWLv9GLJ2LwP15Hw0c30mvRB/LP9QsXhFtDPOl0EcCeQ53kVat/g8R aA7OIkmnCERoQ== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-gw.dca.automattic.com (Postfix) with ESMTPS id 7B6B5A0211 for ; Mon, 23 Sep 2024 17:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1727114316; bh=xu63TinREiPJiyvceEUbfh4Y3ov7TSSHZa2D0hN+wNI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XAYp8XVoWZu0YR3NPHlEKb1CMxMHnyEeSs4QR33efv76hkOVGAPo4EfO33xSs0yqW rCxBwaNccvu/Bn+5KqfT6mmZAwoBWELUU+MquuLiyYFNYNdyjPOi6FWDJrlBE0vbWE ojsbH7EwMahEgeOvK4MWZ1V/jE7jtkzB1KWbX655PvAnaPBPMmGrq1qxp0+XVbWs37 JcMO2G1RID2TOG1ISbEGOXIHGLOoG//yQ2ZlLVsPueMggNmNbpDLMxYNax7PjizKMh 075RiRjog4re5wN44hk4c2a5IUIRICdXEFFznGHAyS46Gxuge4ZOns4fN9EwM5CyHE G+3RhD5atUW+A== Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-7197cce7697so7181542b3a.1 for ; Mon, 23 Sep 2024 10:58:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727114315; x=1727719115; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1vu5WjG358JtahvTFM3VgWd6dkuH9FVyW2l0gR4eLlw=; b=bEIPOOQCCzqERxd79FQhUL/DbYMz3pyl32xwl8x4mbaV/yfhS1K7mXjPIR9RSyN823 l/wsf34d/hEOIwlhoVeOgwBDK8Q1/KIGBaNuEJ7cxm7djq8ToMHohhdcY/Iq+MkluMCy j6PEVv5a4OAs6Hvy6zCcRjR19QODVxf+BO4ESysFZmfHdJi1SU5SKfHzARgHxbizPOYI OX+gwLkXttn3PkAbj2gNdy4kAiYwOOPwoVgM3EsR8wit1EkuPGGkEcNN594yJHFQ9oep 0sXmdy86cbHSj0k32PDht6CK+FsPz0aWpxpwyV5T9FGQw7tgCxg7A1LOOYuCsCsRnsA3 lYbQ== X-Forwarded-Encrypted: i=1; AJvYcCXZKQjAe3tBW6R1smedJowb+Xq9cwbUwq1aKXWtS1x8OISgWTmgYU9Lineu/kD/GqBUS4jzTK9zBxI=@lists.php.net X-Gm-Message-State: AOJu0YwWTLOPp+Bmu8Ukiw0lBHWCwx+4t7v4flM1vmyL57VvTmHQOxH9 FqnQJnOO/RvSPXOSYBdZZ19XCCXn5Hskp1Om/OYpYbHmBqRaNbd86Q5tmUr9l3THZHT70DUfWVs GjkoAQtfHjnyjoLjsms/FVfYVs7USYqUQgVy//B9WrjcGqnMPVBExe/s= X-Received: by 2002:a05:6a00:2ea8:b0:714:2069:d90e with SMTP id d2e1a72fcca58-7199ce40a7amr18478833b3a.26.1727114315559; Mon, 23 Sep 2024 10:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr+laSj2std9H40FLLMKMoIzGKNJuYFeUWa6GhrD7je5HehKMI8BCFIS3unIdKF6Exifzp/g== X-Received: by 2002:a05:6a00:2ea8:b0:714:2069:d90e with SMTP id d2e1a72fcca58-7199ce40a7amr18478797b3a.26.1727114314832; Mon, 23 Sep 2024 10:58:34 -0700 (PDT) Received: from [10.0.0.12] (ip68-231-80-211.ph.ph.cox.net. [68.231.80.211]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc4752sm14102139b3a.203.2024.09.23.10.58.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Sep 2024 10:58:34 -0700 (PDT) Date: Mon, 23 Sep 2024 10:58:34 -0700 (PDT) X-Google-Original-Date: 23 Sep 2024 10:58:32 -0700 X-Google-Original-From: Dennis Snell To: Mike Schinkel Cc: Arvids Godjuks , Niels Dossche , Larry Garfield , =?UTF-8?Q?Rowan_Tommins_=5BIMSoP=5D?= , Hammed Ajao , Rob Landers , Adam Zielinski , PHP internals Subject: Re: [PHP-DEV] Zephir, and other tangents Message-ID: In-Reply-To: <042AF6B3-ACAD-498E-99FA-CD7EDE8778FC@newclarity.net> References: <8D420123-4ECF-48FD-A9C3-F80C60457A37@newclarity.net> <7EA884D2-0F37-4BF1-AC97-DB6953C944E6@automattic.com> <042AF6B3-ACAD-498E-99FA-CD7EDE8778FC@newclarity.net> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-Mailer: Unibox (443:23.6.0) Content-Type: multipart/alternative; boundary="=_066572BE-451A-470D-B867-D4C34B1ECFE5" From: dennis.snell@automattic.com (Dennis Snell) --=_066572BE-451A-470D-B867-D4C34B1ECFE5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks for your thoughtful response, Mike. I hope everyone had a nice weeke= nd. > However, my guess is that Automattic (spelled correctly) is not likely to= do that given how dismissive PHP Internals and by extension the PHP Founda= tion has been regarding the needs of WordPress users for as long as you Arv= ids have been doing PHP. =C2=A0 >=20 >=20 > But who knows, maybe there could be a d=C3=A9tente? =C2=A0Who on this lis= t would be more open than in the past to treat concerns of WordPress users = as legitimate rather than dismiss them because (I am paraphrasing) "how bad= their code is?" >=20 >=20 At Automattic we=E2=80=99re used to working in the open. With WordPress its= elf (apart from Automattic) even more so. Dismissal is my bread and butter = =F0=9F=98=84 But we=E2=80=99re still working hard to make the web a better = place and I=E2=80=99m happy to partner with anyone, even if we share disagr= eement. > Or the ones who want to target the users of the CMS or Framework that rec= ommend or require the extension. >=20 >=20 > If the extension were bundled then I expect it could become a recommended= extension for hosts to enable and WordPress could start shipping WASM exte= nsions for the use-cases Dennis Snell mentioned that can optionally run if = the WASM extension is enabled vs. if not it would just run the old slower P= HP code. >=20 >=20 > BTW, Dennis, could you see WordPress recommending a WASM extension if PHP= bundled one here?=C2=A0https://make.wordpress.org/hosting/handbook/server-= environment/#php-extensions >=20 >=20 >=20 >=20 Absolutely, though realistically we=E2=80=99re still talking about _years_ = before it could be required. We=E2=80=99re not going to alienate a broad sw= atch of the internet just to get a new feature. But WordPress has become mo= re assertive in pushing updates, both on users and on hosts. There is a com= ponent of the decision that depends on how many sites are still using old v= ersions and there is a component that looks at things like security issues,= whether a version is supported, and whether hosts offer the newer versions. WordPress today requires PHP 7.2.24, though that=E2=80=99s hidden in a para= graph of text after stating that the recommended minimum is 7.4. I believe = that the update cycle has been contracting over time and the ecosystem is d= oing a much better job today at keeping updated than it was a decade ago. My guess is that we could see rapid adoption of some WASM extensions and ad= d it to the recommended list. This is _my_ opinion though, and other mainta= iners may disagree. >=20 >> How would we handle the JS-like stdlib of assembly script? Another abstr= action layer? That seems easier to you than a DSL created specifically for = this?=C2=A0 >>=20 >>=20 >>=20 >=20 >=20 >=20 >=20 >=20 At this point I am realizing I might have completely misunderstood the orig= inal tangent into WASM. For one, I also find the idea of a DSL surprising f= or the needs being discussed. I=E2=80=99d like to understand better what th= is means, or what kind of extension would benefit from such a DSL, and what= stage of the build this is being discussed (for example, a DSL for more ea= sily writing PHP extensions in C, or a DSL like eBPF which PHP code can bui= ld as a string and submit for processing internally). >=20 >=20 >> With PHP like syntax?=C2=A0 >>=20 >>=20 >>=20 >=20 > Why is "PHP like syntax" a blocking requirement? =C2=A0C does not have a = PHP-like syntax, or at least one that is not more similar to AssemblyScript= than PHP. =C2=A0Why then is C acceptable for extensions but AssemblyScript= is not? >=20 >=20 > And even so, there is no reason a PHP-like syntax is required. PHP develo= pers work with JS or TS every day, and AssemblyScript is just a variant of = TypeScript. >=20 >=20 >=20 >=20 >=20 >=20 What does it mean to build a WASM runtime _for AssemblyScript_? When I thin= k about it, I consider a real black-box implementation with basic means of = transferring primitive data types across the barrier. In JS we have numbers= and shared memory buffers. This leaves many things wanting, but also is = =E2=80=9Cenough=E2=80=9D and makes the security domain much smaller and eas= ier to ensure. I=E2=80=99m not sure how to visualize what people are discussing when they = talk about designing something for AssemblyScript. Would that exclude the a= bility to run C applications or Rust applications compiled to WebAssembly? > Once CMS & Frameworks are empowered to use WASM as part of their core off= ering then they could start recommending WASM and managed web hosts that wa= nt to cater to their users would start offering WASM enabled on their platf= orms. >=20 >=20 > BTW, very few CMS or Frameworks make any extensions not referenced in pro= duction.ini as requirements, and for very good reason because doing so woul= d be too risky.=C2=A0 >=20 >=20 >=20 >=20 >=20 We can flip the discussion, too. The idea of running code on a WASM runtime= from PHP isn=E2=80=99t just about stuffing new complexity into PHP. The da= y we _require_ a WASM runtime is the day we can drop almost every other PHP= extension from the required list. It=E2=80=99s great having `curl` and `ex= if` and `pcre` available, but the fact that they may not be makes every cal= l out to them a liability - every call needs to a fallback implementation i= n user-land PHP or else we=E2=80=99re going to have to deal with site crash= es. Even extensions like `mb_string` are incredibly useful, but only because we= don=E2=80=99t have access to tools that better fit the needs we have as a = CMS. There are some very surprising code snippets that exist (a) because `m= b_string` isn=E2=80=99t guaranteed to be there and (b) because the interfac= e is close enough to look right but different enough to be extremely awkwar= d. One quick example comes up from just two nights ago: detecting URLs. We wan= t to have a Unicode-aware `strspn()` function, so we have to use PCRE with = the Unicode flag set. Now we have dependencies on extensions and no practic= al fallback, also the code in JavaScript cannot be the same because they us= e different regular expression syntax and people have to manually and corre= ctly translate that. (Well, I have proposed some user-space PHP code to pro= vide a streaming UTF-8 decoder, but it=E2=80=99s much slower than the C cod= e inside PHP or the WASM binary would be). One new algorithm, compiled to W= ASM, could return the byte-offsets into a string where URLs are detected an= d then the PHP and JS could have a stable agreement and it wouldn=E2=80=99t= depend on any other extensions than WASM. Having spent years dealing with text encoding issues I=E2=80=99d cheerly re= place existing `mb_` code in WordPress with custom functionality as a WASM = module. And again, I want to highlight that this is a win for hosts. Nobody= needs to ask their host to install new extensions, no host has to evaluate= the security or reliability of an extension. Nobody has to come begging fo= r a rapid update to `openssl` because some vulnerability gave internet visi= tors root-level access on the host=E2=80=99s server. Nobody has to be disap= pointed because their host refuses to make `libvips` available to PHP code = for the one site on their service that wants it. Hosts can start _removing_= extensions that have long been headaches but are so necessary in practice = that they can=E2=80=99t get rid of them. =E2=80=94=E2=80=94 This was supposed to be a very brief response. Sorry, and thanks for your p= atience reading through to the end. I=E2=80=99m responding because I feel l= ike the conversation is relevant and good, but my tone is meant to be frien= dly with a realizing that none of this stuff is likely happening rapidly, a= nd nobody is demanding this work. I want PHP to grow and mature, as I hope = all here do, and I=E2=80=99m sharing where I can see WASM being the missing= piece that we=E2=80=99ve wanted or needed for a long time to relieve press= ure from the core language and escape from many of the legacy warts that ma= ke building reliable performant software in PHP so difficult. Warmly, Dennis Snell --=_066572BE-451A-470D-B867-D4C34B1ECFE5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Thanks for your thoughtful response, Mike. I hope everyone had a nice = weekend.

However, my guess is that Automattic (spelled correctly) is not likely= to do that given how dismissive PHP Internals and by extension the PHP Fou= ndation has been regarding the needs of WordPress users for as long as you = Arvids have been doing PHP. =C2=A0

But who knows, maybe there could be a d=C3=A9tente? =C2=A0Who on this = list would be more open than in the past to treat concerns of WordPress use= rs as legitimate rather than dismiss them because (I am paraphrasing) "how = bad their code is?"

At Automattic we=E2=80=99re used to working in the open. With WordPres= s itself (apart from Automattic) even more so. Dismissal is my bread and bu= tter =F0=9F=98=84 But we=E2=80=99re still working hard to make the web a be= tter place and I=E2=80=99m happy to partner with anyone, even if we share d= isagreement.

Or the ones who want to target the users of the CMS or Framework that recom= mend or require the extension.

If the extension were bundled then I expect it could become a recommen= ded extension for hosts to enable and WordPress could start shipping WASM e= xtensions for the use-cases Dennis Snell mentioned that can optionally run = if the WASM extension is enabled vs. if not it would just run the old slowe= r PHP code.

BTW, Dennis, could you see WordPress recommending a WASM extension if = PHP bundled one here?=C2=A0https://make.wordpres= s.org/hosting/handbook/server-environment/#php-extensions

Absolutely, though realistically we=E2=80=99re still talking about _ye= ars_ before it could be required. We=E2=80=99re not going to alienate a bro= ad swatch of the internet just to get a new feature. But WordPress has beco= me more assertive in pushing updates, both on users and on hosts. There is = a component of the decision that depends on how many sites are still using = old versions and there is a component that looks at things like security is= sues, whether a version is supported, and whether hosts offer the newer ver= sions.

WordPress today requires PHP 7.2.24, though that=E2=80=99s hidden in a= paragraph of text after stating that the recommended minimum is 7.4. I bel= ieve that the update cycle has been contracting over time and the ecosystem= is doing a much better job today at keeping updated than it was a decade a= go.

My guess is that we could see rapid adoption of some WASM extensions a= nd add it to the recommended list. This is _my_ opinion though, and other m= aintainers may disagree.


How would we handle the JS= -like stdlib of assembly script? Another abstraction layer? That seems easi= er to you than a DSL created specifically for this?=C2=A0
=

At this point I am realizing I might have completely misunderstood the= original tangent into WASM. For one, I also find the idea of a DSL surpris= ing for the needs being discussed. I=E2=80=99d like to understand better wh= at this means, or what kind of extension would benefit from such a DSL, and= what stage of the build this is being discussed (for example, a DSL for mo= re easily writing PHP extensions in C, or a DSL like eBPF which PHP code ca= n build as a string and submit for processing internally).


With PHP like syntax?=C2=A0

Why is "PHP like syntax" a blocking requirement? =C2=A0C does not have= a PHP-like syntax, or at least one that is not more similar to AssemblyScr= ipt than PHP. =C2=A0Why then is C acceptable for extensions but AssemblyScr= ipt is not?

And even so, there is no reason a PHP-like syntax is required. PHP dev= elopers work with JS or TS every day, and AssemblyScript is just a variant = of TypeScript.

What does it mean to build a WASM runtime _for AssemblyScript_? When I= think about it, I consider a real black-box implementation with basic mean= s of transferring primitive data types across the barrier. In JS we have nu= mbers and shared memory buffers. This leaves many things wanting, but also = is =E2=80=9Cenough=E2=80=9D and makes the security domain much smaller and = easier to ensure.

I=E2=80=99m not sure how to visualize what people are discussing when = they talk about designing something for AssemblyScript. Would that exclude = the ability to run C applications or Rust applications compiled to WebAssem= bly?

Once CMS & Frameworks are empowered to use WASM as part of their c= ore offering then they could start recommending WASM and managed web hosts = that want to cater to their users would start offering WASM enabled on thei= r platforms.

BTW, very few CMS or Frameworks make any extensions not referenced in = production.ini as requirements, and for very good reason because doing so w= ould be too risky.=C2=A0

We can flip the discussion, too. The idea of running code on a WASM ru= ntime from PHP isn=E2=80=99t just about stuffing new complexity into PHP. T= he day we _require_ a WASM runtime is the day we can drop almost every othe= r PHP extension from the required list. It=E2=80=99s great having `curl` an= d `exif` and `pcre` available, but the fact that they may not be makes ever= y call out to them a liability - every call needs to a fallback implementat= ion in user-land PHP or else we=E2=80=99re going to have to deal with site = crashes.

Even extensions like `mb_string` are incredibly useful, but only becau= se we don=E2=80=99t have access to tools that better fit the needs we have = as a CMS. There are some very surprising code snippets that exist (a) becau= se `mb_string` isn=E2=80=99t guaranteed to be there and (b) because the int= erface is close enough to look right but different enough to be extremely a= wkward.

One quick example comes up from just two nights ago: detecting URLs. W= e want to have a Unicode-aware `strspn()` function, so we have to use PCRE = with the Unicode flag set. Now we have dependencies on extensions and no pr= actical fallback, also the code in JavaScript cannot be the same because th= ey use different regular expression syntax and people have to manually and = correctly translate that. (Well, I have proposed some user-space PHP code t= o provide a streaming UTF-8 decoder, but it=E2=80=99s much slower than the = C code inside PHP or the WASM binary would be). One new algorithm, compiled= to WASM, could return the byte-offsets into a string where URLs are detect= ed and then the PHP and JS could have a stable agreement and it wouldn= =E2=80=99t depend on any other extensions than WASM.

Having spent years dealing with text encoding issues I=E2=80=99d cheer= ly replace existing `mb_` code in WordPress with custom functionality as a = WASM module. And again, I want to highlight that this is a win for hosts. N= obody needs to ask their host to install new extensions, no host has to eva= luate the security or reliability of an extension. Nobody has to come beggi= ng for a rapid update to `openssl` because some vulnerability gave internet= visitors root-level access on the host=E2=80=99s server. Nobody has to be = disappointed because their host refuses to make `libvips` available to PHP = code for the one site on their service that wants it. Hosts can start _remo= ving_ extensions that have long been headaches but are so necessary in prac= tice that they can=E2=80=99t get rid of them.

=E2=80=94=E2=80=94

This was supposed to be a very brief response. Sorry, and thanks for y= our patience reading through to the end. I=E2=80=99m responding because I f= eel like the conversation is relevant and good, but my tone is meant to be = friendly with a realizing that none of this stuff is likely happening rapid= ly, and nobody is demanding this work. I want PHP to grow and mature, as I = hope all here do, and I=E2=80=99m sharing where I can see WASM being the mi= ssing piece that we=E2=80=99ve wanted or needed for a long time to relieve = pressure from the core language and escape from many of the legacy warts th= at make building reliable performant software in PHP so difficult.

Warmly,
Dennis Snell
--=_066572BE-451A-470D-B867-D4C34B1ECFE5--