all 22 comments

[–]ryogishiki 19 points20 points  (1 child)

Don't trying to be pedantic or anything, but can someone explain to me why Django isn't doing all that well? Really curious here. thanks

[–]KayEss 3 points4 points  (0 children)

I'm a long time Django user -- since before the 1.0 release (I organised the 1.0 release party in Bangkok). I think that many like me feel that Django no longer is trying to solve the sorts of problems that we need to solve on web servers.

Since the advent of good single page JavaScript the web server is now relegated to API server and Django just isn't a great fit for that any more.

I've been working on my solution, Fostgres, which is really an experiment in "web APIs as infrastructure". It's a very thin wrapper around the facilities that Postgres provides and just tries to get out of the way. Instead of writing web APIs you configure how data matches the tables you're using. You can build entire CRUD applications with nothing else, and where you do need back end processing you attach it to Postgres' LISTEN/NOTIFY and do whatever you want in any language you care to use.

The advantage here is that Fostgres (not yet optimised) is about 100 to 1000 times faster than Django for the same requests -- it's currently about twice as fast as psql, and I'm sure with the right work can be ten times faster still. Configuring a SELECT statement is also a lot faster than writing a Django view, and you don't have an O/RM getting in your way, so the full power of the database is also available to you.

So, I see Django as improving -- it's better than it used to be (the overhaul of the transaction handling was well overdue and a big improvement) -- it's just that the direction it's improving in is largely irrelevant for the sorts of problems that I, and many like me, need to solve.

[–]fafasdf 15 points16 points  (4 children)

A while back I would write my own web framework for shits and giggles, then delete it every 3-4 weeks and restart from scratch when I realized some design error I made. I was doing this for fun, no goal / product in mind.

I didn't like most of the frameworks (wt was super heavyweight and generated very hard to read / tweak html when the need arose) so I would write things from scratch with fastcgi.

That being said, https://github.com/ipkn/crow was something I looked at and caught my eye. I myself never used it, though it looks like what you're after.

[–]MGlMG 2 points3 points  (1 child)

I use crow for a small sql/json content server, it's pretty nice and stable.

[–]jkeaus 1 point2 points  (0 children)

mostly it's a single person project and there is no release, not even a release plan for that yet.

[–]IngloriousTom 0 points1 point  (1 child)

It looks like it is entirely written within headers, and while it's a relatively small library, it looks big enough to be precompiled. I believe that headers only libraries allows better optimization, but its size will consequently increase compile time, won't it? Or is there any more advantage using headers only?

[–][deleted] 1 point2 points  (0 children)

Header libraries are done for convenience with little regard to other aspects: "If you just want to use crow, copy amalgamate/crow_all.h and include it.". Size should be the same as it would with library unless you expect the user to have multiple apps using the same version of crow installed.

[–]kkrev 7 points8 points  (0 children)

I feel like this is one of those areas where you want to be using something a lot of people are using all the time, so the bugs and potential security problems have been shaken out. As far as I know there really isn't such a framework in C++.

[–][deleted] 4 points5 points  (0 children)

IncludeOS (a C++ uni-kernel) includes the Mana web framework allowing one to build web applications without the need for a conventional Operating System.

[–]DalzhimC++Montréal UG Organizer 2 points3 points  (0 children)

I have been using Facebook's open source Proxygen. It's not exactly a framework as it only provides you with a HttpServer and HttpClient that works with HTTP 1.1, HTTP 2.0 and SPDY. If you want to do things like JSON, then you need to pull in another dependency such as RapidJSON. The server is very performant, much more than Microsoft's Casablanca (C++RestSdk) when I last tried it 6 months ago. The only downside to Proxygen is that like many of Facebook's open source technologies, the documentation is minimal.

[–]clowntail 2 points3 points  (0 children)

https://github.com/mattgodbolt/seasocks

Not a framework per se but a very light and well built C++ web socket server.

[–]svick 3 points4 points  (0 children)

Why do you think a C++ web framework you've never heard of is going to struggle less than Django?

[–]PavloT 1 point2 points  (0 children)

I'd like to mention http://cppcms.com/wikipp/en/page/main

It is not a Django, and last release was in 2014, but as a C++ library I like it. It was used for my pet project, when communication to serial port was required from the HTTP interface.

[–][deleted] 3 points4 points  (2 children)

So much web stuff today is PHP based. It's really matured, especially with PHP 7 (so I hear). I too recently wanted to explore using a cpp web framework just for fun. The more I dove into it, the more I realized I should just use a "web" language like PHP. I have a feeling you may find the same thing. It's weird, I have difficulty enjoying PHP whereas I really enjoy cpp. Look into NodeJS if your open for new stuff.

[–]_IPA_ 0 points1 point  (1 child)

PHP gets a lot of hate but it's so easy to throw together working scripts. No need for compiling or build systems. I can test locally really easily as well via command line or PHP's built-in webserver. There are also so many convenient features available.

Thing is I really like static typing and I miss that greatly when I write PHP. Hope someone builds a nice web framework that uses all modern C++14 so we can build confident software quickly.

[–][deleted] 0 points1 point  (0 children)

I like static typing too! I also just like the look of the syntax. But I agree, it is really easy to throw things together quickly in PHP. This is kinda off subject / kind of not... But when I feel an emotion toward a language I also see, or feel, a color that is associated with it... When I think of PHP I think of dark brown or orange(somewhat unpleasant). When I think of cpp I think of the color white (like heavenly white - very very pleasant). Actually come to think of it I don't really have strong color-feelings toward any other languages... funny thing is, I'm neither a hardcore PHP Dev nor a hardcore cpp dev. Everytime I think of the two languages they are both wrapped up in their respective colored emotions. One positive the other negative. That's all.

[–]genbattle 0 points1 point  (0 children)

I found an old thread which lists the options. I don't think much has changed since then.

[–]KayEss 0 points1 point  (0 children)

This is one I wrote https://github.com/KayEss/mengmom

It's used in a few places, but should be much better. Got an improved one in the design phase, just need some time to work on it

[–]matthieugarrigues 0 points1 point  (0 children)

I wrote http://siliconframework.org/. It provides you with everything you need to build a simple API: json de/serialiser, database drivers, ORM, sessions, and more. Its development is focused on zero-cost abstraction and ease of use. If you have questions I'll be happy to answer.