On Mon, 11 Aug 2025, Christo Crause via fpc-pascal wrote:

Steve,

An interesting read, thanks for sharing the link. I particularly appreciate
the highlighted boxes pointing out gotcha and other typical syntax quirks.

Indeed !

Actually, I am currently working with the following page:

https://www.freepascal.org/~michael/pas2js-demos/wasmcompiler/

This is a page where you can enter pascal code, have it compiled and run in
the browser.

How it works is:
- Pas2js has been compiled to webassembly
- it is executed in a webworker (a kind of thread in the browser)
- output is javascript which is then executed in the main page in a frame.

The idea is to let people learn Pascal in a 'Try it out now' way on the web, live from a series of pages similar to the page by Steve Litt:

https://troubleshooters.com/codecorn/pascal/index.htm

I still need to smooth out some issues (currently you can compile only once,
this is easy to fix, and the list of available units is not yet complete) and add a syntax-highlighting editor (I already have this in a private copy of the site).

My plan was/is that once the rough things are smoothed out, to ask for volunteers to create a site similar to the one above using the web-compiler...

The advantage of pas2js is that it needs no server resources. Only some files are downloaded, nothing is executed on the server.

Later on, the same can be done with FPC itself, which would allow to
demonstrate more low-level things such as pointer access.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to