Skip to content

Run PHP in WASM? #160

@Lewiscowles1986

Description

@Lewiscowles1986

Hello 👋

With the rise of projects such as WordPress playground, and php-wasm. Do you think it might make more sense to run PHP on the client, to save server costs?

I Logged into Exercism today to find out if this was the model pivoted to, and found you're still apparently using Docker and an older PHP version.

Why I think this is a good idea. Using caching headers, service-workers and a WASM-ified PHP, with a little work, a lot could be saved, and other types of exercise could be made possible.

PHP.net is using something similar as an example of live-docs

I made my own toy of this wanting multiple runtime versions, which I intend to use in my own notes for evergreen miro-labs

https://lewiscowles1986.github.io/experiments/wasm/php/

uses

https://github.com/Lewiscowles1986/php-wasm-builder based from Derick Rethans own https://github.com/derickr/php-wasm-builder (which I believe is used for PHP.net)

Challenges I foresee:

  • Decide if single static artifact or multiple artifact / request
  • Integrating PHPUnit
  • Saving and loading user code
  • re-writing / adding experiment flags to make all of this safe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions