Pas2js Transpiler

Compiling pascal into javascript

Sun, 15 Sep 2019

As good as pascal has been over the years, it has had one major flaw. It simply cannot be used to write web applications that are as good looking and efficient as web applications written in JavaScript libraries like React etc. There has been some attempts to address this limitation over the years, one of them being the Pas2js Transpiler. It transpiles Pascal code directly into JavaScript that can be executed on browsers.

One of the Pas2js demo’s called fcldb reads data from json files and displays them in a grid. Below is some of the code used in the demo …

When the pascal is compiled into javascript, the end result is a 443.7 Kb javascript file, that you can run from here. Its certainly seems fast enough but the size of the resulting javascript file is a worry.

Conclusion

Although the Pas2js Transpiler allows pascal programmers to write applications for the web. The concept seems flawed in my opinion. The web environment itself is perhaps more difficult to learn than the javascript programming language. Pas2js really doesn’t address that difficulty. If one must use pascal to write web applications then something like uniGUI Web Application Framework might be a better solution. It creates an atmosphere in which the web environment appears moreso like a desktop environment. That will be more familar to pascal developers.