Creating FPC enabled websites

classic Classic list List threaded Threaded
47 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Creating FPC enabled websites

Francisco Reyes-2
Any recommendations on which library to use to create web enabled FPC apps?

Have found a few libraries and wonder if anyone has had good success with
any of these or otheres.

So far I found
embeddable webserver
http://www.eilers.net/pascal
Site doesn't have much info


Synapse
http://www.ararat.cz/synapse/doku.php
Seems very low level.

Powtils
http://z505.com/powtils/idx.shtml
This one has a number of examples and seems the most promissing.


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Marco van de Voort
In our previous episode, Francisco Reyes said:
> Have found a few libraries and wonder if anyone has had good success with
> any of these or otheres.

In the past I've had an Indy9 httpserver + ssl running. That was under
Delphi, but parts of that I also had running (with indy10) under
FreeBSD/32-bit.
 
It was based on the eliza example iirc.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Francisco Reyes-2
Marco van de Voort writes:

> It was based on the eliza example iirc.

URL/source?

Is the easiest way to go using FPC + apache with CGI?

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Marco van de Voort
In our previous episode, Francisco Reyes said:
> > It was based on the eliza example iirc.
>
> URL/source?

http://www.indyproject.org there is stuff about indy in the wiki too.
 
> Is the easiest way to go using FPC + apache with CGI?

Depends. For me that was not the easiest way, since the web part was only a
minor part added to an existing application (an extra presentation layer so
to speak), so I just added a HTTP server component.

It worked fine, but access was limited, so abuse/DDOS didn't have much
chance.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Travis Siegel
In reply to this post by Francisco Reyes-2
Not fpc related, but irie pascal (http://www.irietools.com) has a  
pascal that is cross platform, and does handle web support quite well.
My attempts to get him to support osx has fallen flat, but dos,  
windows, bsd, solaris (I think) and other distributions are supported,  
so it may do what you want.
If something like irie pascal could be built using fpc though, it  
would be a great help, since I'd really like to build some web apps,  
but w/o irie for osx, it puts a serious crimp in my ability to make  
cross-platform apps.
Fpc is cross platform I know, but as far as I know, it's not optomized  
for cgi execution like irie pascal is.
I suppose I could build a stripped-down version of fpc specifically  
for cgi-type work, if anyone is interested in such, but i like the  
approach irie took in that you could use the same compiled source on  
any of it's supported platforms.
I've thought about cloning irie pascal virtual machines and writing  
that in fpc, but I don't know if i want to do that much work just to  
get something that out to be simple to create if Mr.Stewart would pull  
his head out of his nether regions and allow somebody to make anyhow.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

princeriley
Travis,

I am joining this discussion fairly late so if you've found your solution already please ignore this post.

First, upon reading you feel Irie Pascal is 'optimized' for CGI execution on OSX (Leopard?) my first question is how are you defining that. I've looked over the Irie code just now (using the trial version) and I compared it to the Indy 9 component. So far I don't see anything that would suggest Irie's CGI could handle HTML requests any faster or handle larger loads better that the Indy components. Could you explain in a bit more detail what are you using as the baseline for your comparisons?

Next, could you also be a bit more specific if you are trying to write CGI components for an embedded web server or do you expect to run them under an standalone web server (like Apache)? Again just for the sake of understanding what options to recommend to you, the choices you outlined in your links all appear to be fairly common, ordinary web server add-ons that really rely more on what the CGI tolls calls (external process or a daemon) than something more exotic (like a DB server or transaction-based gateway).

Finally, give the advance from CGI based web apps to Web 2.0 (Javascript running in the browser) is there a design rational for running code on the server instead of in the web browser. If you want to see a few examples of this kind of web app check out Google Gears. Its just one of several web app frameworks that have become more stable and production ready in the past few years. Zend (which is PHP, not Javascript) is also an alternative.


On Mon, Mar 2, 2009 at 12:06 PM, Travis Siegel <[hidden email]> wrote:
Not fpc related, but irie pascal (http://www.irietools.com) has a pascal that is cross platform, and does handle web support quite well.
My attempts to get him to support osx has fallen flat, but dos, windows, bsd, solaris (I think) and other distributions are supported, so it may do what you want.
If something like irie pascal could be built using fpc though, it would be a great help, since I'd really like to build some web apps, but w/o irie for osx, it puts a serious crimp in my ability to make cross-platform apps.
Fpc is cross platform I know, but as far as I know, it's not optomized for cgi execution like irie pascal is.
I suppose I could build a stripped-down version of fpc specifically for cgi-type work, if anyone is interested in such, but i like the approach irie took in that you could use the same compiled source on any of it's supported platforms.
I've thought about cloning irie pascal virtual machines and writing that in fpc, but I don't know if i want to do that much work just to get something that out to be simple to create if Mr.Stewart would pull his head out of his nether regions and allow somebody to make anyhow.


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Marco van de Voort
In reply to this post by Travis Siegel
In our previous episode, Travis Siegel said:
> Fpc is cross platform I know, but as far as I know, it's not optomized  
> for cgi execution like irie pascal is.

Interesting. Could you share your evaluation/comparison details? Maybe the
people working on fpweb could learn something from it.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Mark Emerson
What is fpweb?

On Monday 02 March 2009 12:37:36 pm Marco van de Voort wrote:

> In our previous episode, Travis Siegel said:
> > Fpc is cross platform I know, but as far as I know, it's not optomized
> > for cgi execution like irie pascal is.
>
> Interesting. Could you share your evaluation/comparison details? Maybe the
> people working on fpweb could learn something from it.
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Marco van de Voort
In our previous episode, Mark Emerson said:
> What is fpweb?

Sorry, old name, nowadays it is fcl-web. See packages/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Francisco Reyes-2
In reply to this post by Travis Siegel
Travis Siegel writes:

> Not fpc related, but irie pascal (http://www.irietools.com) has a  
> pascal that is cross platform, and does handle web support quite well.

No Postgresql support listed... still seems pretty interesting.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Francisco Reyes-2
In reply to this post by princeriley
Prince Riley writes:

> Finally, give the advance from CGI based web apps to Web 2.0 (Javascript
> running in the browser) is there a design rational for running code on the
> server instead of in the web browser.

I think that is almost a religious war type of discussion...
Short answer (as it applies to me at least) If all I am doing is getting
data from a DB and displaying it in the browser, there is little reason to
do Javascript.

> past few years. Zend (which is PHP, not Javascript) is also an
> alternative.

Personally my preference would be
1- Pascal
2- Python
3- PHP

PHP can do absolutely everything I need/want; the difference is that I want
something which lends itself more easily to well organized and structured
coding. Also When I work on php it always feels like work.. even if it
something I am doing for fun. It is one of those subjective things... the
reason why there are so many languages and tools out there.  
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Francisco Reyes-2
In reply to this post by Marco van de Voort
Marco van de Voort writes:

> Sorry, old name, nowadays it is fcl-web. See packages/

Don't see it at
http://www.freepascal.org/packages

Is there where I should look?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Marco van de Voort
In our previous episode, Francisco Reyes said:
> Marco van de Voort writes:
>
> > Sorry, old name, nowadays it is fcl-web. See packages/
>
> Don't see it at
> http://www.freepascal.org/packages
 
> Is there where I should look?

In the source.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Andreas Berger
I'm interested to know why no one mentioned powtils yet (other than the
original poster). I also am looking into writing a fairly complex CGI
program and powtils seems very promising. And comments?

Marco van de Voort wrote:

> In our previous episode, Francisco Reyes said:
>  
>> Marco van de Voort writes:
>>
>>    
>>> Sorry, old name, nowadays it is fcl-web. See packages/
>>>      
>> Don't see it at
>> http://www.freepascal.org/packages
>>    
>  
>  
>> Is there where I should look?
>>    
>
> In the source.
>  

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Bee Jay-2
In reply to this post by Francisco Reyes-2
So far I found
embeddable webserver
http://www.eilers.net/pascal
Site doesn't have much info

Never use custom embedded web server though it's not hard to build one.
 
Synapse
http://www.ararat.cz/synapse/doku.php
Seems very low level.

It looks more a TCP/IP suite classes to me.

Powtils
http://z505.com/powtils/idx.shtml
This one has a number of examples and seems the most promissing.

This a pascal CGI unit.

Despite Powtils looks quite mature, especially the v1.6, the development is halted. It stopped at v.1.7 which IMO not too stable. I've been using it and produced some fairly complex CGI-based web apps. It does the job very well.

Another alternative is ExtPascal project (http://extpascal.googlecode.com). It offers a FCGI class and wrap ExtJS into Pascal language. You may build a RIA using it. I've been playing around with it for a while and already built an application based on it in production. So far, it performs very well.

-- 
-Bee-

has Bee.ography at:
http://beeography.wordpress.com


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Bee Jay-2
In reply to this post by Travis Siegel
Not fpc related, but irie pascal (http://www.irietools.com) has a pascal that is cross platform, and does handle web support quite well.

It's more or less similar to Powtils. I don't see any good reasons to use it while there are many CGI units available for FPC. Using Powtils, you don't need to worry about database support since FPC had support for almost any common databases out there. You don't need to worry about platform support either since FPC run on almost any common platforms out there. Plus, you get them all for free.
 
If something like irie pascal could be built using fpc though, it would be a great help, since I'd really like to build some web apps, but w/o irie for osx, it puts a serious crimp in my ability to make cross-platform apps.

FPC offers lot more. You want pascal scripting? You may use Pascal Script from RemObject. You want database support? You may use fcl-db (sql-db) or Zeos. You want CGI units? There are many, the most famous is Powtils. Etc. Plus, you can share your code with desktop application or may re-use code from your legacy desktop into a web based app without or with minor modifications.
 
Fpc is cross platform I know, but as far as I know, it's not optomized for cgi execution like irie pascal is.

Define "optimized for CGI execution". Most CGI units are just a handler for web requests that come from web server. Not much optimization you can do there. If you want more robust performance, go to FastCGI. FPC also has one for this: FCGI class from ExtPascal project.
 
I suppose I could build a stripped-down version of fpc specifically for cgi-type work, if anyone is interested in such, but i like the approach irie took in that you could use the same compiled source on any of it's supported platforms.

FPC is a general purpose compiler. What you need is a CGI or web framework that can be compiled by FPC. You don't need to do anything particular to FPC.


-Bee-

has Bee.ography at:
http://beeography.wordpress.com


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Graeme Geldenhuys-2
In reply to this post by Francisco Reyes-2
On Mon, Mar 2, 2009 at 6:48 PM, Francisco Reyes <[hidden email]> wrote:
> Any recommendations on which library to use to create web enabled FPC apps?

We have 4 applications in our company based on FPC + Powtils to
generate standard CGI apps and so far it's working very well. Powtils
also has some nice features like templates etc - though we don't use
it in our projects yet. Other that the Powtils/PSP/??? name changes
and finding a stable download, we have had no problems with it.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Graeme Geldenhuys-2
In reply to this post by Andreas Berger
On Tue, Mar 3, 2009 at 2:55 AM, Andreas Berger
<[hidden email]> wrote:
> I'm interested to know why no one mentioned powtils yet (other than the
> original poster).

I might be a bit late, but I just gave some comments on Powtils. :-)

> I also am looking into writing a fairly complex CGI
> program and powtils seems very promising. And comments?

Our CGI apps are also fairly complex and even uses tiOPF framework,
which is what our main GUI applications are based on. As I mentioned,
other than finding a stable download, we have had no issues with
Powtils.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

Joost van der Sluis
In reply to this post by Francisco Reyes-2
Op maandag 02-03-2009 om 16:20 uur [tijdzone -0500], schreef Francisco
Reyes:
> Marco van de Voort writes:
>
> > Sorry, old name, nowadays it is fcl-web. See packages/
>
> Don't see it at
> http://www.freepascal.org/packages
>
> Is there where I should look?

It's part of the fcl, in Lazarus you can find and install it.

In this thread on the lazarus-forum I gave a simple introduction and you
can find more information there:
http://forum.lazarus.freepascal.org/index.php/topic,6361.0.html

Joost


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Creating FPC enabled websites

princeriley
In reply to this post by Francisco Reyes-2
Since the discussion in this thread has advanced pretty far along toward recommending a FP and Powtils solution to you, then it appears you have a technical answer from the group you can explore.

However, without suggesting there is a bias in favor of a specific client-centric vs server-centric web framework, the REST protocol has succeeded in becoming a paradigm for writing web (client sever) apps.

Primarily the reason why is -- especially for DB web applications -- is efficiency, maintainability, and scalability. The recent major efforts by Mozilla, Google, and others to improve the performance of browser Javascript engines is due to their experience designing, writing and running CGI based web applications. There is quite a bit of literature and discussion on the web explaining why they are using REST versus CGI (Request/Response)  which you might find helpful in making your design choices.

I have not worked with Powtils so I can't discuss whether or not it has the features your application needs, or what the costs of using it might be in terms of server processing load (Web server Request/Response), response time, DB transaction processing load, etc.  I also don't know whether it can be tweaked in some way to support the REST protocol for an application like yours.


On Mon, Mar 2, 2009 at 3:16 PM, Francisco Reyes <[hidden email]> wrote:
Prince Riley writes:

Finally, give the advance from CGI based web apps to Web 2.0 (Javascript running in the browser) is there a design rational for running code on the server instead of in the web browser.

I think that is almost a religious war type of discussion...
Short answer (as it applies to me at least) If all I am doing is getting data from a DB and displaying it in the browser, there is little reason to do Javascript.
past few years. Zend (which is PHP, not Javascript) is also an alternative.

Personally my preference would be
1- Pascal
2- Python
3- PHP

PHP can do absolutely everything I need/want; the difference is that I want something which lends itself more easily to well organized and structured coding. Also When I work on php it always feels like work.. even if it something I am doing for fun. It is one of those subjective things... the reason why there are so many languages and tools out there.  _______________________________________________


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
123