Skip to content

PHP Engine/Compiler Interop #85

@zaunere

Description

@zaunere

Hi Derick et al,

I've been researching other backend options for PHP such as GraalVM and zig/LLVM ecosystems (and nasm.us). There's been working on this of course:

oracle/graal#361
https://github.com/jphp-group/jphp
https://roadrunner.dev/
https://github.com/ircmaxell/php-llvm

And from an extension perspective:
https://github.com/sylvrs/ext-php-zig
https://docs.rs/ext-php-rs/latest/ext_php_rs/
https://github.com/swoole/swoole-src
https://github.com/openswoole

https://github.com/b0bleet/zvisor <-- wild

[ don't mean to leave anyone out - of course there's FFI too ]

Extensions work but I'm more interested in the engine/compiler - stuff like WASM/LLVM/zig as the backend using MLIR/etc with the ultimate goal of abstracting syntax from the engine. There are various layers and methods for doing this so I'm still exploring and starting with https://github.com/nikic/php-ast

VLD as I understand it is generating Zend opcode? What's the practicality of abstracting that to another backend, maybe zig/graal/wasm [ https://github.com/seanmorris/php-wasm ] or even a mod for something like https://github.com/zigzap/zap ?

This is based on the "All Code" philosophy that I'm working on. all code is using loose syntax across engines, encouraging interop, and ultimately considering replacing (complimenting) compilers/ASTs/etc with GPT, and eventually using natural language as a part of programming, but still just as fast as C.

I'm starting with PHP, not only because it's my goto, but also because its syntax is generally well understood. Like C, the syntax itself is relatively intuitive and easy - if/else, loops, etc. - but it's the details that get you. All Code strives to abstract those details from the syntax, using modern compilers, engines and techniques, so this:

start listening port 80 with a pool of 5 threads
new shared memory map _users and load from mysql using query _load_users
connect to rest some.api.com using key .key

... works without a performance hit, while providing the granularity that's sometimes needed. Plus, it's time PHP gets it's boost of V8 :)

Thanks much, and if anyone is interested in joining in, please let me know, definitely could use help!

Hans

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions