[Pas2js] Pas2js Digest, Vol 11, Issue 4

Stephen Wright stephenmichaelwright at yahoo.co.uk
Mon Nov 5 10:46:56 CET 2018


 Hi Guys

On Sun, 4 Nov 2018 09:23:57 Michael Van Canneyt wrote ……
>But once done, we can envision a web page where you enter your program in an>editor, it is compiled for you and it can run in the same - or another - web>page. It would not need a webserver, so a version running in a web runtime>on a tablet and/or smartphone then comes in view.>And, of course, the end goal: Running Lazarus in the browser.
Has anyone checked out our demo at ….

https://www.dropbox.com/sh/401ua59t0qmossd/AACVS4j2NJoLnPivKhfL7S3fa?dl=0
This shows a rudimentary version of  this “Pascal IDE in a Web Page” functionality as mentioned by Michael.
It is mocked up with a Castalia based transpiler instead of the Free Pascal one but ast Mattias and Michael have done this great work we can now do it “for real” 
We are keen to get some feedback on this so we can most effectively support the end goal of Lazarus on the Web. (While bearing in mind that our short term objective is to embed our rudimentary IDE into specialist mathematical modelling and control engineering utilities.)
Steve


    On Sunday, 4 November 2018, 11:00:08 GMT, pas2js-request at lists.freepascal.org <pas2js-request at lists.freepascal.org> wrote:  
 
 Send Pas2js mailing list submissions to
    pas2js at lists.freepascal.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
or, via email, send a message with subject or body 'help' to
    pas2js-request at lists.freepascal.org

You can reach the person managing the list at
    pas2js-owner at lists.freepascal.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Pas2js digest..."


Today's Topics:

  1. mighty milestone: self compiling pas2js (Mattias Gaertner)
  2. Re: mighty milestone: self compiling pas2js (Zbyněk Fiala)
  3. Re: mighty milestone: self compiling pas2js (cbsistem)
  4.  mighty milestone: self compiling pas2js (johnathan dhoe)
  5. Re: mighty milestone: self compiling pas2js (Michael Van Canneyt)
  6. Re: mighty milestone: self compiling pas2js (Mattias Gaertner)


----------------------------------------------------------------------

Message: 1
Date: Sat, 3 Nov 2018 23:07:47 +0100
From: Mattias Gaertner <nc-gaertnma at netcologne.de>
To: pas2js at lists.freepascal.org
Subject: [Pas2js] mighty milestone: self compiling pas2js
Message-ID: <20181103230747.584746a2 at limapholos.matflo.wg>
Content-Type: text/plain; charset=US-ASCII

Hi,

The trunk compiler can now compile itself to platform NodeJS.
And the compiled compiler can compile itself too, creating the same JS.

pas2js is now a "real" compiler. ;)

Mattias


------------------------------

Message: 2
Date: Sat, 3 Nov 2018 23:10:29 +0100
From: Zbyněk Fiala <zbynek.fiala at gmail.com>
To: pas2js at lists.freepascal.org
Subject: Re: [Pas2js] mighty milestone: self compiling pas2js
Message-ID: <570ade5f-c5f4-f1ae-7e19-4f95c45ce309 at gmail.com>
Content-Type: text/plain; charset=utf-8

Great. Congratulations!


Dne 3.11.2018 v 23:07 Mattias Gaertner via Pas2js napsal(a):
> Hi,
>
> The trunk compiler can now compile itself to platform NodeJS.
> And the compiled compiler can compile itself too, creating the same JS.
>
> pas2js is now a "real" compiler. ;)
>
> Mattias
> _______________________________________________
> Pas2js maillist  -  Pas2js at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js



------------------------------

Message: 3
Date: Sat, 3 Nov 2018 18:22:01 -0500 (CDT)
From: cbsistem <cbsistem at yahoo.com.br>
To: pas2js at lists.freepascal.org
Subject: Re: [Pas2js] mighty milestone: self compiling pas2js
Message-ID: <1541287321478-0.post at n8.nabble.com>
Content-Type: text/plain; charset=us-ascii

very good. congratulations




-----
cbsistem
Brasil
--
Sent from: http://pas2js.38893.n8.nabble.com/


------------------------------

Message: 4
Date: Sat, 3 Nov 2018 22:05:25 -0400
From: johnathan dhoe <johndhoe9123 at gmail.com>
To: pas2js at lists.freepascal.org
Subject: [Pas2js]  mighty milestone: self compiling pas2js
Message-ID:
    <CAJABaukPz5vhvmKYtvJ7pN2-WhkUudNPzhTGmuPa1Ra+np9TGA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I won't knock the achievement on a purely technical level, but from a
practical standpoint, what exactly is the intended use case for this? Why
specifically would I want to use the NodeJS version, when the native Pascal
version will always of course be significantly faster?

In my view, the whole draw of Pas2JS as a concept is that it allows you to
*avoid* directly writing JavaScript (which is a generally bad, very poorly
designed language by all accounts) as much as possible, instead remaining
in Pascal and simply letting the transpiler do the work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181103/087dd00c/attachment-0001.html>

------------------------------

Message: 5
Date: Sun, 4 Nov 2018 09:23:57 +0100 (CET)
From: Michael Van Canneyt <michael at freepascal.org>
To: pas2js discussions <pas2js at lists.freepascal.org>
Subject: Re: [Pas2js] mighty milestone: self compiling pas2js
Message-ID: <alpine.DEB.2.20.1811040910480.8778 at home.telenet.be>
Content-Type: text/plain; charset=US-ASCII; format=flowed



On Sat, 3 Nov 2018, johnathan dhoe wrote:

> I won't knock the achievement on a purely technical level, but from a
> practical standpoint, what exactly is the intended use case for this? Why
> specifically would I want to use the NodeJS version, when the native Pascal
> version will always of course be significantly faster?
>
> In my view, the whole draw of Pas2JS as a concept is that it allows you to
> *avoid* directly writing JavaScript (which is a generally bad, very poorly
> designed language by all accounts) as much as possible, instead remaining
> in Pascal and simply letting the transpiler do the work.

Your view is correct.

However, the nodejs compiler is not targeted specifically. 
But a browser-based version definitely is, and I am working on this last step.

Because nodejs gives you file access, the porting is easier than attempting
to port to the browser at once. We now know that the compiler can recompile
itself, and the next step is abstracting away the file system.

This was by and large already done from day 1, but there are some remaining
things to be done, which I am working on now:
Because of the asynchronous nature of the browser (imagine it has to fetch
an additional file from a server) this presents some additional
difficulties.

But once done, we can envision a web page where you enter your program in an
editor, it is compiled for you and it can run in the same - or another - web
page. It would not need a webserver, so a version running in a web runtime
on a tablet and/or smartphone then comes in view.

And, of course, the end goal: Running Lazarus in the browser.

Michael.


------------------------------

Message: 6
Date: Sun, 4 Nov 2018 10:45:26 +0100
From: Mattias Gaertner <nc-gaertnma at netcologne.de>
To: pas2js at lists.freepascal.org
Subject: Re: [Pas2js] mighty milestone: self compiling pas2js
Message-ID: <20181104104526.0c522647 at limapholos.matflo.wg>
Content-Type: text/plain; charset=US-ASCII

On Sat, 3 Nov 2018 22:05:25 -0400
johnathan dhoe <johndhoe9123 at gmail.com> wrote:

> I won't knock the achievement on a purely technical level, but from a
> practical standpoint, what exactly is the intended use case for this?
> Why specifically would I want to use the NodeJS version, when the
> native Pascal version will always of course be significantly faster?

The nodejs version is indeed purely technical. 

It is about 10 times slower. I don't know yet how much this is due to
missing optimizations of pas2js (e.g. sets). But it gives you a rough
estimate that the produced code can compete with many server languages
even when parsing strings, which is not a strong point of JS.

Why nodejs:
As a command line utility the compiler was easiest to port and debug as
a command line utility.

Benefits:
It helped to spot 30 bugs, I added some new features like {$i
%date%}, and I got a big testsuite. :)
Non technical benefit is the prove that you can write code cross
platform with reasonable amount of IFDEFs and having a rough estimate
about the speed to expect.

 
> In my view, the whole draw of Pas2JS as a concept is that it allows
> you to *avoid* directly writing JavaScript (which is a generally bad,
> very poorly designed language by all accounts) as much as possible,
> instead remaining in Pascal and simply letting the transpiler do the
> work.

Exactly.

Mattias


------------------------------

Subject: Digest Footer

_______________________________________________
Pas2js maillist  -  Pas2js at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js

------------------------------

End of Pas2js Digest, Vol 11, Issue 4
*************************************
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181105/dbebdd9b/attachment-0001.html>


More information about the Pas2js mailing list