Recent

Author Topic: Web assembly in Lazarus  (Read 734 times)

Prakash

  • Full Member
  • ***
  • Posts: 129
Web assembly in Lazarus
« on: September 18, 2023, 08:19:19 pm »
Does any one worked on web assembly in Lazarus.

Please guide me

PierceNg

  • Sr. Member
  • ****
  • Posts: 353
    • SamadhiWeb
Re: Web assembly in Lazarus
« Reply #1 on: September 19, 2023, 04:08:41 am »
For starters, read the wiki pages.

circular

  • Hero Member
  • *****
  • Posts: 4049
    • Personal webpage
Re: Web assembly in Lazarus
« Reply #2 on: September 19, 2023, 07:52:08 am »
Hi Prakash!

Compiling to WebAssembly is an exciting idea.

There is some documentation here: https://wiki.freepascal.org/WebAssembly

For what I understand, the programs can be embedded in a web page with pas2js and it runs within it a WebAssembly compiled. For example:
https://www.freepascal.org/~michael/pas2js-demos/wasienv/canvas/
There are links at the bottom of the page to show the source code.

Regards
Conscience is the debugger of the mind

egsuh

  • Hero Member
  • *****
  • Posts: 1196
Re: Web assembly in Lazarus
« Reply #3 on: October 03, 2023, 03:26:17 pm »
Does it mean to hide codes of jacascript?

PierceNg

  • Sr. Member
  • ****
  • Posts: 353
    • SamadhiWeb
Re: Web assembly in Lazarus
« Reply #4 on: Today at 02:54:17 am »
Does it mean to hide codes of jacascript?

WebAssembly (Wasm) is the 'executable' binary format for an abstract machine. The web browser implements this abstract machine allowing it to execute .wasm files. Wasm is designed to be executed at near native speed; well, nearer to native speed than Javascript can be.

Since Wasm is an executable format, programming languages can target it. That's another benefit of Wasm:
Write programs for the web browser in your favourite language.

Actually, modern computers are so fast, and desktop computers typically so idle, people have compiled interpreters (Python, Javascript, etc) into Wasm, then use the web browser's Wasm engine to run the interpreter to run Python/Javascript/whatever scripts. Layers upon layers of compilation/transformation and still fast enough to be useful and/or fun.

 

TinyPortal © 2005-2018