Servlet server for Fpc apps

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

Servlet server for Fpc apps

Eduardo Morras-3
Hello:

I want to ask (and know) if i can use apache-tomcat to serve servlets
developed with freepascal. If not, is there a similar server for fpc?
Note that i want/need servlet like in java and other languages, not a
propetary format or cgi or anyother.

P.S. Yes, i have googled but for servlet freepascal i found
references to THttpServlet and i already use it/them, or references
to java servlets.

TIA

-------------------------------------------------------------------------------------
One reason that life is complex is that it has a real part and an
imaginary part
    -Andrew Koenig  

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

Re: Servlet server for Fpc apps

Adrian Veith

Eduardo Morras schrieb:
> I want to ask (and know) if i can use apache-tomcat to serve servlets
> developed with freepascal. If not, is there a similar server for fpc?
> Note that i want/need servlet like in java and other languages, not a
> propetary format or cgi or anyother.
>
>

Maybe you want to look at www.haxe.org and
http://code.google.com/p/pascal4neko/

I am using the new haxe language to build neko modules, which are
running in the visual synapse webserver written in pascal. At the
pascal4neko website is a modified version of the webserver, which is
able to run neko module in a compatible way of the mod_neko apache
module described here: http://haxe.org/doc and here
http://nekovm.org/doc/mod_neko

Using haxe for web applications is very effective, because you use the
same language for back-end and front-end. With pascal4neko you can use
your existing pascal code or use pascal for low level tasks.

Hope this helps.

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

Re: Servlet server for Fpc apps

Bee Jay-2
> Using haxe for web applications is very effective, because you use the
> same language for back-end and front-end. With pascal4neko you can use
> your existing pascal code or use pascal for low level tasks.

Have you heard about ExtPascal? It wraps ExtJS library into Pascal
unit so you can use ExtJS as if you're using V/LCL components. Powtils
also has PasJS which could compile your pascal code into JS, though it
only supports very basic of pascal language. Unfortunately, both
project seems to be stalled. :(

Have you heard about Morfik? I think this one is better than haXe
since it directly produces native code from *pascal* code, both for
server and client side.

--
-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: Servlet server for Fpc apps

Michael Van Canneyt


On Sun, 29 Mar 2009, Bee wrote:

> > Using haxe for web applications is very effective, because you use the
> > same language for back-end and front-end. With pascal4neko you can use
> > your existing pascal code or use pascal for low level tasks.
>
> Have you heard about ExtPascal? It wraps ExtJS library into Pascal
> unit so you can use ExtJS as if you're using V/LCL components. Powtils
> also has PasJS which could compile your pascal code into JS, though it
> only supports very basic of pascal language. Unfortunately, both
> project seems to be stalled. :(

Aha. The pasjs might be interesting, I'm looking for a pascal-to-javascript
converter...

> Have you heard about Morfik? I think this one is better than haXe
> since it directly produces native code from *pascal* code, both for
> server and client side.

And this is why I need the pascal-to-javascript converter... :-)

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

Re: Servlet server for Fpc apps

Adrian Veith
In reply to this post by Bee Jay-2

Bee schrieb:

>> Using haxe for web applications is very effective, because you use the
>> same language for back-end and front-end. With pascal4neko you can use
>> your existing pascal code or use pascal for low level tasks.
>>    
>
> Have you heard about ExtPascal? It wraps ExtJS library into Pascal
> unit so you can use ExtJS as if you're using V/LCL components. Powtils
> also has PasJS which could compile your pascal code into JS, though it
> only supports very basic of pascal language. Unfortunately, both
> project seems to be stalled. :(
>
> Have you heard about Morfik? I think this one is better than haXe
> since it directly produces native code from *pascal* code, both for
> server and client side.
>  

I have seen ExtPascal and looked at the ExtJS library which seemed
interesting, but if I am right the license is not LGPL or something
similar. Same with Morfik interesting, but expensive and not open. Haxe
is opensource and, if you are used to pascal like me since 30 years now,
as a language not so far away (at least from all C - styled languages
the most comfortable in my point of view).

I have never heard of Powtils but will take a look at it.

Thanks,

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

Re: Servlet server for Fpc apps

Bee Jay-2
In reply to this post by Michael Van Canneyt
> And this is why I need the pascal-to-javascript converter... :-)

Don't you have access to Morfik's JST technology? ;) Anyway, glad to
hear you interested to PasJS, you may get the source code from
Powtils' SVN (at googlecode). I hope you can continue the effort, or
better, join also with ExtPascal project. :D Both Powtils (with its
PasJS) and ExtPascal (with its FCGI) have good future if both
development isn't stalled or have more support from other pascal
developers. :(

--
-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: Servlet server for Fpc apps

Bee Jay-2
In reply to this post by Adrian Veith
> I have seen ExtPascal and looked at the ExtJS library which seemed
> interesting, but if I am right the license is not LGPL or something
> similar.

If you understand the parser code which generate the wrapper units,
you may able to enhance it to be able to parse other JS UI frameworks.
Qooxdoo seems to be another good alternative for ExtJS. ;)

> Same with Morfik interesting, but expensive and not open. Haxe
> is opensource and, if you are used to pascal like me since 30 years now,
> as a language not so far away (at least from all C - styled languages
> the most comfortable in my point of view).

I'm not quite interested since it produces intermediate code which
need to be compiled by other compiler. If it has some serious bugs on
the code generator, it would double my work. I prefer Powtils,
ExtPascal, or Morfik approach, otherwise I better go to Java and GWT.

> I have never heard of Powtils but will take a look at it.

It's yet another CGI library for Pascal. You may check it out from
http://powtils.googlecode.com. It used to be known as Pascal Server
Page.

--
-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: Servlet server for Fpc apps

duilio foschi
please excuse my ignorance, but I have a question I need to ask from long time:

why is Java fit to create a web  application  and Pascal is not ?

Why  does one need to translate from Pascal to Java ?

Thank you

Duilio Foschi



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

Re: Servlet server for Fpc apps

Michael Van Canneyt


On Sun, 29 Mar 2009, duilio foschi wrote:

> please excuse my ignorance, but I have a question I need to ask from long
> time:
>
> why is Java fit to create a web  application  and Pascal is not ?

There is no inherent reason why Java is fit to create a web-application
and pascal is not :-)

(in fact, I don't think Java is fit to create any application, but
that is another discussion, which is not on it's place here ;) )

>
> Why  does one need to translate from Pascal to Java ?

Not from pascal to Java, but to Javascript: The browsers only understand
javascript. Translating pascal to Javascript means you can write browser-side
code in pascal, and then send it to the browser.

This is why I think Morfik has the right approach: They allow you to code
both server and client-side in Pascal (or VB). The server code is compiled
to a super-fast server binary, the client code is sent to the browser as
Javascript. Google does something similar with GWT, only they use Java.
(but Morfik was the first to do it, and they hold the patent on this technique).

My (long-term) plan is to make this possible in Lazarus. The server-side
is more or less covered, the basic blocks are in place. The client-side
needs still some work, of course.

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

Re: Servlet server for Fpc apps

Bee Jay-2
In reply to this post by duilio foschi
> why is Java fit to create a web application and Pascal is not ?

Who did say (in this thread) that Pascal doesn't fit to create web
applications? I've been making tens of web application using Pascal.
Since first time I made my own CGI wrapper unit, then migrated to
Powtils because it has more useful functions than mine, then now using
FastCGI from ExtPascal. I've been advocating many pascal/delphi
programmers to stay in pascal for web programming, and to my surprise,
many pascal/delphi programmers don't know that pascal is able to do
that! Most of them think that web programming is only can be done
using PHP, ASP, or Java. :(

> Why  does one need to translate from Pascal to Java ?

We're talking about JavaScript, not Java. And Java <> JavaScript
though both has similar name and syntax.

--
-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: Servlet server for Fpc apps

Bee Jay-2
In reply to this post by Michael Van Canneyt
> (in fact, I don't think Java is fit to create any application, but
> that is another discussion, which is not on it's place here ;) )

Hahahaha... unfortunately, there are more Java frameworks out there
than Pascal which became very handy for anyone to build complex
applications. Performance and dependency are not priority to these
people. Yes, I know we can make any of those frameworks by ourselves.
But not everybody is as expert as you are, Michael. ;)

> This is why I think Morfik has the right approach: They allow you to code
> both server and client-side in Pascal (or VB). The server code is compiled
> to a super-fast server binary, the client code is sent to the browser as
> Javascript.

I agree with you on this. If Morfik has support for FastCGI, I
wouldn't mind to purchase a license. :)

> My (long-term) plan is to make this possible in Lazarus. The server-side
> is more or less covered, the basic blocks are in place. The client-side
> needs still some work, of course.

Great news! If it can be as another "widget" for Lazarus, it would be
better. Someone from ExtPascal had done some effort writing a
.dfm/.lfm convertor into ExtJS window. As the other efforts, it's
still far from perfect. Unfortunately his demo site seemed to be down
(http://reidspace.co.uk:6464/).

There are many pascal project for web programming out there, too bad
each walks on in its own exclusive way and never got finished. If
there's someone who able to combine or synergy those projects, maybe
now we already have a complete web framework for pascal.

I'm dreaming that someday there would be a complete pascal framework
for web programming, with these features:
- server side module that supports Apache module, persistent CGI (TSR)
using pipe, and FastCGI using socket (they are all already available,
just need to be integrated).
- communication module that supports any web service protocols (some
are already done).
- client side module that supports pascal-to-js compiler (can be
started from Powtil's PasJS?).
- tools to wrap external JS UI library (at least the famous ones) and
integrate it with the PasJS compiler (as ExtGWT, can be started from
ExtPascal's converter?).
- server side scripting module for dynamic programming (can be started
from RO's PascalScripts?).
- an IDE to build the UI and support event-driven programming (can be
started as Lazarus plugin?).
- (optional) tool to convert desktop application into web application
utilizing all the above features.

So, most of them are already available though partially and
separately. If there would be a voluntary but dedicated developer team
to focus on this, we may already have them within 2-3 years? :D

--
-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: Servlet server for Fpc apps

Michael Van Canneyt


On Sun, 29 Mar 2009, Bee wrote:

> > (in fact, I don't think Java is fit to create any application, but
> > that is another discussion, which is not on it's place here ;) )
>
> Hahahaha... unfortunately, there are more Java frameworks out there
> than Pascal which became very handy for anyone to build complex
> applications. Performance and dependency are not priority to these
> people. Yes, I know we can make any of those frameworks by ourselves.
> But not everybody is as expert as you are, Michael. ;)
>
> > This is why I think Morfik has the right approach: They allow you to code
> > both server and client-side in Pascal (or VB). The server code is compiled
> > to a super-fast server binary, the client code is sent to the browser as
> > Javascript.
>
> I agree with you on this. If Morfik has support for FastCGI, I
> wouldn't mind to purchase a license. :)

Well, I have a license. Money well spent, all things considered :-)
 

> > My (long-term) plan is to make this possible in Lazarus. The server-side
> > is more or less covered, the basic blocks are in place. The client-side
> > needs still some work, of course.
>
> Great news! If it can be as another "widget" for Lazarus, it would be
> better. Someone from ExtPascal had done some effort writing a
> .dfm/.lfm convertor into ExtJS window. As the other efforts, it's
> still far from perfect. Unfortunately his demo site seemed to be down
> (http://reidspace.co.uk:6464/).
>
> There are many pascal project for web programming out there, too bad
> each walks on in its own exclusive way and never got finished. If
> there's someone who able to combine or synergy those projects, maybe
> now we already have a complete web framework for pascal.
>
> I'm dreaming that someday there would be a complete pascal framework
> for web programming, with these features:
> - server side module that supports Apache module, persistent CGI (TSR)
> using pipe, and FastCGI using socket (they are all already available,
> just need to be integrated).
> - communication module that supports any web service protocols (some
> are already done).
> - client side module that supports pascal-to-js compiler (can be
> started from Powtil's PasJS?).
> - tools to wrap external JS UI library (at least the famous ones) and
> integrate it with the PasJS compiler (as ExtGWT, can be started from
> ExtPascal's converter?).
> - server side scripting module for dynamic programming (can be started
> from RO's PascalScripts?).
> - an IDE to build the UI and support event-driven programming (can be
> started as Lazarus plugin?).
> - (optional) tool to convert desktop application into web application
> utilizing all the above features.

More or less all this is the ultimate intention. Whether it will be
realized is another matter. But there is hope: I still remember the
days when something like Lazarus was a distant dream, and now I've
completed and deployed my first Lazarus-developed commercial application...

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

Re: Servlet server for Fpc apps

Dariusz Mazur
In reply to this post by Michael Van Canneyt

>> Why  does one need to translate from Pascal to Java ?
>>    
>
> Not from pascal to Java, but to Javascript: The browsers only understand
> javascript. Translating pascal to Javascript means you can write browser-side
> code in pascal, and then send it to the browser.
>  
May I ask when do You need write ordinal code parallel on browser and
server side? What kind of computation? For me 99% of code should be on
server. As You write we have very fast (because compiled) application on
server. Each user action can be transform to server, computed and
results sand back to browser. Only for critical section we should write
JS script. GUI is write once, independent (as ExtJS)



--
  Darek




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

Re: Servlet server for Fpc apps

Bee Jay-2
> May I ask when do You need write ordinal code parallel on browser and server
> side? What kind of computation? For me 99% of code should be on server. As
> You write we have very fast (because compiled) application on server.

Fast is relative. You may have a very good and fast algorithm on
server, but you got bad network infrastructure, it'll look slow to the
client. You may have a very poor algorithm on JS code, but you got
good network infrastructure, and most of the clients are using
high-end machine, it'll look quite fast to the client. Most clients
would never care whether you put the code in server or in browser, the
just want to use your application with acceptable and reasonable
performance.

Today web technologies are getting more advanced, internet connection
is getting cheaper, browsers performance are getting better, web
standards are getting more obeyed, and client machines are getting
faster.

Of course, nobody would prevent you to do all the computation on the
server side. But IMO you'll waste resources on the client side that
you may utilize. Though it doesn't seem to be significant when you
look at a single client, but when you got thousands of clients
connected, you would save significant resources on the server side.

> Each user action can be transform to server, computed and results sand
> back to browser. Only for critical section we should write JS script. GUI
> is write once, independent (as ExtJS)

GUI may write once. But you could have more than just GUI on current
JS frameworks and browser capabilities. Though it's not easy, but it's
possible now to create a very complex desktop-like application on
browser with acceptable performance. I never thought that I would see
chess game to be completely running under browser using JS (no flash,
no plugins, no applets, no server side logic is required). But it's
common to see it or other kind of games under browser nowadays (with
most or all of game logic resides on the browser side).

--
-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: Servlet server for Fpc apps

Jürgen Hestermann


> Most clients
> would never care whether you put the code in server or in browser, the
> just want to use your application with acceptable and reasonable
> performance.

I do care because for security reasons I have switched off scripting at
all (with FireFox NoScript plugin). I ignore all web  pages that insist
on javascript so it does matter.

Jürgen Hestermann.


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

Re: Servlet server for Fpc apps

Michael Van Canneyt
In reply to this post by Dariusz Mazur


On Sun, 29 Mar 2009, Dariusz Mazur wrote:

>
> > > Why  does one need to translate from Pascal to Java ?
> > >    
> >
> > Not from pascal to Java, but to Javascript: The browsers only understand
> > javascript. Translating pascal to Javascript means you can write
> > browser-side code in pascal, and then send it to the browser.
> >  
> May I ask when do You need write ordinal code parallel on browser and server
> side? What kind of computation? For me 99% of code should be on server. As You
> write we have very fast (because compiled) application on server. Each user
> action can be transform to server, computed and results sand back to browser.
> Only for critical section we should write JS script. GUI is write once,
> independent (as ExtJS)

I want to write my client-side GUI code in pascal. I have no wish to learn
Javascript. All extensive computation (mostly queries and database stuff)
happens on the server, but the GUI must be programmed in Javascript because
that is all the browser understands.

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

Re: Servlet server for Fpc apps

Bee Jay-2
> I want to write my client-side GUI code in pascal. I have no wish to learn
> Javascript.

But, writing a pascal-to-js compiler obligates you to master JS as
well. Otherwise, you won't be able to generate correct and optimized
JS codes. If you can't keep the motivation up, you'll end up writing
JS directly instead of continuing the PasJS compiler development. This
case that happened to Script# project (C# to JS compiler). :D

--
-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: Servlet server for Fpc apps

Michael Van Canneyt


On Mon, 30 Mar 2009, Bee wrote:

> > I want to write my client-side GUI code in pascal. I have no wish to learn
> > Javascript.
>
> But, writing a pascal-to-js compiler obligates you to master JS as
> well. Otherwise, you won't be able to generate correct and optimized
> JS codes. If you can't keep the motivation up, you'll end up writing
> JS directly instead of continuing the PasJS compiler development. This
> case that happened to Script# project (C# to JS compiler). :D

I should have written 'I have no wish to start programming in JavaScript'
If I am going to have to write the converter, then obviously I'll have to
learn it :)

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

Re: Servlet server for Fpc apps

Dariusz Mazur
In reply to this post by Michael Van Canneyt
Michael Van Canneyt pisze:

> On Sun, 29 Mar 2009, Dariusz Mazur wrote:
>
>  
>>>> Why  does one need to translate from Pascal to Java ?
>>>>    
>>>>        
>>> Not from pascal to Java, but to Javascript: The browsers only understand
>>> javascript. Translating pascal to Javascript means you can write
>>> browser-side code in pascal, and then send it to the browser.
>>>  
>>>      
>> May I ask when do You need write ordinal code parallel on browser and server
>> side? What kind of computation? For me 99% of code should be on server. As You
>> write we have very fast (because compiled) application on server. Each user
>> action can be transform to server, computed and results sand back to browser.
>> Only for critical section we should write JS script. GUI is write once,
>> independent (as ExtJS)
>>    
>
> I want to write my client-side GUI code in pascal. I have no wish to learn
> Javascript. All extensive computation (mostly queries and database stuff)
> happens on the server, but the GUI must be programmed in Javascript because
> that is all the browser understands.
>  
Yes, You have to had client-side write in JS. But its not so huge  as
You imagine.
But maybe I dont understand your need.
You think about counterpart of LCL level, or computation wide consist in
event (form.onclick, form.onedit) function in Delphi ?


All You need is simple manipulation of HTML: change innerHTML,
innerStyle and traverse trough DOM tree. Today I have less than 1k LOC,
if future will be twice as grow. With this most of widgets ans its
behavior can be achieved.
Most of work is done by CSS, which is static. And this is no place do
translate pascal to JS


Second stage I don't move to browser side. For me it will be very big
mistake.


--
  Darek




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

Re: Servlet server for Fpc apps

Michael Van Canneyt


On Mon, 30 Mar 2009, Dariusz Mazur wrote:

> Michael Van Canneyt pisze:
> > On Sun, 29 Mar 2009, Dariusz Mazur wrote:
> >
> >  
> > > > > Why  does one need to translate from Pascal to Java ?
> > > > >    
> > > > >        
> > > > Not from pascal to Java, but to Javascript: The browsers only understand
> > > > javascript. Translating pascal to Javascript means you can write
> > > > browser-side code in pascal, and then send it to the browser.
> > > >  
> > > >      
> > > May I ask when do You need write ordinal code parallel on browser and
> > > server
> > > side? What kind of computation? For me 99% of code should be on server. As
> > > You
> > > write we have very fast (because compiled) application on server. Each
> > > user
> > > action can be transform to server, computed and results sand back to
> > > browser.
> > > Only for critical section we should write JS script. GUI is write once,
> > > independent (as ExtJS)
> > >    
> >
> > I want to write my client-side GUI code in pascal. I have no wish to learn
> > Javascript. All extensive computation (mostly queries and database stuff)
> > happens on the server, but the GUI must be programmed in Javascript because
> > that is all the browser understands.
> >  
> Yes, You have to had client-side write in JS. But its not so huge  as You
> imagine.
> But maybe I dont understand your need.
> You think about counterpart of LCL level, or computation wide consist in event
> (form.onclick, form.onedit) function in Delphi ?

All events and almost any class I need should be available in the client...

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