Re: c++ web scripting
From: David Hilsee (davidhilseenews_at_yahoo.com)
Date: 09/13/04
- Next message: Ioannis Vranos: "Re: Info on std::string"
- Previous message: Shailesh Humbad: "Re: c++ web scripting"
- In reply to: Shailesh Humbad: "Re: c++ web scripting"
- Next in thread: Tommi Mäkitalo: "Re: c++ web scripting"
- Reply: Tommi Mäkitalo: "Re: c++ web scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Ioannis Vranos: "Re: Info on std::string"
- Previous message: Shailesh Humbad: "Re: c++ web scripting"
- In reply to: Shailesh Humbad: "Re: c++ web scripting"
- Next in thread: Tommi Mäkitalo: "Re: c++ web scripting"
- Reply: Tommi Mäkitalo: "Re: c++ web scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|