<div dir="ltr"><div>Good morning Michael,</div><div><br></div><div>I have received your article as a PDF,</div><div>thank you,</div><div>I was aware of your *JOB* since your email of September 4th 2022,</div><div>I always like to get news on the progress of WebAssembly.</div><div><br></div><div>Kind regards, Jerome.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Sep 4, 2022 at 11:40 AM Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hello,<br>
<br>
Thanks to the sponsoring by Tixeo, the FPC & Lazarus team has developed a<br>
pretty unique feature for the FPC WebAssembly support.<br>
<br>
Webassembly is a bytecode format and embedding specification that allows you<br>
to load and run compiled code into the browser in a restricted environment. <br>
It is supported by all major browsers.<br>
<br>
You can also run webassembly bytecode in command-line tools such as wasmtime<br>
or even in an FPC program, using the wasmtime library.<br>
<br>
By itself, WebAssembly has no access to its environment. It can only use<br>
what the environment provides: file access, DOM acces etc. If the<br>
environment defines it, WebAssembly can use it. The webassembly<br>
specification only defines a mechanism to import/export routines from/to the<br>
environment in which it runs.<br>
<br>
The browser has a rich environment, which it does not (yet) expose to the<br>
WebAssembly world. Which is a pity, because this limits the usefulness of<br>
WebAssembly in the browser considerably.<br>
<br>
FPC has now developed a protocol which allows you to use all Browser APIs by<br>
the JOB (Javascript Object Bridge) mechanism, in particular the DOM<br>
functionality.<br>
<br>
This allows you to build a UI (using HTML) for webassembly programs<br>
running in the browser: one can imagine running Lazarus in the browser...<br>
<br>
More info about this unique feature can be found in the Wiki:<br>
<br>
<a href="https://wiki.freepascal.org/WebAssembly/DOM" rel="noreferrer" target="_blank">https://wiki.freepascal.org/WebAssembly/DOM</a><br>
<br>
To my knowledge, the only other programming language to offer this kind of <br>
general support for browser API access from webassembly is Rust.<br>
<br>
Enjoy,<br>
<br>
Michael.<br>
_______________________________________________<br>
Pas2js maillist  -  <a href="mailto:Pas2js@lists.freepascal.org" target="_blank">Pas2js@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br>
</blockquote></div>