[fpc-pascal] Servlet server for Fpc apps
darekm at emadar.com
Mon Mar 30 15:49:21 CEST 2009
>> 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.
Poor algorithm on JS will run very slow (computation made by interpreter
never will be so fast as compiled), huge program on JS run no fast and
(more important) load slow. Infrastructure is important, but its rather
easy have delay less than 200ms, thats enough to proper work. On other
side you have to communicate browser-server not so rare.
> 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
> 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
Yes. Im quite impressive about new features of CSS3 and HTML5, but it
has nothing to putting computation to browser side.
> 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.
To make beautiful site you need generate only several kb of html code,
when you transmit it compressed or differential it took only one frame.
Computation on server side took less than 2 ms.
Browser should resolve DOM, CSS, SVG ets. it enough to work Animation
can be done in several lines of JS, you need transfer orders in 1..3 per
>> 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).
Chess is very simple (of course on GUI side). Today I can imagine, that
is only few lines of code to display beautiful play desk.
To manipulate this code I dont need ane new JS code;
> 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).
I write about translate near every function from pascal to JS. Of course
some of specialized part is need to be write on browser side, but only
few. Similar as sometime we write small part of application in assembler.
More information about the fpc-pascal