....
(sorry - I would like to answer Shailesh comment, but my news-server missed
it)
Let me clearify the concept of my server first.
The idea is to create c++-code out of html-files and compile these into
something executable. I want to create compiled code. Just like I do
c++-programming. Not compile when called like Jsp, but when a client
requests a page, the code is here to generate the answer at full speed. No
compiler, no interpreter or runtime, which eats runtime or memory.
I tried to create a apache-module, but it failed, because apache is linked
with a c-linker and can't load shared libraries in c++. Next I thought
about creating a apache-module, which passes the requests to another
daemon, which is written in c++. But how do I pass the requests? A pipe
would be ok. I need to stream the request to my process and the process
streams the answer. But if my process waits for requests on a pipe, it can
also listen on a socket. So I had my webapplicationserver.
Html-pages with ebedded c++-code is precompiled into c++-classes, which is
compiled into object-code and linked to a shared library. The Webserver
loads this shared library dynamically and instantiates this classes to
process the received requests.
The precompiler, I wrote can even compile pictures like jpeg or gifs into
c++-classes, so I can put a whole webapplication including all graphics
into a single shared library.
The language, I created borrows much from Mason (
http://www.masonhq.com)
because this was my preferred template-engine. That's the reason I don't
use tags from Jsp or Php or Asp.
Shailish suggested to reduce the tags to a single one like Php, which uses
<? or Asp with <%. It is one possible solution too. But I need more tags. I
started with <%some_tag>...</%some_tag> like Mason, which conformes to XML
too. In practice it is very hard to type, so I shortened some often used
tags to 2 characters manly to reduce typing and improve readability.
C++-code is marked with <%cpp>..</%cpp> or shorthand <{...}>, which
resembles a code-block in c++. Expressions are marked with <$...$> which is
like a perl- or shell-variable. Comments are <%doc>...</%doc> or shorthand
<#...#> like perl- or shell-comment. Another tag is <& ... &>, which embeds
another c++-component into the page, like a subroutine-call ('&' marks a
function in perl or a reference in c++).
I have other tags to define queryparameters, attributes, initialization,
defining subcomponents and others. This long form is extendable, when I
need something more.
And best of all: I have a working implementation.
OK - It is time to give it a name. The server is called 'tntnet'. The files,
with ebedded c++ are .ecpp-files.
I will publish my source very soon.
Tommi