What works for web dev in C++

后端 未结 9 1389
一整个雨季
一整个雨季 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 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.

提交回复
热议问题