[Pas2js] PAS2JS design add on for Lazarus
Michael Van Canneyt
michael at freepascal.org
Sun Mar 18 19:22:35 CET 2018
On Sun, 18 Mar 2018, Stephen Wright via Pas2js wrote:
> Hi Mattias As you suggested last week, I have tried to add the Pas2JS
> design add on “components/pas2js/pas2jsdsgn.lpk” into Lazarus. I did this
> after running FPCUpDelux to install the trunk versions of FPC and Lazarus
> as well as after downloading the RTL package from
> https://svn.freepascal.org/svn/projects/pas2js/trunk as recommended in the
> Pas2JS wiki. The package “pas2jsdsgn” compiles and installs but when I
> create a 'Web Browser Application' project this will not compile unless
> the package pas2js_rtl is downloaded . After this is done, the RTL
> package will not compile without asking for “Pas2JS.exe”.
Set the path to your pas2js executable in the tools|Options dialog of the
IDE, section 'Environment|Pas2js' path.
> We have placed
> a version of “Pas2JS.exe” in the project folder but it is not clear if
> this is the specific version needed. Having done this, the project still
> will not compile (Fatal: Compilation aborted) so we have not been able to
> use this option to explore your latest demos.
You will probably need a pas2js.cfg file that points to the correct source
directories for rtl and other packages. You should put this next to the
pas2js binary.
This is the contents of my pas2js.cfg:
-Fu/home/michael/projects/pas2js/packages/rtl
-Fu/home/michael/projects/pas2js/packages/*
>ny suggestions on how to
>A get this working?
> As I was stuck on “Plan A” I tried plan B which is to
> directly include the PAS2JSCompiler, Pas2jsLogger, and Pas2jsFileUtils,
> units in a test program of my own. This happily compiles, runs and
> transpiles a “hello world” program. However when I then added
> “PAS2JSCompiler” to the uses clause of the Hello world program in order to
> see if it is possible to build a Javascript version of Pas2JS
No, it is not yet possible. This is on our todo list :)
> I got a
> memory access error which I cannot debug, probably relating to reading
> incompatible units? I guess going straight from “hello world” to
> expecting the transpiler to transpile itself is a big jump.
Yes. You need to get some form of streams working.
As said, this is on our todo list.
Michael.
More information about the Pas2js
mailing list