diff --git a/index.md b/index.md index 2e6699c..280cbf8 100644 --- a/index.md +++ b/index.md @@ -12,6 +12,10 @@ WebPerl uses the power of [WebAssembly](https://webassembly.org/) and [Emscripten](http://emscripten.org/) to let you run Perl 5 in the browser! +WebPerl does not translate your Perl code to JavaScript, instead, it is +a port of the `perl` binary to WebAssembly, so that you have the full +power of Perl at your disposal! + **Notice: WebPerl is very much in beta.** Some things may not work yet, and parts of the API may still change. Your feedback is always appreciated! diff --git a/using.md b/using.md index ef76ed9..c74e99c 100644 --- a/using.md +++ b/using.md @@ -265,6 +265,10 @@ Runs Perl with the given `argv` array. If `argv` is not provided, uses Emscripte Evaluates the given Perl code. Currently always returns a string. +The functionality of this function *may* be expanded upon in the future +to return more than just a string. See the discussion in +[Mappings from Perl to JavaScript](#mappings-from-perl-to-javascript). + #### `Perl.end()` Ends the Perl interpreter. See the discussion under @@ -392,7 +396,7 @@ Arguments from Perl to JavaScript function or method calls are mapped as follows ### Mappings from Perl to JavaScript -Unlike the JavaScript to Perl mappings, values are (currently) generally *copied* from +Unlike the JavaScript to Perl mappings, values are (currently¹) generally *copied* from Perl to JavaScript, instead of being *referenced*. The exceptions are Perl `sub`s and `WebPerl::JSObject`s. @@ -410,6 +414,14 @@ The exceptions are Perl `sub`s and `WebPerl::JSObject`s. [the `Cpanel::JSON::XS` documentation](https://metacpan.org/pod/Cpanel::JSON::XS). - Other references, including objects, are currently not supported. +¹ So far, the focus of WebPerl has been to replace JavaScript with Perl, and +therefore on accessing JavaScript from Perl, and not as much the other +way around, that is, doing complex things with Perl from JavaScript code. +For example, currently, `Perl.eval()` always returns a string, but could in the +future be extended to return more than that, similar to `WebPerl::js()`, +and then the passing of Perl values to JavaScript could be accomplished +differently as well. + ***