Bottomline easy answer, if you want to use current released version: Build v2.0.6 from source yourself. Ignore what comes with FPC.This is actually not an answer at all, it just reinforces the question. My FPC installation (main branch) comes with Pas2JS Compiler version 2.1.1 [2021/10/24] for Linux x86_64. Why this confusing redundancy? Why is an incomplete pas2js environment that cannot be used anyway because it is incomplete contained in the FPC install? is this a leftover? Or is it planned to move it all into FPC and the move is just not completed yet?
Bottomline easy answer, if you want to use current released version: Build v2.0.6 from source yourself. Ignore what comes with FPC.This is actually not an answer at all, it just reinforces the question. My FPC installation (main branch) comes with Pas2JS Compiler version 2.1.1 [2021/10/24] for Linux x86_64.
If you are ok using pas2js 2.1.1, then you are all set.I cannot use it, it is missing the rtl or whatever, it complains about missing unit system.
pas2js is a Pascal transpiler written in Pascal, built using FPC. Once the transpiler is built, then just use it.
I cannot use it, it is missing the rtl or whatever, it complains about missing unit system.
$ ls -l /home/bernd/fpcupdeluxe/fpcsrc/utils/pas2js/dist
insgesamt 44
-rw-rw-r-- 1 bernd bernd 44214 Okt 20 17:36 rtl.js
$ ls -l /home/bernd/fpcupdeluxe/fpcsrc/packages/
insgesamt 4564
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 a52
drwxrwxr-x 1 bernd bernd 140 Okt 18 18:03 ami-extra
drwxrwxr-x 1 bernd bernd 182 Okt 18 18:03 amunits
drwxrwxr-x 1 bernd bernd 104 Okt 18 18:03 arosunits
drwxrwxr-x 1 bernd bernd 180 Okt 24 09:21 aspell
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 bfd
drwxrwxr-x 1 bernd bernd 154 Okt 24 09:21 bzip2
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 cairo
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 cdrom
drwxrwxr-x 1 bernd bernd 146 Okt 24 09:21 chm
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 cocoaint
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 dblib
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 dbus
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 dts
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 fastcgi
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 fcl-async
drwxrwxr-x 1 bernd bernd 150 Okt 24 09:21 fcl-base
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fcl-db
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 fcl-extra
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 fcl-fpcunit
drwxrwxr-x 1 bernd bernd 138 Okt 24 09:21 fcl-image
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 fcl-js
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fcl-json
drwxrwxr-x 1 bernd bernd 100 Okt 24 09:21 fcl-mustache
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 fcl-net
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fcl-passrc
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 fcl-pdf
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 fcl-process
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fcl-registry
drwxrwxr-x 1 bernd bernd 108 Okt 24 09:21 fcl-report
drwxrwxr-x 1 bernd bernd 120 Okt 24 09:21 fcl-res
drwxrwxr-x 1 bernd bernd 112 Okt 24 09:21 fcl-sdo
drwxrwxr-x 1 bernd bernd 84 Okt 24 09:21 fcl-sound
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 fcl-stl
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fcl-web
drwxrwxr-x 1 bernd bernd 198 Okt 24 09:21 fcl-xml
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 fftw
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 fpgtk
drwxrwxr-x 1 bernd bernd 110 Okt 24 09:21 fpindexer
-rwxrwxr-x 1 bernd bernd 1920160 Okt 24 09:20 fpmake
-rw-rw-r-- 1 bernd bernd 9886 Okt 18 18:03 fpmake_add.inc
-rw-rw-r-- 1 bernd bernd 2624416 Okt 24 09:20 fpmake.o
-rw-rw-r-- 1 bernd bernd 1777 Okt 18 18:03 fpmake.pp
-rw-rw-r-- 1 bernd bernd 15081 Okt 18 18:03 fpmake_proc.inc
drwxrwxr-x 1 bernd bernd 146 Okt 24 09:21 fpmkunit
drwxrwxr-x 1 bernd bernd 164 Okt 24 09:21 fppkg
drwxrwxr-x 1 bernd bernd 162 Okt 18 18:03 fuse
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 fv
drwxrwxr-x 1 bernd bernd 170 Okt 24 09:21 gdbint
drwxrwxr-x 1 bernd bernd 150 Okt 24 09:21 gdbm
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 ggi
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 gitlab
drwxrwxr-x 1 bernd bernd 142 Okt 24 09:21 gmp
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 gnome1
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 gnutls
drwxrwxr-x 1 bernd bernd 110 Okt 24 09:21 googleapi
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:19 graph
drwxrwxr-x 1 bernd bernd 150 Okt 24 09:21 gtk1
drwxrwxr-x 1 bernd bernd 176 Okt 24 09:21 gtk2
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 hash
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 hermes
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 httpd13
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 httpd20
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 httpd22
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 httpd24
drwxrwxr-x 1 bernd bernd 174 Okt 24 09:21 ibase
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 iconvenc
drwxrwxr-x 1 bernd bernd 2098 Okt 24 09:21 ide
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 imagemagick
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 imlib
drwxrwxr-x 1 bernd bernd 104 Okt 18 18:03 iosxlocale
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 jni
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 ldap
drwxrwxr-x 1 bernd bernd 164 Okt 18 18:03 libc
drwxrwxr-x 1 bernd bernd 100 Okt 24 09:21 libcups
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 libcurl
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libenet
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libffi
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libfontconfig
drwxrwxr-x 1 bernd bernd 128 Okt 18 18:03 libgbafpc
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libgc
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 libgd
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libmagic
drwxrwxr-x 1 bernd bernd 90 Okt 24 09:21 libmicrohttpd
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 libndsfpc
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 libogcfpc
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 libpng
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 librsvg
drwxrwxr-x 1 bernd bernd 150 Okt 24 09:21 libsee
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 libtar
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 libusb
drwxrwxr-x 1 bernd bernd 88 Okt 24 09:21 libvlc
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 libxml
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 lua
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 mad
-rw-rw-r-- 1 bernd bernd 48931 Okt 18 18:03 Makefile
-rw-rw-r-- 1 bernd bernd 6299 Okt 18 18:03 Makefile.fpc
-rw-rw-r-- 1 bernd bernd 34550 Aug 8 15:26 Makefile.fpc.fpcmake
drwxrwxr-x 1 bernd bernd 148 Okt 18 18:03 matroska
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 modplug
drwxrwxr-x 1 bernd bernd 104 Okt 18 18:03 morphunits
drwxrwxr-x 1 bernd bernd 174 Okt 24 09:21 mysql
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 ncurses
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 newt
drwxrwxr-x 1 bernd bernd 166 Okt 24 09:21 numlib
drwxrwxr-x 1 bernd bernd 120 Okt 24 09:19 nvapi
drwxrwxr-x 1 bernd bernd 120 Okt 18 18:03 objcrtl
drwxrwxr-x 1 bernd bernd 122 Okt 24 09:21 odata
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 odbc
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 oggvorbis
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 openal
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:19 opencl
drwxrwxr-x 1 bernd bernd 174 Okt 24 09:21 opengl
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 opengles
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 openssl
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 oracle
drwxrwxr-x 1 bernd bernd 150 Okt 18 18:03 os2units
drwxrwxr-x 1 bernd bernd 104 Okt 18 18:03 os4units
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 palmunits
drwxrwxr-x 1 bernd bernd 150 Okt 24 09:21 pasjpeg
drwxrwxr-x 1 bernd bernd 84 Okt 24 09:21 pastojs
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 paszlib
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 pcap
drwxrwxr-x 1 bernd bernd 174 Okt 24 09:21 postgres
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 proj4
drwxrwxr-x 1 bernd bernd 148 Okt 24 09:21 ptc
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 pthreads
drwxrwxr-x 1 bernd bernd 130 Okt 24 09:21 pxlib
drwxrwxr-x 1 bernd bernd 110 Okt 18 18:03 qlunits
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 regexpr
drwxrwxr-x 1 bernd bernd 150 Okt 18 18:03 rexx
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 rtl-console
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:21 rtl-extra
drwxrwxr-x 1 bernd bernd 120 Okt 24 09:21 rtl-generics
drwxrwxr-x 1 bernd bernd 124 Okt 24 09:21 rtl-objpas
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 rtl-unicode
drwxrwxr-x 1 bernd bernd 202 Okt 24 09:21 sdl
drwxrwxr-x 1 bernd bernd 182 Okt 18 18:03 sndfile
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 sqlite
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 svgalib
drwxrwxr-x 1 bernd bernd 136 Okt 24 09:21 symbolic
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 syslog
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 tcl
drwxrwxr-x 1 bernd bernd 100 Okt 18 18:03 tosunits
drwxrwxr-x 1 bernd bernd 74 Okt 24 09:21 tplylib
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 univint
drwxrwxr-x 1 bernd bernd 130 Okt 18 18:03 unixutil
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 unzip
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 users
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 utmp
drwxrwxr-x 1 bernd bernd 160 Okt 24 09:21 uuid
drwxrwxr-x 1 bernd bernd 84 Okt 24 09:21 vcl-compat
drwxrwxr-x 1 bernd bernd 100 Okt 24 09:21 webidl
drwxrwxr-x 1 bernd bernd 104 Okt 18 18:03 winceunits
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:19 winunits-base
drwxrwxr-x 1 bernd bernd 114 Okt 24 09:19 winunits-jedi
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 x11
drwxrwxr-x 1 bernd bernd 190 Okt 24 09:21 xforms
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 zlib
drwxrwxr-x 1 bernd bernd 140 Okt 24 09:21 zorba
Where is the folder that contains the unit system?
% ls -l ~/pkg/pas2js/packages/rtl/system.pas
-rw-r--r-- 1 pierce pierce 30128 Jul 5 13:45 /home/pierce/pkg/pas2js/packages/rtl/system.pas
If you say that the pas2js installation that came along with your FPC installation is complete and working then maybe you can tell me the location of that unit, so I can add it to the -Fu path?
% ls -l
total 1392
drwxr-xr-x 3 pierce pierce 4096 Jul 5 13:46 bin/
drwxr-xr-x 4 pierce pierce 4096 Jul 5 13:45 compiler/
drwxr-xr-x 36 pierce pierce 4096 Jul 5 13:45 demo/
-rwxr-xr-x 1 pierce pierce 1250088 Jul 5 13:46 fpmake*
-rw-r--r-- 1 pierce pierce 60728 Jul 5 13:46 fpmake.o
-rw-r--r-- 1 pierce pierce 8794 Jul 5 13:45 fpmake.pp
-rw-r--r-- 1 pierce pierce 42969 Jul 5 13:45 Makefile
-rw-r--r-- 1 pierce pierce 7095 Jul 5 13:45 Makefile.fpc
drwxr-xr-x 21 pierce pierce 4096 Jul 5 13:45 packages/ <====== These are pas2js packages. RTL including system.pas is here.
-rw-r--r-- 1 pierce pierce 184 Jul 5 13:46 pas2js-x86_64-linux.fpm
-rw-r--r-- 1 pierce pierce 2052 Jul 5 13:45 README.txt
drwxr-xr-x 2 pierce pierce 4096 Jul 5 13:45 scripts/
drwxr-xr-x 2 pierce pierce 4096 Jul 5 13:45 test/
drwxr-xr-x 3 pierce pierce 4096 Jul 5 13:45 tools/
drwxr-xr-x 3 pierce pierce 4096 Jul 5 13:46 units/
drwxr-xr-x 2 pierce pierce 4096 Jul 5 13:45 utils/
- Which are the different parts of pas2JS and how are they related to each other?
- Can anybody please give a detailed architectural top-down overview of all the parts that belong to it, how they play together, etc?
- I did not ask "what" or "how", I asked "why". Because I am trying to understand!
- Is here anybody who can actually answer this question?
On Mon Nov 1 2021, Michael Van Canneyt wrote:
On Sun, 31 Oct 2021, Wayne Sherman wrote:
> There are currently two development trees for pas2js:
>
> Source Tree "fpc/pas2js":
> https://gitlab.com/freepascal.org/fpc/pas2js
This tree contains the pas2js RTL and packages.
It contains the below tree as a submodule, however we're thinking to remove
that. Git submodules are a little awkward to work with - to say the least.
>
> Source Tree "fpc/source"
> https://gitlab.com/freepascal.org/fpc/source/-/tree/main/utils/pas2js
> https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/pastojs
This tree contains the compiler sources. They are part of Free Pascal:
the scanner/parser/AST is also used in the documentation generator of FPC.
>
> With respect to pas2js, these source trees have different directory
> structures. Some pas2js files in one tree do not exist in the other.
> In some cases, pas2js files within these trees have the same name, but
> have different changes and commit histories.
Some of the pas2js rtl/package units have a history in FPC, they have been
ported to pas2JS.
>
> I have been considering creating a pas2js "how-to" installation walk
> thru for Linux. I am trying to decide which tree to use, or if I
> should show both trees and explain why to use one tree or the other
> depending on the intent.
You will always need both trees.
>
> Some questions please:
> 1) How are these two pas2js trees related and what is the intent of each tree?
See above.
> 2) Which tree receives new pas2js features first?
The compiler features always go to the "fpc/source" tree.
RTL/Package features always go to the "fpc/pas2js" tree.
> 3) Is the intent to unify these into a single tree at some point?
No.
Although that was my original intent, but
a) the rtl/packages differ too much.
b) the FPC team itself prefers to keep things separate, so it will remain separate.
Michael.