Recent

Author Topic: PascalRAL the fastest, most feature-rich http component suite for Pascal  (Read 792 times)

Mobius1

  • New Member
  • *
  • Posts: 15
hi everyone!
I wanna share with you the best http framework for Pascal! (Delphi, Lazarus and others)

https://github.com/OpenSourceCommunityBrasil/PascalRAL

There's also a dedicated sample repository with lots of examples:
https://github.com/OpenSourceCommunityBrasil/PascalRAL-Samples

This is a quick simple example of a working webserver:

Code: Pascal  [Select][+][-]
  1. program RALWebExample;
  2.  
  3. uses
  4.   Classes, SysUtils, System.IOUtils,
  5.  
  6.   // Choose here the engine of the server
  7.   RALSynopseServer,
  8.   //RALIndyServer,
  9.   //RALSaguiServer,
  10.  
  11.   RALServer, RALWebModule,
  12.  
  13.   // routing unit
  14.   Web.Routes in 'src/web.routes.pas';
  15.  
  16. var
  17.   FServer: TRALServer;
  18.   FWebModule: TRALWebModule;
  19. begin
  20.   // Change the engine of the server here:
  21.   FServer := TRALSynopseServer.Create(nil);
  22.   //FServer := TRALIndyServer.Create(nil);
  23.   //FServer := TRALSaguiServer.Create(nil);
  24.  
  25.   FWebModule := TRALWebModule.Create(nil);
  26.   try
  27.     FWebModule.Server := FServer;
  28.     {
  29.     Defining the root path where the webfiles should be stored. We use TPath.Combine
  30.     here for easy compatibility between Windows and Linux servers, since Windows
  31.     uses '/' for folders and Linux uses '\'. It's easy to mix those so TPath solves
  32.     that
  33.     }
  34.     FWebModule.DocumentRoot := TPath.Combine(ExtractFileDir(ParamStr(0)), 'web');
  35.  
  36.     // adding routes to the server from unit Web.Routes:
  37.     RegisterWebRoutes(FWebModule);
  38.  
  39.     FServer.Port := 8000; // 8000 is the default port if none is assigned.
  40.     FServer.Start;
  41.  
  42.     WriteLn('RALServer running on Port ' + FServer.Port.ToString);
  43.     WriteLn('Press any key to finish');
  44.     ReadLn;
  45.   finally
  46.     FServer.Stop;
  47.     FreeAndNil(FWebModule);
  48.     FreeAndNil(FServer);
  49.   end;
  50. end.

We aimed for speed, simplicity and flexibility in this project as well as being independent of any specific http component, like indy. We also support RAD and DBWare in the project with plans on improving the speed in future updates.

The framework has been in development for 3 years but only last year that we managed to make it stable and resilient enough to be publicly available. It's currently in release candidate  and we'll launch the first stable version before adding even more features.

Since practically every HTTP framework out there is depedant on indy and are slow as a slime because indy is slow, we aim to kill that handicap and use the fastest possible data engines available to make Pascal API servers as competent as other languages' server frameworks.

We also added support to FPC-Unleashed, currently available under the "dev" branch.

We look forward to hear your feedback, any issues can be reported in the repository and we welcome any PRs with improvements to the code.
I'll answer any questions or doubts you might have too, just lemme know.
« Last Edit: June 29, 2026, 01:18:38 am by Mobius1 »

440bx

  • Hero Member
  • *****
  • Posts: 6578
Re: PascalRAL the fastest, most feature-rich component suite for Pascal
« Reply #1 on: June 26, 2026, 03:09:57 am »
Looks like a solid step in the right direction. :)

Thank you for all the hard work and for sharing it.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Mobius1

  • New Member
  • *
  • Posts: 15
PascalRAL has launched its first stable release version!
Thank you all for contributing with us this far, we expect more insights in the future to keep this framework the best possible one for Pascal, and all its IDEs like Delphi, Lazarus, Oxygene, PascalABC and future ones.

New versions are scheduled to be release once the new features are implemented, we intend to implement a new optimization refactoring in the next version of the framework, along with a few changes in the core units to try to reduce complexity making it 60% faster on best case scenario hopefully.

Keep your feedback comming, we welcome them all!

LemonParty

  • Hero Member
  • *****
  • Posts: 618
How do you acheived more speed?
What technic was used?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

Mobius1

  • New Member
  • *
  • Posts: 15
Not using Indy only like every other framework out there was one thing, fine tuning the engine internally was another thing but there are some slowness still that we gonna solve in the next updates to make it even better.

 

TinyPortal © 2005-2018