[Lazarus] Freepascal for web

Michael Van Canneyt michael at freepascal.org
Sat Sep 25 13:05:14 CEST 2021



On Sat, 25 Sep 2021, Santiago A. via lazarus wrote:

> Not sure if this question should go for fpc-freepascal list or 
> fpc-others list.
>
> I'm starting a new project, a simple accounting system, with the data in 
> a server in internet. It is an experimental pet project, just to try new 
> technologies (new for me). Although it is just an experimental pet 
> project, I want to use technologies that allow to scale in the web.
>
> I don't want to do it in PHP (I got enough of it years ago), so I want 
> to consider a more advanced language.
> First, I thought about something with a python backend, but I've read 
> that it doesn't scale well because it doesn't support multithreads.
>
> I am almost decided to node.js in the backend and vue.js in the 
> frontend. Node.js is what almost everybody uses and has a lot of 
> libraries/modules and future. And vue.js looks powerful and simple with 
> a nice learning curve.
>
> But I'm not still happy. Why can't I use a native compiled program for 
> the backend?, it should faster, and more robust that any script, 
> dynamic, JIT language. Pascal for this is my first thought as it was my 
> first love. I'm thinking about a freepascal backendĀ  and vue.js frontend 
> , or even a three-tier with json messages between frontend in vue.js and 
> server.
>
> Have you any experience in freepascal for web?


I've been doing FPC back-ends for 12 years now. 
This is not a problem, everything is available.

The question is: what do you need ?

FPC has RPC-JSON for RPC mechanisms. You have SQLDBRestbridge to create a
REST backend on top of SQLDB. It can be used as-is, no code required for
simple cases.

FCL-Web allows you to write a service as a standalone executable, fastcgi,
cgi, apache module. You have advanced routing.

There is also the 'Brook' framework written on top of fcl-web. 
I'm not sure how well it is maintained.

And you can use pascal client-side as well.

Since 2 years I also do the front-end in pascal: pas2js allows you to write
your client-side logic in pascal as well. I have several sites running like
this for our clients. There is a series of components available.

If all goes well, we expect to have design-time functionality in the Lazarus 
IDE to create web-applications that render, design and run in the browser 
within a year (fingers crossed) - using the abovementioned components.

Michael.


More information about the lazarus mailing list