[Pas2js] mighty milestone: self compiling pas2js
Michael Van Canneyt
michael at freepascal.org
Sun Nov 4 09:23:57 CET 2018
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.
More information about the Pas2js
mailing list