[fpc-devel] First pas2js public release
Michael Van Canneyt
michael at freepascal.org
Fri Dec 22 09:05:34 CET 2017
On Thu, 21 Dec 2017, Michael Schnell wrote:
> On 21.12.2017 08:52, Michael Van Canneyt wrote:
>>
>> because I consider it a misguided approach,
> Could you elaborate why you think so ?
Because it will only work for simple scenarios. As soon as things become
moderately complex, this approach fails, as you will need to do the
communication manually. That is why I think approaches as
extpascal, extgui and - in its days - intraweb are failures.
>
> What I have in mind is:
>
> - Do a common project for both "business" and the "GUI near" code.
> - The IDE provides some means to define which parts of the codes are
> to go where (in an Object Pascal system supposedly based on classes).
The IDE may try to decide this for a 'simple' hello world, but for a general
application, this is simply impossible.
What's more, most applications I have seen mix business and GUI code -
exacerbated by RAD, of course - making this separation impossible.
By forcing people to clearly separate client and browser, this split between
business code and GUI code is automatic.
> - With that, interfaces are provided for the communication (e.g.
> procedure calls; in an Object Pascal system supposedly class based
> procedures, properties and events).
Creating a huge overhead in the process:
The browser communication is done asynchronously.
The code needed to make it look like your code runs synchronously will
simply block the browser.
> - The IDE compiles the code appropriately with acknowledging separates
> definitions for both parts to be runnable where.
> - The communication between the parts is implemented accordingly: if
> it's a "local" GUI, just a normal executable is created, if the GUI is
> Browser based: this part is implemented with pas2js, and the loading and
> communication is implemented accordingly (if the main part is stand
> alone, including a built-in web server, if the main part is to be run
> behind a web server doing it as a cgi).
>
> I do see that this is unlikely to happen, but IMHO just because lack of
> dev time, not because of bad concept.
Well, we clearly disagree. I do think it is a really bad concept, and of
course then I will not spend dev time on it :)
Michael.
More information about the fpc-devel
mailing list