What works for web dev in C++

后端 未结 9 1319
一整个雨季
一整个雨季 2020-12-31 17:24

I want to create a web application that runs with very little RAM and I think C++ can help me achieve that.

Now, many people say C++ is unsuited for web development

相关标签:
9条回答
  • 2020-12-31 17:54

    Our web app backend is in C++ via CGI and we use Clearsilver templates along with the HDF that comes with it.

    0 讨论(0)
  • 2020-12-31 18:00

    ATL Server is a library of C++ classes that allow developers to build internet based applications.

    0 讨论(0)
  • 2020-12-31 18:00

    ATL Server. It's open source too! And of course there is always ISAPI. Ah, the bad old days. :)

    0 讨论(0)
  • 2020-12-31 18:00

    Give us some more hints about what you're trying to do.

    You can write a good old-fashioned cgi program in C++ easily enough, and run it with FastCGI. We used to do that all the time.

    You could write a C++ program embedding a lightweight HTTP server as well.

    Both of them are much bigger PITAs than using something like perl or ruby.

    So for why C++?

    Update

    Okay, got it. The main thing about FastCGI is that it avoids a fork-exec to run your CGI program, but it is a little bit different API. That's good, but you still have the problem of handling the HTTP stuff.

    There are, however, several very lightweight HTTP servers, like Cherokee and Lighttpd. In similar situations (building web interfaces for appliances) I've seen people use one of these and run their C/C++ programs under them as a CGI. Lighttpd in particular seems to concentrate on making CGI-like stuff fast and efficient.

    Another update. I just had cgicc pointed out to me: http://www.gnu.org/software/cgicc/

    That might solve some problems.

    0 讨论(0)
  • 2020-12-31 18:01

    Have you looked at http://www.tntnet.org/. They have created a... well let me cut and paste from their website:

    Tntnet is a modular, multithreaded, high performance webapplicationserver for C++. To create webapplications Tntnet has a template-language called ecpp similar to php, jsp or mason, where you can embed c++-code inside a html-page to generate active content. The ecpp-files are precompiled to c++-classes called components and compiled and linked into a shared library. This process is done at compiletime.

    I've used it and it has quite a small overhead plus it has screamingly fast dynamic page generation. Makes PHP, Ruby etc snails in comparison because with tntnet you are running compiled C/C++ code.

    0 讨论(0)
  • 2020-12-31 18:02

    In your other question you mention that your embedded system is openwrt. As this router firmware already comes with a embedded web server (for it's administration UI), why don't you use that for you app as well?

    0 讨论(0)
提交回复
热议问题