Building a website with C++ (CppCMS)
11–19 of 19 posts
Re: Building a website with C++ (CppCMS)
#12It seems (to me) like if statically typed, compiled languages are your bag, and you want to create web applications, Go is the right choice. I recently finished the MVP for a weekend side project in Go, and I had a lot of fun (coming from a Node.js/Ruby background). I finally understood the draw of static typing (the compiler saved me a ton of time), but I didn't feel limited by the type system, nor encumbered by the…
You're probably not doing it right. You should see a factor 10 or more difference, without optimization. Why ? Because any variable lookup in a dynamic language is always at least O(log N), and the mere fact that it needs looking up at all costs you a lot. So every single statement and expression of a compiled language is going to blow the socks off any interpreted language.
Re: Building a website with C++ (CppCMS)
#13Surely, in 2014 we can do better than CppCMS... srv.applications_pool().mount(cppcms::applications_factory ()); Not doing us any favours there, at all. C++ is crying out for a bit of 'hip' and there's really no reason, with C++11 now pretty ubiquitous, we can't have some Sinatra-inspired frameworks. What is it that really holds C++ back from being a solid choice for web frameworks?
> C++ is crying out for a bit of 'hip' It is? > What is it that really holds C++ back from being a solid choice for web frameworks? Language wise? Not much. It's more of a library and culture "problem". There's no inherent reason why C++ can't be used for web frameworks.
But that'll never happen.
Re: Building a website with C++ (CppCMS)
#14It seems (to me) like if statically typed, compiled languages are your bag, and you want to create web applications, Go is the right choice. I recently finished the MVP for a weekend side project in Go, and I had a lot of fun (coming from a Node.js/Ruby background). I finally understood the draw of static typing (the compiler saved me a ton of time), but I didn't feel limited by the type system, nor encumbered by the…
> (not even optimized, and it still made the equivalent Node implementation's performance look mediocre by comparison) You're probably not doing it right. You should see a factor 10 or more difference, without optimization. Why ? Because any variable lookup in a dynamic language is always at least O(log N), and the mere fact that it needs looking up at all costs you a lot. So every single statement and expression of…
Re: Building a website with C++ (CppCMS)
#15Earlier quoted context omitted.
> C++ is crying out for a bit of 'hip' It is? > What is it that really holds C++ back from being a solid choice for web frameworks? Language wise? Not much. It's more of a library and culture "problem". There's no inherent reason why C++ can't be used for web frameworks.
C++ would be an absolutely fantastic language if it were allowed to start from scratch library-wise. But that'll never happen.
Re: Building a website with C++ (CppCMS)
#16It seems (to me) like if statically typed, compiled languages are your bag, and you want to create web applications, Go is the right choice. I recently finished the MVP for a weekend side project in Go, and I had a lot of fun (coming from a Node.js/Ruby background). I finally understood the draw of static typing (the compiler saved me a ton of time), but I didn't feel limited by the type system, nor encumbered by the…
Why Go and not Haskell?
Re: Building a website with C++ (CppCMS)
#17It seems (to me) like if statically typed, compiled languages are your bag, and you want to create web applications, Go is the right choice. I recently finished the MVP for a weekend side project in Go, and I had a lot of fun (coming from a Node.js/Ruby background). I finally understood the draw of static typing (the compiler saved me a ton of time), but I didn't feel limited by the type system, nor encumbered by the…
> (not even optimized, and it still made the equivalent Node implementation's performance look mediocre by comparison) You're probably not doing it right. You should see a factor 10 or more difference, without optimization. Why ? Because any variable lookup in a dynamic language is always at least O(log N), and the mere fact that it needs looking up at all costs you a lot. So every single statement and expression of…
Also, this was by no means a scientific benchmark - it wasn't a comparison of raw ops/sec, or anything like that: just the requests/sec on a few different routes (pretty close as far as implementation logic). I'm sure the chosen frameworks played into the results as well, but I'd consider that a more pragmatic benchmark anyways.
Re: Building a website with C++ (CppCMS)
#18A friend of mine is recently writing C++ web framework similar to Python Flask. It has many interesting features like compile-time routing URL parameter checking, easy and fast (probably fastest among C++ json libs) json implementation by taking full advantage of C++11. If interested, take look of following code and repository: https://github.com/ipkn/crow/blob/master/example.cpp
Re: Building a website with C++ (CppCMS)
#19Earlier quoted context omitted.
> (not even optimized, and it still made the equivalent Node implementation's performance look mediocre by comparison) You're probably not doing it right. You should see a factor 10 or more difference, without optimization. Why ? Because any variable lookup in a dynamic language is always at least O(log N), and the mere fact that it needs looking up at all costs you a lot. So every single statement and expression of…
Are you saying I should have seen more of a difference than I actually did? Maybe I was doing it wrong, but I said it makes Node's performance look "mediocre" rather than "bad" because Node is still pretty damn fast compared to the rest of the field (also, I like Node.js a lot and use it daily). Also, this was by no means a scientific benchmark - it wasn't a comparison of raw ops/sec, or anything like that: just the…