diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rubyvm-on-php-on-wasm/HelloWorld.php | 18 | ||||
| -rw-r--r-- | examples/rubyvm-on-php-on-wasm/HelloWorld.rb | 1 | ||||
| -rw-r--r-- | examples/rubyvm-on-php-on-wasm/HelloWorld.yarv | bin | 221 -> 0 bytes | |||
| l--------- | examples/rubyvm-on-php-on-wasm/emscripten_bridge.php | 1 | ||||
| -rw-r--r-- | examples/rubyvm-on-php-on-wasm/php-wasm.php | 26 | ||||
| l--------- | examples/rubyvm-on-php-on-wasm/php-wasm.wasm | 1 |
6 files changed, 0 insertions, 47 deletions
diff --git a/examples/rubyvm-on-php-on-wasm/HelloWorld.php b/examples/rubyvm-on-php-on-wasm/HelloWorld.php deleted file mode 100644 index b237637..0000000 --- a/examples/rubyvm-on-php-on-wasm/HelloWorld.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -require_once __DIR__ . '/../../vendor/autoload.php'; - -\define('STDIN', fopen('php://stdin', 'r')); - -$rubyVM = new \RubyVM\VM\Core\Runtime\RubyVM( - new \RubyVM\VM\Core\Runtime\Option( - reader: new \RubyVM\VM\Stream\BinaryStreamReader( - streamHandler: new \RubyVM\VM\Stream\FileStreamHandler( - __DIR__ . '/HelloWorld.yarv', - ), - ), - logger: new \Psr\Log\NullLogger(), - ), -); -$executor = $rubyVM->disassemble(); -$executor->execute(); diff --git a/examples/rubyvm-on-php-on-wasm/HelloWorld.rb b/examples/rubyvm-on-php-on-wasm/HelloWorld.rb deleted file mode 100644 index f94759e..0000000 --- a/examples/rubyvm-on-php-on-wasm/HelloWorld.rb +++ /dev/null @@ -1 +0,0 @@ -puts RubyVM::InstructionSequence.compile("puts 'HelloWorld!\n'", "HelloWorld.rb").to_binary diff --git a/examples/rubyvm-on-php-on-wasm/HelloWorld.yarv b/examples/rubyvm-on-php-on-wasm/HelloWorld.yarv Binary files differdeleted file mode 100644 index 4a4cb1c..0000000 --- a/examples/rubyvm-on-php-on-wasm/HelloWorld.yarv +++ /dev/null diff --git a/examples/rubyvm-on-php-on-wasm/emscripten_bridge.php b/examples/rubyvm-on-php-on-wasm/emscripten_bridge.php deleted file mode 120000 index 3fc7d65..0000000 --- a/examples/rubyvm-on-php-on-wasm/emscripten_bridge.php +++ /dev/null @@ -1 +0,0 @@ -../php-on-wasm/emscripten_bridge.php
\ No newline at end of file diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.php b/examples/rubyvm-on-php-on-wasm/php-wasm.php deleted file mode 100644 index 3f5b9d0..0000000 --- a/examples/rubyvm-on-php-on-wasm/php-wasm.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -require_once __DIR__ . '/../../vendor/autoload.php'; - -use Nsfisis\Waddiwasi\Stream\FileStream; -use Nsfisis\Waddiwasi\WebAssembly\Execution\Runtime; - -const PHP_HELLO_WORLD = <<<'EOS' -require_once '%DIR%/HelloWorld.php'; -EOS; - -$wasmBinaryStream = new FileStream(__DIR__ . '/php-wasm.wasm'); - -$linker = require_once __DIR__ . '/emscripten_bridge.php'; - -$runtime = Runtime::instantiateFromStream($wasmBinaryStream, $linker); -$codePtr = allocateStringOnWasmMemory($runtime, strtr(PHP_HELLO_WORLD, [ - '%DIR%' => __DIR__, -])); - -$results = $runtime->invoke('php_wasm_run', [$codePtr]); -\assert(\count($results) === 1); -$exitCode = $results[0]; -\assert(\is_int($exitCode)); diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.wasm b/examples/rubyvm-on-php-on-wasm/php-wasm.wasm deleted file mode 120000 index 4f254d7..0000000 --- a/examples/rubyvm-on-php-on-wasm/php-wasm.wasm +++ /dev/null @@ -1 +0,0 @@ -../compile-php-to-wasm/php-wasm.wasm
\ No newline at end of file |
