Re: c++ web scripting

From: David Hilsee (davidhilseenews_at_yahoo.com)
Date: 09/13/04


Date: Sun, 12 Sep 2004 23:32:49 -0400


"Shailesh Humbad" <noreply@nowhere.com> wrote in message
news:Qm%0d.14068$_z4.1016@fe1.columbus.rr.com...
> Tommi Mäkitalo wrote:
> > Shailesh Humbad wrote:
> >
> >
> >>Has anyone ever heard of a c++ web 'scripting' engine? I think it
> >>would be fairly easy to make one. All that is needed is an
> >>intermediary that compiles the code on demand and caches the
executables.
> >>
> >>For example, I put a file like hello.cpp:
> >>
> >>#include <iostream>
> >>int main(void) {
> >>cout << "<h1>hello world</h1>";
> >>}
> >>
> >>in the web server directory, and when I point my browser to
> >>http://localhost/hello.cpp, the c++ web 'scripting' engine compiles
> >>the code on the fly and serves the output over http. It would work
> >>just like CGI, except the compilation is automatic.
> >
> >
> > Hi,
> >
> > I have written a webapplicationserver in c++, which supports c++. I
defined
> > a template-language like PHP, JSP or Mason for c++, so you can embed
> > c++-code in HTML-pages. It much faster than cgi, because there is no
need
> > to start a process for each request. Even dynamic pages with this system
> > are faster than static pages in apache.
> >
> > Here is a example of a dynamic web-page:
> >
> > <%args>
> > some_text // define query-parameter here
> > </%args>
> > <html>
> > <body>
> > <# this is a comment, which is precompiled away #>
> > <{
> > // do some c++-coding here:
> > for (unsigned i = 0; i < 10; ++i)
> > {
> > // output the value of the query-param "some_text" 10 times:
> > }>
> > <p> <$ i $> : <$ some_text $> </p>
> > <{
> > } // end of for-loop
> > }>
> > </body>
> > </html>
> > __END__
> >
> > The tags <$ ... $> outputs a c++-expression. Everything here is written
to a
> > std::ostream, so you can output every object which has a
> > "operator<<(std::ostream&)" defined.
> >
> > There are many more features like embedding other c++-components or
special
> > tags for initialization or support for i18n.
> >
> > I would like to release it under the GPL, but it lacks documentation
yet.
> > What I have is a short introduction as a word-document written in
german.
> > If someone is interested in helping, let me know.
> >
> > It would be also nice to hear comments.
> >
> >
> > Tommi Mäkitalo
>
> Hi Tommi,
>
> This is exactly what I was looking for. I'm so surprised nothing like
> this already exists. If you think about it, .Net's "new and improved"
> approach toward web applications is to compile the code on request,
> and keep the compiled object code in a cache. However, .Net does not
> compile to native code, but to an intermediate language, which adds
> overhead. We were so busy with ASP, PHP, and other scripting
> languages, that we only now realized we can use C++ directly and just
> have the server compile it on the fly.
<snip>

Doesn't .Net provide one or two good ways to use C++ code inside a .Net
application? If not P/Invoke, then at least using "unsafe"? Then, if you
go with .Net, you could choose between higher-level languages and C++
depending on your needs.

-- 
David Hilsee


Relevant Pages

  • Compiling for WinCE C++ code developed with a non-MS IDE
    ... I've recently had a request about an application written in C++, ... A GUI was needed, so ... turns out that this application needs to run under Windows Mobile/CE (I was ... Do I compile on the smartphone or will my laptop do? ...
    (microsoft.public.windowsce.embedded)
  • Re: Regression in 2.6.28-rc and 2.6.27-stable - hibernate related
    ... (CCing to linux-acpi at Rui's request) ... On Thursday, 27 of November 2008, Fabio Comolli wrote: ... applied after 2.6.27.4 and retest. ...
    (Linux-Kernel)
  • Re: .ASPX -> .CS generation
    ... It does create a C# source file! ... It even showed me the command line that was used to compile it. ... No doubt, it does many things when requesting an ASPX file, but this step is ... > When you make a request to an ASPX file, it is not converted into C# file. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET Web Application And Compilation [Question]
    ... > we'd compile the web project before deploy it to the server,yes? ... > class of the webpage(not the codebehind class in the assembly), ... > class will be generated from the aspx source file and is derived from the ... > its instance to process the coming request for the certain page. ...
    (microsoft.public.dotnet.framework.aspnet)