Re: Zephir, and other tangents
| From: | Adam Zielinski | Date: | Wed, 18 Sep 2024 11:15:48 +0000 |
| Subject: | Re: Zephir, and other tangents | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125620@lists.php.net to get a copy of this message | ||
On Wed, Sep 18, 2024 at 2:39 AM Hammed Ajao <hamiegold@gmail.com> wrote:
> Running Wasm and PHP virtual machines together presents several significant challenges and
> potential issues:
> • Memory Management and Isolation: Each VM has its own memory model and garbage collection
> strategy. Data passing between VMs often requires expensive memory copying. Coordinating garbage
> collection can lead to memory leaks or crashes if not handled properly.
> • Performance Impacts: Context switching between VMs introduces overhead, especially with
> frequent interactions. Interoperability can create latency due to data serialization and
> deserialization. Synchronization issues may arise when one VM needs to wait for the other.
> • Security Concerns: Discrepancies between PHP's more permissive environment and
> Wasm's stricter sandboxing can create vulnerabilities. The communication layer between VMs
> could be exploited for cross-VM attacks if not properly secured.
> • Debugging Complexities: Developers must use separate debugging tools for each VM. Stack
> traces spanning two execution contexts can be confusing and hard to interpret.
> • Compatibility and Maintenance: Independent evolution of PHP and Wasm VMs may introduce
> breaking changes, requiring constant updates to the integration layer. API changes in either
> environment necessitate adjustments in the integration code.
> • Resource Consumption: Running two VMs simultaneously increases CPU and memory usage. Longer
> initialization times may impact applications requiring quick boot times.
> • API and Communication Design: Designing efficient and secure APIs for inter-VM
> communication is critical but challenging. Marshaling data between PHP and Wasm adds complexity,
> especially when different programming languages are involved.
>
While these are definitely challenges, aren't they largely the same
for most languages intending to support WebAssembly?
– Adam