[Lazarus] Quick Video: A Web Application

Michael Schnell mschnell at lumino.de
Wed Nov 8 12:08:13 CET 2017


On 08.11.2017 11:14, Mattias Gaertner via Lazarus wrote:
> A server is not needed. You can write standalone browser applications that work offline too.
OK. Great !  Stand alone browser based applications might be one 
desirable type of application, but AFAIK, the more commonly required 
type of application would be server based.

> Sigh. Michael, sometimes I got the impression you are stuck in a loop. 
> Use TFPTimer and TThread. 
You might be right :-)
But it's not just me, but it's based on the Lazarus claim "write once, 
compile everywhere" which means that I can design and test an 
application in - say - Windows (using the "RAD"-way that once has been 
introduced by (Borland-) Delphi, and then tell Lazarus to create a 
server application with a browser GUI by just compiling  my code. In a 
perfect world this should simply work, in a less perfect world, some 
tweaks might be necessary to optimize the thing for either platform to 
run on.

>>    - Communication between the Server application and the part running on the brower via a 3rd party web server.
> There are various ways since years.
I do know. Some are depreciated, I feel at the moment WebSocktes is the 
way to go.
But see above: the Lazarus user should not even see this, but the 
infrastructure would organize the communication in a (as good as 
possible) compatible way, by just telling Lazarus to compile the 
application as a server based application with a browser based GUI 
accessible via a web-server.

>>    - allowing for decent Debugging in Lazarus (e.g. via an optional built-in web server, which AFAIK already is in place) .
> Server debugging is already possible. But I agree, it could be easier.
> Client side debugging is working. You can use the browser's debugger to set breakpoints in the Pascal code and step through.
I suppose you are talking about pas2js, running in a Browser, which is 
perfectly viable, of course.

What I meant was debugging the server based part of the application 
(which accesses an attached GUI part done in pas2js. Here (AFAIK) a 
webserver unit that allows for attaching to a browser to display the GUI 
while the application (i.e. the "business code") runs under Lazarus, 
already is provided. so I don't assume any problems here. (While in 
Delphi AFAIK, this is  a major problem).

>>    - Lazarus providing a GUI builder for the browser based GUI.
> That's a big topic. Some parts already work.
As I already did some research om that (some time ago) I do know that is 
is a big topic :) . That is why I ask. Great to hear that it is worked 
on and something already is functional.
>> Moreover IMHO a migration path from Java script in the Browser (pas2js)
>> to using WebAssembly in the Browser should be considered.
> It has been started in FPC, but no one is working on that.

So same state as since quite a while. Regarding that most decent 
browsers nowadays provide the WebAssembly framework, it seems viable to 
ask, but of course developing time is limited.

-Michael


More information about the Lazarus mailing list