[fpc-devel] First pas2js public release

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Dec 20 10:36:03 CET 2017


On Tue, 19 Dec 2017 09:40:48 +0000
Lukasz Sokol <el.es.cr at gmail.com> wrote:

>[...]
> pas2js treated program would run in a browser, client side only ?
> And does not care what the server is, because it does not run on server ?

Yes, in fact it does not need a server. A browser only needs some
HTML and the pas2js generated js, which could be on your local disk.
See here:
http://wiki.freepascal.org/pas2js#for_the_browser

Note that with Node.js you can run pas2js programs on the server too.

 
> For 'server' side you then write 'as usual' e.g. cgi or other way available
> (server-native binary)
> 
> (Nothing stops really the server-side-native binary (e.g. written in Pascal)
>  from sending a pas2js transpiled program to the browser as a part of a 'html page'/script,
>  but the line of separation is pretty clear here : this is like doing Graeme's favorite GUI to non-gui portion separation ';) 
>  but still YOU are doing the separation manually - you need to write BOTH portions separately)
> 
> For communication between the browser end and the server end, there are ways covered 
> (AJAX ?) not much different than the usual (js in browser <-> java/php/perl/python/server side js in server) LAMP stack does.

Yes, see the demoxhr.lpr example in:
https://svn.freepascal.org/svn/projects/pas2js/trunk/demo/rtl/


Mattias



More information about the fpc-devel mailing list