#1 2012-08-28 21:55:38

From: Ghent - Belgium
Registered: 2012-08-28
Posts: 1

xxm: an alternative platform to build dynamic websites with Delphi

Arnaud invited me to post an entry on the forum here so we could all discuss. I'd like to hear what you think.

After I graduated I did some work in PHP, ASP, Cold Fusion and it struck me that the code you write would be processed over and over by a scripting engine. Compared to the speed of the Delphi compiler and the power of native code, a lot of resources and performance is lost that way.
The years that followed I did ISAPI and raw HTTP with Delphi. When I also got an implementation of Internet Explorer's IInternetProtocol working, I started a project that allows to have HTML and Pascal code in the same files, and have the Delphi compiler build an updated DLL that hosts the website. The development version checks the source-code for changes so you can run the updated code by hitting refresh in a browser, the 'live' version takes the resulting library to run the website with IIS, Apache, or plain raw HTTP over a TCP socket.


It's specifically non-RAD and doesn't integrate with an IDE. It started from the belief that decent web-coding is done by hand (i.e. notepad, or a derivative like notepad++,emacs,vim) so you can avoid having obscure layers spew ugly HTML, and have full control of the code that a client browsers gets to process.
It is better to compare it to the PHP project in its early days. It offers close access to the inner workings of the web-server to a coding environment you get control of.
This allows for far greater things,
in the PHP realm there's WordPress, Drupal, Typo3, Joomla...
in the xxm realm, well, I'm reaching out to other people that also subscribe to the close-to-code web-dev vision and have good knowledge of non-IDE Delphi code, with little success.

I look forward to hear about your thoughts, idea's, impressions.
Stijn Sanders

Last edited by stijnsanders (2012-08-28 21:57:04)


#2 2012-08-29 05:21:36

From: France
Registered: 2010-06-21
Posts: 14,206

Re: xxm: an alternative platform to build dynamic websites with Delphi

Using Delphi to produce HTML is a very good idea.
I like the DWS approach: HTML and code in the same file - and XMM sounds more or less the same, despite the fact the result is compiled into binary via the Delphi compiler, not into an execution AST, as for the DWS interpreter.
But I also wrote some Delphi apps rendering HTML on the fly, with great success. They were producing either static HTML - see http://catho.org (it uses a .php layer to uncompress the content stored as .gz file on the server) - or on-the-fly HTML content, depending on one user request.

The XXM approach is very interresting. I like the fact that it has some points in common with .php (modify the source and it will recompile), with the power of compiled program. It sounds to me like the (defunct?) Z505's PowUtils library - which was lightweight and using FreePascal, so was working on small and cheap Linux boxes. Does XMM only support Delphi + Windows? Or does it compile with FPC (or even Kylix)?

The two behaviors (development or live) of XXM are IMHO very interesting. It does not have the full interaction of DWS or other script engines: do you have some delay before the page refresh?

The fact it is able to serve its pages with the kernel-mode http.sys server (like mORMot) using the HTTPAPI is also very nice.
This is most scaling, light and integrated way of servicing HTML pages in Windows.

For mORMot, we tend to go into the AJAX / RichClient direction, so we look forward into SmartMobileStudio rather than standard .html.
But standard HTML is the only true web root. For robots to index the site content, or unpaired readers to access it, there is nothing but good old HTML.
My only concern about the XXM / PHP approach is indeed the (potential) mix of the presentation and business layer. I'm quite sure that you can create well separated n-tier applications with them, but the natural tendency of a coder (unless it is an experimented one) will be to mix logic within HTML code generation.

Do you have any Open Source application built on XMM which we may look at?
For instance, I'm looking into a forum engine and a CMS written in object pascal.


#3 2012-08-29 10:37:06

From: Slovenia
Registered: 2011-04-29
Posts: 113

Re: xxm: an alternative platform to build dynamic websites with Delphi

I have thoughts about "pascal web collaboration" too, but for different aspects of usage.

1. You may translate your whole pascal code to the javascript+html+css, but this limits you to specific applications (maybe with PhoneGap you can go further).
2. You may have server and client written in pascal (Delphi, Lazarus-FPC), but client is translated to "web languages" (javascript...). Here you can have two ways of implementation scenarios: first both server and client (GUI) live on same machine as one logical application (in FPC case you can port this to many platforms, e.g. game on Android, ) and second as true client/server model where you need live connection to the Internet.
3. Write both parts in native way (server in pascal and client in "web languages") and glue them together with some prepared library (communicating objects written in pascal and javascript). Even without "glue library" this "old fashion" approach is not so missed for huge projects, where you don't want to mix presentation and business layer. Sometimes is better (for better control) to write "web code" at your favorite editor (or full blown IDE) and prepare some javascript to interact server data (mORMot JSON) with client GUI.

I really don't know what is best, but for my opinion there is no clean winner for all cases.

In case of web application frameworks we can take this link as starting point.
I did not test neither of this frameworks yet in sense ease of development and customizations, performance... Takes time to do that for all of them (list is growing every year) smile.

OP4JS is now SmartMobileStudio (no real business demos on their page, just "games"), Morfik looks bigger every day, uniGUI and p2js look very nice for business applications (uniGUI demos, p2js demo).

@ab: Why did you choose SmartMobileStudio in favorite to others (which are mostly not payable at "start")?

"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal


#4 2012-08-29 11:41:07

From: France
Registered: 2010-06-21
Posts: 14,206

Re: xxm: an alternative platform to build dynamic websites with Delphi

SmartMobileStudio has just a great compiler, and it is very easy to use.
I was part of the beta, and bought the 1.0 release.
It is working as expected, very stable and it takes in account all the browsers specificity (iPad/iPhone/Android/Desktop) quite well.

SMS is made by some very good coders, how enjoy code quality and development fun.
Worth the price to support such people!

EWB has a diverse approach - where does their compiler comes from? Is it DWS-based? and target RAD DB desktop apps, not mobile apps.
I did not know about p2js but sounds like a very nice Open Source project. Use of third-party javascript libraries Sencha has price/licensing issues for commercial apps, and is also IMHO less "polished" than the SMS approach, in which the whole RTL and UI layers are coded in object pascal, with true classes.

The EMB story is quite diverse, like the people behind them.
See http://www.deltics.co.nz/blog/?p=1097&c … ment-12340
Sounds just about money and short-term ROI, not fun of coding.
Code quality of latest changes to Delphi is far away from the quality of SMS (and I hope of mORMot - after a indentation re-factoring if you do not like my way of formating code wink ). In all cases, there is no mystery when you compare DataSnap code and speed vs mORMot's.


Board footer

Powered by FluxBB