Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125626 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 251301A00BD for ; Wed, 18 Sep 2024 19:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1726688133; bh=mhRG3YmlvStKBJzrImIwRhTp+mwtk9IXd/Iy2pl9B24=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=noSCRizq7M5jqScwo5hMR49zHWRCsfsdP0yA65Gn/pui9xdhMpQIv5eXnz3wnbjdV 9Dof/aOAoVhwk0BmAcKDY+bVOwedQ1+xuo9M6lrcliqz+tqPBoZEerD6k7WFWQcFTc xjY66hil1aJDBz05OFdWhqsMj+eXhEIgYiD2wkbfO2ZnzyRDxqwqMTdLb0zE1XCtpB i/XeK0gdAPTb8wDQRuvp0NWJQWIAoL2kgngFVr2pX+s/JIrX5zOklPLL+t/6JqdDQp RXEvO18B2TwhMz5Wg4Fhk0NwIb6LZ4cJP4juTFBDbHbICZd3sy05JljQNXiDZOtxc9 mdoXj6mS6XGvA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0DB9180042 for ; Wed, 18 Sep 2024 19:35:32 +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 autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (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, 18 Sep 2024 19:35:32 +0000 (UTC) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-6c49c9018ebso434977b3.3 for ; Wed, 18 Sep 2024 12:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1726688006; x=1727292806; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8xGsWAtUh85tfQEyZPaBU5/7j9sygJEHDefDVSGJYro=; b=Y9HbaROwqCFahWncV8eCCC1B9KsMS7jWi3o4909YYEnJ61UXND0tBj4M/5voZdcava SJ82F1dFh2XmjakN9kHrh/zRt/RkakHVgg47EeNfQig9azbBX8QzKfEOV/mgN+40Zowj CibsbIkIaHP+XbvCsepheKcYYgDXIswQn4aQQoQx8F7Of9juaoXevSXLS4oe1twdjr2q d0IxkraCbeJsDV8LmA32CoCUg6A+0yDvph9bD2Min4jRQO46WlBTAYVCDmmLf/qA6OJi nZdp8MCpSffgLmBRWbxkdae9yEc8FQDRnlRZbEeovdRdgggnS/7BOxGccgF0Tigt2yyn BuPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726688006; x=1727292806; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8xGsWAtUh85tfQEyZPaBU5/7j9sygJEHDefDVSGJYro=; b=kROnojZ3ELXxSGW4s41/zOSkS6PUirIxtvzKdifNne4lUY7oZFjERPfYvNnKeOX0fn yCQzc5JEWPJaI0buPhxEW4TK/qVvonRO5VWT/KiMdqFylZd1Lgh3dCpsIloCW7XhLdEA mVtbez93Xv3iuKJ9TzLzBovN4C1MZws13Qv1iwMBW3BpKlC8LFKxV830pFdUpYhVdxyM NuEorXSirlFHtFOILT8K50LIWzu9Mpr6uFenJDrNl8gXWTo51DkKp1vfjO9Ai3L0gCWh cLWwi3cnh4hrOatmNpGP09uGVB5lqPk2+64PK1tq9zSApFAHcFa0Zk/0bQoMcIO8086h 7Bvw== X-Forwarded-Encrypted: i=1; AJvYcCVv5+M9DGxoFlr77x8ucuiIr8hXnRctwVZy6m+Anx9n1wJXuVJ3D7aLS028qvx8DGHYaQtgVv0gtFQ=@lists.php.net X-Gm-Message-State: AOJu0YzhDaXlfzp6jUAlyoMaqP3l1Z9ZYyJLvsSQRQBsH4eAxYGz0Xm8 aGhpB0gY0puO++KRCi+XZ52htboquphLf7K/ZqxRpSoH3ejANfMIuEL4WnYwA8g= X-Google-Smtp-Source: AGHT+IG64dcZfov3tt58S4fU2VKQ9E+M2N0n0OdrCZKXyydYHXD21fxuXhYTkrbhpXMBQU3frLtu/A== X-Received: by 2002:a05:690c:67c1:b0:6dd:ba68:4cca with SMTP id 00721157ae682-6ddba685b39mr140507987b3.21.1726688006040; Wed, 18 Sep 2024 12:33:26 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6de00bf6fa7sm2501957b3.91.2024.09.18.12.33.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2024 12:33:25 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: [PHP-DEV] Zephir, and other tangents In-Reply-To: Date: Wed, 18 Sep 2024 15:33:24 -0400 Cc: Adam Zielinski , PHP internals , Dennis Snell Content-Transfer-Encoding: quoted-printable Message-ID: References: <8D420123-4ECF-48FD-A9C3-F80C60457A37@newclarity.net> To: Hammed Ajao X-Mailer: Apple Mail (2.3696.120.41.1.10) From: mike@newclarity.net (Mike Schinkel) > On Sep 18, 2024, at 3:09 PM, Hammed Ajao wrote: > Yes and no. The primary goal of WebAssembly is to support = high-performance applications on web pages. The premise is simple: = JavaScript is the only language natively supported by browsers, but = developers want to use various other languages (e.g., C, C++, Rust), = particularly for performance-critical tasks. WebAssembly allows code = written in these languages to be compiled to a universal format (Wasm) = that browsers can run efficiently. Yeah. That was the original goal. But to say WASM's domain is limited to browsers is not valid any longer: - = https://www.webassembly.guide/webassembly-guide/webassembly/webassembly-in= -the-server - = https://blog.pixelfreestudio.com/how-to-implement-webassembly-in-server-si= de-applications/ - https://medium.com/wasm/webassembly-on-the-server-side-c584f874b4a3 - https://www.secondstate.io/articles/why-webassembly-server/ - = https://www.techtarget.com/searchitoperations/news/252527414/Server-side-W= ebAssembly-prepares-for-takeoff-in-2023 And even: - https://docs.docker.com/desktop/wasm/ > However, in the case of PHP, many of the benefits that WebAssembly = brings to other languages are already available through PHP extensions = or FFI for non-performance-sensitive tasks. Integrating a Wasm runtime = into PHP would be a complex undertaking with significant risks, but it = wouldn't necessarily provide proportionate rewards, which is the main = point I'm trying to make. Many of the benefits, but NOT the most important one for a large number = of installations. The benefit that neither FFI nor extensions can touch is the ability to = be run on a managed server. Without that, none of the other benefits of = FFI nor extensions even matter. Full stop. =20 > Extensions, which are already implemented in lower-level languages = like C or C++, would still need to be compiled to WebAssembly if the = goal were full compatibility. This might lead us down the path of either = creating a domain-specific language (DSL) for PHP=E2=80=94similar to = AssemblyScript=E2=80=94or simply leaving it up to the library authors to = choose lower-level languages (as is currently the case). >=20 > In essence, WebAssembly is great for certain scenarios, but PHP has = existing mechanisms that make the addition of a Wasm runtime potentially = redundant for most use cases.=20 Partial redundancy is not redundancy.=20 WASM's ability to run on a managed server =E2=80=93 assuming it were = built-in to PHP core =E2=80=94 is the critical non-redundant benefit. If = you cannot run those "existing mechanisms" then they fact they are = redundant does not matter one iota. -Mike=