Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-10

What is webasssembly?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Steve Litt
Steve Litt wrote
What is webasssembly?

A bytecode format (similar to what is used in Java and C# runtimes) which is an open standard and which runs in all major browsers or in a host application.

Michael.

Reply by email

Steve Litt
to Michael Van Canneyt

Michael Van Canneyt via fpc-pascal said on Wed, 11 Oct 2023 08:27:35 +0200 (CEST)

Show quoted text 7 lines
On Tue, 10 Oct 2023, Steve Litt via fpc-pascal wrote: > What is webasssembly? A bytecode format (similar to what is used in Java and C# runtimes) which is an open standard and which runs in all major browsers or in a host application.

Does this mean I can code an application in Pascal and use webassembly to turn it into a web application? If so, could you please point me to some simple examples?

Thanks,

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century http://www.troubleshooters.com/rl21

Reply by email

Michael Van Canneyt
to Steve Litt: Michael Van Canneyt via fpc-pascal said on Wed, 11 Oct 2023 08:27:35 +0200 (CEST) Does…
Steve Litt wrote 14 lines
Michael Van Canneyt via fpc-pascal said on Wed, 11 Oct 2023 08:27:35 +0200 (CEST) > On Tue, 10 Oct 2023, Steve Litt via fpc-pascal wrote: > >> What is webasssembly? > > A bytecode format (similar to what is used in Java and C# runtimes) > which is an open standard and which runs in all major browsers or in a > host application. Does this mean I can code an application in Pascal and use webassembly to turn it into a web application? If so, could you please point me to some simple examples?

Careful, there is no 'simple' in webassembly :-)

Basically, yes, this can be used to run a pascal program.

At the moment, all console applications will work in the browser, except for input, unless you use pre-prepared input.

Most packages in FPC that do not rely on external libraries will compile.

For demos:

In the pas2js project, there are demos under the 'wasienv' directory. You can adapt the helloworld example to load any .wasm file you want:

https://gitlab.com/freepascal.org/fpc/pas2js/-/tree/main/demo/wasienv/simple

You can do graphics using a HTML canvas (see the canvas demo), you can also manipulate the DOM. (see the job_* units in the 'dom' demo)

You cannot (yet) write a Lazarus LCL program and compile it to webassembly.

For those that also use Delphi, I'm currently working on porting FMX to Webassembly for my job, to be able to make full-fledged UI programs. The outcome is as yet uncertain, but we think it should be doable.

Michael.

Reply by email