Tutorial :Are there any web frameworks for compiled languages like C++? [closed]


On our embedded device, we currently use PHP for its web interface, and unfortunately it's quite slow. We've been experimenting with Python, but is seems (at least on FPU-less ARM architecture) to be as slow as PHP.

Therefore we're thinking about implementing web interface in some compiled language like C++, but so far the only thing we've found is Wt, which looks more like desktop than web framework and it's documentation is rather complicated for a beginner.

So my question is: do you know about any good web frameworks for C/C++? What would make me totally happy would be something like C++ Django, but I doubt such thing exists :-)


If I were you, I would give Wt a try. I don't think you will find another solution as complete and easy to use as Wt with similar performance. The mailinglist are active, and has regular posts of people who use it on embedded devices. The Wiki (here) of the project mentions some numbers for embedded deployment and performance on ARM.


What is the reason your site is slow in PHP? Have you profiled the code to figure out the bottle necks? Replacing the entire codebase with another language is likely to be too large a tool for the job.

Perhaps if some portion is computationally intensive, then maybe you can implement a PHP module in C++ to do the job.


You can take a look at CppCMS. I don't know how mature or good it is, but it sounds like what you are looking for.

Another option is to write the main application in Python/PHP and then rewrite the critical parts in C, which seems more sane to me.


I had just seen this link as a referrer to CppCMS. Several questions/answers about it.

Q. How is it mature?
A. There is a Wiki 100% based on it. Developers blog runs on CppCMS as well. So you can see it quite works. well. At least for author.
Q. "What would make me totally happy would be something like C++ Django"
A. Actually it is "C++ Django". Many Ideas had been taken directly from Django, like forms, template inheritance and some more. So you would probably feel at home
Q. Nanogear
A. I had taken a look on it... It has many plans but not-too-much code.
Q. How many projects using it.
A. Not many. It is quite new project.
Q. Who am I?
A. To be honest I'm the developer of CppCMS.


Do you really need a web framework or just an html templating library?
See here for template options: C++ HTML template framework, templatizing library, HTML generator library


One thing to look at here is using C++ for some sort of web service instead of an actual web app development environment. On one of my current projects we generate JSON(and parse for requests) then let the client(web browser) deal with the rest. You have a great deal of computing power available to you on the client machine, mix in some javascripty magic and boom, now your embedded device can go back to doing what its supposed to do. I personally kind of like Wt and think it is your best bet if you want to dev the whole "web app" thing in C++.

As to the specifics of how you get your C++ code to start serving up web services, you can use the amazing boost.asio library(they have an http server example) and json_spirit(I think its on codeproject)


How about Nanogear. I haven't used it, so I'm not sure if it is a good fit. Here is a quote from the website.

C++ is a great, general purpose programming language but no modern, easy-to-use and powerful C++ web frameworks were made during these years. We try to fill the gap with Nanogear. Inspired by the Zend Framework and Rails we want to bring C++ to the web, easily.

Here is a link to the older googlecode site Google Code Nanogear Looks like there is more info there.


Try Lua. There is Xavante embeded web server somewhere on LuaForge.

It's very fast, very small and very extensible - as all about lua is.

You have power to use Lua where scripting fits betteer, and use C++ functions where in need of more speed and conection to existing native code.


Since no one else has said it, I will. Try Java. Java is a compiled language with a good web framework. It is also very scalable. Every coperation I have worked for uses java as its main web-technology, and this is mainly due to this scalability factor. Not sure if it will work with your architecture, but it answers the question:

Are there any web frameworks for compiled languages like C++?


You may give a try to embedded version of CppCMS.

It's quite new and exprerimental development but It looks like it is much more suitable then Wt because it is ore web oriented (more closer to Django) and not GUI like.


Check out the ffead c++ application framework (http://code.google.com/p/ffead-cpp/), its developed on the lines of Spring for JAVA.


You can have a look at Tntnet. It uses its own template language which looks a bit like PHP, only with much more additional tags.


C on Concrete. :)

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »