Forum > Pas2JS

Pas2JS for the masses

(1/4) > >>

Leledumbo:
I've been playing around with Pas2JS in the last couple of weeks. Glad to see it come out as a wonderful tool. However, I don't find its usage any straightforward. FYI, I'm on Linux.

The most cumbersome problem is the packaging. Starting from the wiki article, I download a precompiled snapshot from the ftp to get the compiler binary, compileserver a.k.a. simpleserver, webidl2pas and libpas2js.so. There are various demos and packages ready to use. However, contrary to the wiki article, which says:

--- Quote ---As for the FPC compiler, a configuration file is supported, which has the same syntax as the FPC config file. Note that the snapshots and svn version already contains a default pas2js.cfg with unit search paths (-Fu) for the rtl and fcl.
--- End quote ---
There's no pas2js.cfg in the distributed snapshot. Digging in pas2js in my fpc source code, I do find one, so I just copy it to the bin directory of the snapshot. Analyzing the content, though, it seems to be designed to be used inside its directory in fpc source code, so I have to adjust some of the paths to reflect the snapshot hierarchy. During that process, there's a line that says:

--- Quote ----Fu$CfgDir/dist
--- End quote ---
that points to a non-existing dir dist. Again browsing fpc source code, it's found and contains a single rtl.js file, which is referenced in the wiki article but not mentioned elsewhere where to get it. Again I copy the dir to bin to match that -Fu line (because my pas2js.cfg is in the bin directory) and trying out the hello world example (from the wiki article) only to find out that it refers to rtl.run(); without ever referencing rtl.js (I thought -Jc option will do, but it doesn't as the first line starts with rtl.module, where rtl is an unknown object. With that fixed, finally the example works.

That experience is certainly not friendly at all, I can go through it just because I'm quite experienced in using fpc and I have good enough sense of exploration. For anyone else coming to try, it will be a showstopper. I don't think I want to put above steps into my tutorial, I'd rather wait for the packaging to be user friendly first.

P.S.:
It's unclear to me how the snapshot was generated, a make install in the pas2js directory only installs the binaries and seemingly useless lib directory, no packages, no demos, dist directory and pas2js.cfg excluded.

lainz:
install it with fpcupdeluxe and it just works

Ñuño_Martínez:
I agree with Leledumbo here.  Pas2js documentation is confusing, specially in the installation and configuration parts.  I've never be able to make it run, and I tried different versions and times (and complained about it in this forums IIRC).

Didn't knew about fpcupdeluxe.  That needs more detailed information (here and in the documentation).

Leledumbo:

--- Quote from: lainz on December 23, 2018, 10:08:59 pm ---install it with fpcupdeluxe and it just works

--- End quote ---
I don't even know it can be installed that way, really the documentation and/or packaging need an improvement.

Thaddy:

--- Quote from: Leledumbo on December 24, 2018, 11:49:48 am ---
--- Quote from: lainz on December 23, 2018, 10:08:59 pm ---install it with fpcupdeluxe and it just works

--- End quote ---
I don't even know it can be installed that way, really the documentation and/or packaging need an improvement.

--- End quote ---
I agree with that. At the moment only experienced people can install and use it without too many problems. Fpcdeluxe doesn't help too much, btw. Paths are missing as you already observed.
OTOH it is being worked on and it is nice technology. It will mature over time.

Navigation

[0] Message Index

[#] Next page

Go to full version