Recent

Author Topic: https://live.freepascal.org/  (Read 803 times)

Aruna

  • Hero Member
  • *****
  • Posts: 794
https://live.freepascal.org/
« on: March 05, 2026, 02:12:57 am »
1 - I cloned the live pascal  REPO
2 - Ran a python server using:

Code: Pascal  [Select][+][-]
  1. aruna@debian:~/fpclive/live-pascal/stage$ python3 -m http.server 8000

3 - Tried to browse using my localhost:8000

Attached screenshot shows what I am seeing. I have never used pas2js this is  very much a learning experience for me and I am now stuck.

4 - I uploaded everything to my paid hosting and get the same result? How do I proceed please?  https://sahanaya.net/live-pascal/stage/ you will notice the compile button is disabled.

The working demo Michael shared on teh email list is here: https://live.freepascal.org/
« Last Edit: March 05, 2026, 02:16:44 am by Aruna »

PierceNg

  • Sr. Member
  • ****
  • Posts: 434
    • SamadhiWeb
Re: https://live.freepascal.org/
« Reply #1 on: March 05, 2026, 05:15:59 am »
Your screenshot shows the error: Loading of WebAssembly from URL "wasm/pas2js.wasm" failed: 404 File not found.

If the repo you cloned does not contain the .wasm files, then you need to use the FPC Wasm toolchain to build those files.

Attached screenshot from live.freepascal.org showing the .wasm files downloaded and running.

Aruna

  • Hero Member
  • *****
  • Posts: 794
Re: https://live.freepascal.org/
« Reply #2 on: March 08, 2026, 01:05:18 am »
Your screenshot shows the error: Loading of WebAssembly from URL "wasm/pas2js.wasm" failed: 404 File not found.

If the repo you cloned does not contain the .wasm files, then you need to use the FPC Wasm toolchain to build those files.

Attached screenshot from live.freepascal.org showing the .wasm files downloaded and running.
Hi PierceNg. I tried to get started but the attached screenshot shows where I am stuck. Any guidance is most welcome and appreciated.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1225
Re: https://live.freepascal.org/
« Reply #3 on: March 08, 2026, 01:26:53 am »
1 - I cloned the live pascal  REPO
2 - Ran a python server using:

Code: Pascal  [Select][+][-]
  1. aruna@debian:~/fpclive/live-pascal/stage$ python3 -m http.server 8000

3 - Tried to browse using my localhost:8000

Attached screenshot shows what I am seeing. I have never used pas2js this is  very much a learning experience for me and I am now stuck.

4 - I uploaded everything to my paid hosting and get the same result? How do I proceed please?  https://sahanaya.net/live-pascal/stage/ you will notice the compile button is disabled.

The working demo Michael shared on teh email list is here: https://live.freepascal.org/
Very important information.

Thanks,

[fpc-pascal] Live pascal
Michael Van Canneyt via fpc-pascal Mon, 23 Feb 2026 01:50:53 -0800
https://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg57972.html


Quote
[fpc-pascal] Live pascal
Michael Van Canneyt via fpc-pascal Mon, 23 Feb 2026 01:50:53 -0800


Hello,

Pascal was designed for teaching. I'm sure everyone knows this.

The chairman of the Free Pascal & Lazarus foundation (and me) take this to
heart: we would very much like to reintroduce pascal in schools.
While it is not certain that we will achieve success, we still try to
improve the teaching experience for pascal.

Some languages allow you to test the language on a website. No need to install anything.

We can make the same possible for Pascal.

To this end, I've been working on a project for some time now:

https://live.freepascal.org/

A live editor for pascal, allowing you to run pascal in the browser.
It uses pas2js for 'compiling' and lazarus' JCF (compiled to wasm) for formatting the code. You can also pick files from your local computer.

It features a JIT compiler: if you don't do anything for 3 seconds or more,
it will compile in the background and annotate the code in the gutter with
errors/warnings etc.

You can embed the editor in an existing page and control it from the enveloping
page:

https://live.freepascal.org/test-embed.html

The idea is to enable a self-paced tutorial:

https://live.freepascal.org/tutorial-sample.html

But also to have specific assignments:

http://live.freepascal.org/?assignment=assignments/hello-world.json

The latter would be useful for a teacher.

The page tries to verify the results, and gives hints (all pre-configurable).

I know that some people are trying to put together a tutorial.
It is my hope that they will consider integrating this in their tutorial.

On the server, it is just a set of static files, so no heavy load.
Unzip, and you are ready to go.

I will be committing the code for this in a repo once I've cleaned up a bit.

Some embryonal ideas for improvements: - Step-by-step tutorial mode with manifest - Tutorial progress persistence - Submit results to teacher endpoint (will need server support) - Multi-file tabbed editor - Read-only code regions for scaffolded exercises - Inline hover annotations / code docs (AKA: code insight, the pascal LSP compiled to wasm should enable this) - Welcome overlay - Contextual "what next?" guidance - Quick-insert code snippets - Unit catalog grouped by domain - Resizable split panes (draggable divider) - Separate console panel from DOM output - Resizable output iframe + presets - Use FPC itself to output wasm.

Other suggestions for improvements are welcome. Contributions as well, obviously.

The page is an initial version, so be kind in your judgment :-)

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

PierceNg

  • Sr. Member
  • ****
  • Posts: 434
    • SamadhiWeb
Re: https://live.freepascal.org/
« Reply #4 on: March 08, 2026, 03:04:22 am »
Hi PierceNg. I tried to get started but the attached screenshot shows where I am stuck. Any guidance is most welcome and appreciated.

If you have already installed pas2js and still getting this message, see if the answer from this thread helps: https://forum.lazarus.freepascal.org/index.php/topic,72872.0.html

If you already have the latest pas2js, try invoking it from the shell prompt: "pas2js project1.lpr"

 

TinyPortal © 2005-2018