Sign in Join

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

Mailing lists / lazarus / 2018-12

Proud to announce..

12 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Michael Van Canneyt

Hello !

If anyone still doubted that Object Pascal is the best programming language, running on the most platforms:

It is with considerable pride that I can announce a new major milestone has been reached in Free Pascal's pas2js story:

The pas2js compiler runs now embedded in the browser itself.

A picture says more than a thousand words, see attachment.

See it in action for yourself:

https://idefix.freepascal.org/~michael/webcompiler/webcompiler.html

How does it work ?
1. Enter the source of your program.
2. Load the necessary units on the 'load units' tab. (The "Load default units" button is a good start)
3. Hit "Compile" !
4. Observe the output of the compiler in the tab "Compiler output"
5. If all went well, the 'Run' button is now active...
6. Press the 'Run' button !

The program will be loaded & run in an IFrame at the bottom of the page.

Obviously, this is only a demo, and there is ample room for improvement (specifying additional options, viewing generated source code, improving gui) and you don't have all units available: only the ones in 'rtl' have been made available. (it's just a matter of uploading them)

But it works. No server interaction other than loading the extra needed unit sources is necessary: all is done in the browser.

All code is committed in SVN, demo/webcompiler.

Last but not least:
Once more I want to thank Mattias Gaertner for his incredible work on the compiler, without whose solid foundations I would not have been able to do this !

Enjoy, and stay tuned for more wonderful features & cutting edge technology from the people that bring you Free Pascal & Lazarus !

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webcompiler.png
Type: image/png
Size: 62826 bytes
Desc:
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181204/9403497b/attachment-0001.png>

Reply by email

silvioprog
to Michael Van Canneyt

On Tue, Dec 4, 2018 at 7:01 PM Michael Van Canneyt via lazarus <

Show quoted text 53 lines
wrote: Hello ! If anyone still doubted that Object Pascal is the best programming language, running on the most platforms: It is with considerable pride that I can announce a new major milestone has been reached in Free Pascal's pas2js story: The pas2js compiler runs now embedded in the browser itself. A picture says more than a thousand words, see attachment. See it in action for yourself: https://idefix.freepascal.org/~michael/webcompiler/webcompiler.html How does it work ? 1. Enter the source of your program. 2. Load the necessary units on the 'load units' tab. (The "Load default units" button is a good start) 3. Hit "Compile" ! 4. Observe the output of the compiler in the tab "Compiler output" 5. If all went well, the 'Run' button is now active... 6. Press the 'Run' button ! The program will be loaded & run in an IFrame at the bottom of the page. Obviously, this is only a demo, and there is ample room for improvement (specifying additional options, viewing generated source code, improving gui) and you don't have all units available: only the ones in 'rtl' have been made available. (it's just a matter of uploading them) But it works. No server interaction other than loading the extra needed unit sources is necessary: all is done in the browser. All code is committed in SVN, demo/webcompiler. Last but not least: Once more I want to thank Mattias Gaertner for his incredible work on the compiler, without whose solid foundations I would not have been able to do this ! Enjoy, and stay tuned for more wonderful features & cutting edge technology from the people that bring you Free Pascal & Lazarus ! Michael.

Awesome news! Thanks for this incredible work. ☺

Can we use it for online tests to report bugs via Mantis? (something like JSFiddle)

Anyway, thanks a lot for sharing it!

Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181204/296027d3/attachment.html>

Reply by email

Michael Van Canneyt
to silvioprog
silvioprog wrote
Awesome news! Thanks for this incredible work. ☺ Can we use it for online tests to report bugs via Mantis? (something like JSFiddle)

An interesting concept, I like it.

This is something we can and should indeed think about.

Michael.

Reply by email

silvioprog
to Michael Van Canneyt

On Tue, Dec 4, 2018 at 7:26 PM Michael Van Canneyt via lazarus <

Show quoted text 13 lines
wrote: On Tue, 4 Dec 2018, silvioprog via lazarus wrote: > Awesome news! Thanks for this incredible work. ☺ > > Can we use it for online tests to report bugs via Mantis? (something like > JSFiddle) An interesting concept, I like it. This is something we can and should indeed think about.

Some ideias:

1. a clean highlighted source editor allowing:
1.1 to link the CDN of the common JS/CSS libraries (jQuery.js, Vue.js, Bootstrap, Modernizr...);

  1.2 to save the code and share its link (shortened?);
  1.3 to download the generated codes/logs (compressed?);
  1.4 code hinting (like Lazarus' identifier completion. This feature was

recently added to JSFiddle);
1.5 code minify and/or uglify
<https://stackoverflow.com/questions/19694448/whats-the-difference-between-concat-and-uglify-and-minify> (allowing to copy the single generated line).
2. an easy-to-remember link:
2.1 a long link idea:
https://pas2js.freepascal.org/<OUR-MANTIS-USER>/<CODE-TO-SHARE> (ex: https://pas2js.freepascal.org/michael/Q8KVC)
2.2 a short link (*very* optional, but useful 🙂)
3. extra:

  3.1 allows the user to manage codes (something like https://pastebin.com);
  3.2 allows reviews/corrections from other users (something like a fork +

share).

Just some naive ideas and maybe hard to be implemented, but useful. 😅

Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181204/fdae8221/attachment.html>

Reply by email

leledumbo
to Michael Van Canneyt: Hello ! If anyone still doubted that Object Pascal is the best programming language,…

Good work! A little bug, though:
1. Directly press Compile, it will be an error
2. Go to Load units tab, press Load default units
3. Press Compile again, Compiler Output will always contain "Fatal: Compilation aborted" until refreshed and correct steps are done (i.e. Load default units before Compile)

Reply by email

Michael Van Canneyt
to AlexeyT
AlexeyT wrote
 I see that you converted FPC project to JS and inserted it into the webpage. Is it correct?

It is. But this was a goal from day 1 of the project.

I expect the lazarus team to have lazarus running in the browser this time next year. ;)

Michael.

Reply by email

Michael Van Canneyt
to leledumbo: Good work! A little bug, though: 1. Directly press Compile, it will be an error 2. Go to…
leledumbo wrote 10 lines
> See it in action for yourself: > > https://idefix.freepascal.org/~michael/webcompiler/webcompiler.html Good work! A little bug, though: 1. Directly press Compile, it will be an error 2. Go to Load units tab, press Load default units 3. Press Compile again, Compiler Output will always contain "Fatal: Compilation aborted" until refreshed and correct steps are done (i.e. Load default units before Compile)

Seems like the reset is not working correctly after an error occurred.

We'll have to check that.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Hello ! If anyone still doubted that Object Pascal is the best programming language,…
Michael Van Canneyt wrote

Sounds very interesting, so I followed the link and get the following error when I click compile.

See attached image. I'm using Firefox 63.0 (64-bit Firefox Quantum) running under FreeBSD 11.2.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: webcompiler_error.png Type: image/png Size: 17202 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181210/c1edad72/attachment-0001.png>

Reply by email

Graeme Geldenhuys
to leledumbo: Good work! A little bug, though: 1. Directly press Compile, it will be an error 2. Go to…
leledumbo wrote
Good work! A little bug, though:

Ah yes, that's the same error I got. Following your steps and a web page refresh I eventually got the default sample program to compile and run.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email