Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125648 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 E81741A00BD for ; Fri, 20 Sep 2024 20:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1726864710; bh=HO1TIp8pYPm3gmpHEAHc0/GtQwxrDUcX0Ujv6q4Ti4c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a8ujyIHl8D86/lCpHPPrGGQobrdFFsbgOYRlwOoTX/hanyYijmvu94DYZkFRWh+rY rkELFh3jWB/OnorslmM8hZa4tCLCXUxYZ8JP/5TsEciWzDz85TSMMHzH9sbgk5Pvhc r+YMmMTb6rDK5E2Lqu6CYjM+qZWnqYljyCt91pA4cuEcyrbXv3OV/0UX5BVhglzna6 es4fMMc7L2yf2Kbn44Ql4cTe/aD7jMspdoH39sNzBD+BxILWKvRUNnjkqe5smuWhfG vV6GoTpLu1KNwxyMOaYKMSpFrKP7JPorkV9mjsPPoE9TZD+JNyizwPthwkUNO/2hXU opsHUeDHicVGg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 706B8180042 for ; Fri, 20 Sep 2024 20:38:29 +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 ; Fri, 20 Sep 2024 20:38:28 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx1.dfw.automattic.com (Postfix) with ESMTP id A4DE2341045 for ; Fri, 20 Sep 2024 20:36:21 +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=1726864581; bh=HO1TIp8pYPm3gmpHEAHc0/GtQwxrDUcX0U jv6q4Ti4c=; b=ePxTNZf79ZYpcUAOY7osUrAO7w75Zb7jflQuXOZaYgLluRuziU t/BMgLzTLO5ZALJ8wCqEMpu7E0IAva18ZmhIuZUGI0PH8HFCyuCWtotihYCH6elo ypcDgIRkga8Gx5XKyDvRpwWqJUmuLJvGOhgzq0Pg1fbZm/qLLJZ9PP8rM5q4GvuR 5jEI65cVRUt8Xz28w2/k4MN90Us86o1FyDOVtBRX3g+zoGdLFMhnXf+EU4rRw4MF 9iKJlCyNRVtcjeBcZzcYqEVIIMr/uEhozav2p2PWnKUc5vzftBlpANKjMMKjGEZj AfFJBwC3G9Ee4Te6Jwt9OZNlwwpLcA5eezaw== 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 I3RqUQX5M5sg for ; Fri, 20 Sep 2024 20:36:21 +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 39FD434100A for ; Fri, 20 Sep 2024 20:36:21 +0000 (UTC) Authentication-Results: mail.automattic.com; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="bG9YnkAx"; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="LU41o+Re"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=automattic.com header.i=@automattic.com header.b="cgqmjCEw"; 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 D1FEBA09BA for ; Fri, 20 Sep 2024 20:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1726864580; bh=HO1TIp8pYPm3gmpHEAHc0/GtQwxrDUcX0Ujv6q4Ti4c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bG9YnkAxkyGHqHGvyJoFWwYkKeAvgegJ12aDZIXg+gY2XWlxRuHRqc5SaMXbaiZwC CiR7nPVJxXypbiug//ziUzScn2WQgwYdPHftiYnIy5AYP2e/oxG+A2kDerSCOdya43 Lp+LyJR1uULjkeOr/h6xqc1rxEnwJVBYT8eiupHQgftnclnTfFVP64D9mi3In1F0ab uizrDuKPAPynfxR9JybZtTXSQy/1id5amL78NlzFszkmBivWz/uajD0i+L7AKyPW/k e4H14W4RT8sqn4UrV0tq8MLkp5MAHG9+nOGIHKO4AJTuA7/3eGbBrU/XIcWZQ8BkxR lidwJBH4YFNrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic1; t=1726864580; bh=HO1TIp8pYPm3gmpHEAHc0/GtQwxrDUcX0Ujv6q4Ti4c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LU41o+ReBbMWGeSau1jo3sMHQAxWZ/aWnwQ3PHJN8uVtIlADa5UBonJCthVaXl1Nj pRWJF4Z56EdyeMrYz4J8rLjrGpEfLGk20WoqXvfpsnrwwawS9UdY2GjQDBbg+kcRmz sx7QYB4BCeU2CghSDSrx3s9zWKFhsEYgkoyvAbmMODIzb0vjlAvbD0cAKGxr2xW31p PaxFpZw5AF277nWjyA0o9Et7fp9d8XcO8V+YrekadZCUmul0JPw0ubVXjCp2EI471+ uV01Q1wwKdzO+Uxf1t0Q0hF0bLbsf42vWWFj0HMLqLx64YGKpZ4wiqQa+5URQK458n 8PdLLEG3iRCqw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (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 AFC4BA0982 for ; Fri, 20 Sep 2024 20:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1726864580; bh=HO1TIp8pYPm3gmpHEAHc0/GtQwxrDUcX0Ujv6q4Ti4c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cgqmjCEwKPQzQnM+OPPoBnkCfa6AqQAHzfTj4shd1xw4Af+dJbkv9MHtlAAti6Qu+ 17RYQFTHM4FJU/TEcp6ND72jzhHhmu0Nm35SVkBXAOSZHLVKyNNQZEjWD1cXbnB1wg SaaMsowOLDVrqUPhgjiW9S+ijxL0wrrtD124MvU78uAX0JjfSDh7p4q77BO2gry9CN HH8gqbpno8HpxQiiCxTjfwnDKV7Cy0osAvSL2QwdX1+zUhEUtHgv93ePttMSS5+LzF +unQ8PM+AjsP8arCM0P1Hsn+M8sXE4xTHc+NQhdFXiCY7ODWu+M5GS8UKFXi4MY8xd B++4BH9dHFZPA== Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-205443cf91fso28690775ad.1 for ; Fri, 20 Sep 2024 13:36:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726864580; x=1727469380; 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=8/nu2JXKGDiCnI7KgtqqL+dLbmzsxXL8okFZtWw+L/c=; b=WgbS0KMRWb0kelcq3jPZNvCez1JF+8DQxXf0+IjqOEvzF6xiDDOQ9KVM3JSl76dc7s g9qXuiPLTaoIeeT3xRZEXU9plNAMMYZOJVaG5irCR7NKyBHJC/WC5vjLS2BkM7YsIKaW a4yzGs0g/f8LVVSD9XfuuTpV6LjliqViJx3jhCmyRLaEPxUgvE6w0YHUSEi6XumYbY5I DUixyD3DWkrc27oT3Z0l0CLkf9P4gTGeJmGoVfSlrBaFYfhVFyWlvrEKu/PhQpvidAdn LeKmlJDeQLlY+qPIlur7WonLRBCIFWcjnJwIeH2kNL2eVfHCN3mHmSiD77zNAbo1acmt cnqg== X-Forwarded-Encrypted: i=1; AJvYcCWP8kgbW46zVvabvD+IqqwbtwV4GdLqIqreeVE1HcPFNxHfTXwwge/Ze81eGeEbTo7+WLe8eClnVcY=@lists.php.net X-Gm-Message-State: AOJu0Yy4UXXydhqmSz1+kXC1X8LBNT9M2IrdX4GSY3Lweg8pYp9f0ZNp SheyN2ibwP2drKnatE1ahuHoAudcCIvoB/10tx8lrWy74d1fz0ssjl7UX4CuWb4y8MamJo6XwIE 99r2EeqCHvnMCZlXMb5yYctq4AOHZwQrukTvEb9rdEV+zb8Ol8dm6rl8= X-Received: by 2002:a17:903:18a:b0:205:8425:e9c6 with SMTP id d9443c01a7336-208d854e7bemr61214785ad.52.1726864579821; Fri, 20 Sep 2024 13:36:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoacqFOnAPykvUFvIvuqD1kmuekEA4cjxfk8RrtXSxHT+ZHKdLxZ9gjDfxwRF169RtcNPOJQ== X-Received: by 2002:a17:903:18a:b0:205:8425:e9c6 with SMTP id d9443c01a7336-208d854e7bemr61214355ad.52.1726864579289; Fri, 20 Sep 2024 13:36:19 -0700 (PDT) Received: from [10.131.13.50] ([67.23.203.34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794746d76sm98493945ad.292.2024.09.20.13.36.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Sep 2024 13:36:18 -0700 (PDT) Date: Fri, 20 Sep 2024 13:36:18 -0700 (PDT) X-Google-Original-Date: 20 Sep 2024 13:36:17 -0700 X-Google-Original-From: Dennis Snell To: Jakub Zelenka Cc: Arvids Godjuks , Hammed Ajao , Rob Landers , Adam Zielinski , Mike Schinkel , PHP internals Subject: Re: [PHP-DEV] Zephir, and other tangents Message-ID: <8A970628-C287-4584-8E44-7708E38142F7@automattic.com> In-Reply-To: References: <8D420123-4ECF-48FD-A9C3-F80C60457A37@newclarity.net> <7EA884D2-0F37-4BF1-AC97-DB6953C944E6@automattic.com> 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="=_0D617CFA-9CB8-4921-846C-E51196F33D78" From: dennis.snell@automattic.com (Dennis Snell) --=_0D617CFA-9CB8-4921-846C-E51196F33D78 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On Sep 20, 2024, at 1:21 PM, Jakub Zelenka wrote: >=20 >=20 > Hi, >=20 > On Fri, Sep 20, 2024 at 6:32=E2=80=AFPM Dennis Snell > wrote: >=20 >>=20 >>=20 >>=20 >> My goal in sharing here is to help better represent my own perspective o= f WordPress=E2=80=99 needs based on what I=E2=80=99ve seen. It=E2=80=99s lo= ng been on my list to propose a WASM RFC, but because I personally haven= =E2=80=99t had the priority available to get an implementation working I ha= ven=E2=80=99t done so. It=E2=80=99s my impression from the documentation th= at the purpose of these email threads w.r.t. RFCs is to gather interest and= input before any RFC would be put together, to hold these discussions befo= re anyone commits any major time to it. >>=20 >>=20 >>=20 >=20 > Is your objective to support building PHP to wasm32-wasi target like it w= as proposed here:=C2=A0https://github.com/php/php-src/pull/10457 > ? If so, the main issue with that was inability to do the zend_bailout as= wasm does not support currently support setjmp and longjmp. Otherwise it's= mostly about disabling some functionality. >=20 >=20 It=E2=80=99s the other way around. We=E2=80=99ve been having a great time a= lready building PHP as a WASM binary - we package it with SQLite and WordPr= ess to create =E2=80=9CThe WordPress Playground.=E2=80=9D There=E2=80=99s a= wonderful new world of things that can happen when packaging PHP inside a = WASM runtime. However, this is about calling compiled WebAssembly code from user-space PH= P. =C2=A0 =C2=A0 load_wasm( __DIR__ . =E2=80=98/interesting-computation.wasm= =E2=80=99 ); =C2=A0 =C2=A0 $description =3D null; =C2=A0 =C2=A0 call_wasm_func( =E2=80=98lazy_json_decode=E2=80=99, $json, = =E2=80=98items[0].description=E2=80=99, $description ); This is about things including, but not limited to the following scenarios: =C2=A0- Properly parsing HTML, JSON, XML, URLs, image formats, and more, bu= t don=E2=80=99t want the =C2=A0 =C2=A0severe text-processing penalty from user-space PHP code. =C2=A0- Ensuring that efficient tools are available to PHP code even when h= osts don=E2=80=99t allow installing extensions, =C2=A0 =C2=A0even when the site owners have no idea what an extension is or= how to install one. =C2=A0- Updating libraries that convert or resize images when bug fixes are= made, without having to demand =C2=A0 =C2=A0that hosts accept that responsibility and burden themselves. =C2=A0- Share algorithms between JavaScript on the frontend and PHP on the = backend, particularly those dealing =C2=A0 =C2=A0with string processing (for example, slug generation, sanitiza= tion, decoding). =C2=A0- Explore novel software ideas and get them out to testing and iterat= ion without having to ask the entire =C2=A0 =C2=A0ecosystem to adopt them as extensions. >=20 > Regards >=20 > Jakub=C2=A0 >=20 >=20 Same! Cheers. Dennis Snell --=_0D617CFA-9CB8-4921-846C-E51196F33D78 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Sep 20, 2024, at 1:21 PM, Jakub Zelenka <bukka@php.net> wrote= :

Hi,

On Fri, Sep 20, 2024 at 6:32=E2=80=AF= PM Dennis Snell <dennis.s= nell@automattic.com> wrote:

My goal in sharing here is to help better represent my own perspective= of WordPress=E2=80=99 needs based on what I=E2=80=99ve seen. It=E2=80=99s = long been on my list to propose a WASM RFC, but because I personally haven= =E2=80=99t had the priority available to get an implementation working I ha= ven=E2=80=99t done so. It=E2=80=99s my impression from the documentation th= at the purpose of these email threads w.r.t. RFCs is to gather interest and= input before any RFC would be put together, to hold these discussions befo= re anyone commits any major time to it.

Is your objective to support building PHP to wasm32-wasi tar= get like it was proposed here:=C2=A0<= /span>https://github.= com/php/php-src/pull/10457? If so, the main issue with that was inabili= ty to do the zend_bailout as wasm does not support currently support setjmp= and longjmp. Otherwise it's mostly about disabling some functionality.

It=E2=80=99s the other way around. We=E2=80=99ve been having a great t= ime already building PHP as a WASM binary - we package it with SQLite and W= ordPress to create =E2=80=9CThe WordPress Playground.=E2=80=9D There= =E2=80=99s a wonderful new world of things that can happen when packaging P= HP inside a WASM runtime.

However, this is about calling compiled WebAssembly code from user-spa= ce PHP.

=C2=A0 =C2=A0 load_wasm( __DIR__ . =E2=80=98/interesting-computation.w= asm=E2=80=99 );
=C2=A0 =C2=A0 $description =3D null;
=C2=A0 =C2=A0 call_wasm_func( =E2=80=98lazy_json_decode=E2=80=99, $jso= n, =E2=80=98items[0].description=E2=80=99, $description );

This is about things including, but not limited to the following scena= rios:
=C2=A0- Properly parsing HTML, JSON, XML, URLs, image formats, and mor= e, but don=E2=80=99t want the
=C2=A0 =C2=A0severe text-processing penalty from user-space PHP code.<= /div>

=C2=A0- Ensuring that efficient tools are available to PHP code even w= hen hosts don=E2=80=99t allow installing extensions,
=C2=A0 =C2=A0even when the site owners have no idea what an extension = is or how to install one.

=C2=A0- Updating libraries that convert or resize images when bug fixe= s are made, without having to demand
=C2=A0 =C2=A0that hosts accept that responsibility and burden themselv= es.

=C2=A0- Share algorithms between JavaScript on the frontend and PHP on= the backend, particularly those dealing
=C2=A0 =C2=A0with string processing (for example, slug generation, san= itization, decoding).

=C2=A0- Explore novel software ideas and get them out to testing and i= teration without having to ask the entire
=C2=A0 =C2=A0ecosystem to adopt them as extensions.


Regards

Jakub=C2=A0

Same! Cheers.
Dennis Snell
--=_0D617CFA-9CB8-4921-846C-E51196F33D78--