I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.
Crow – C++ Microframework for Web, inspired by Python Flask
21–30 of 65 posts
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#22The full trie implementation caught my eye, are there no suitable alternatives in std or boost?
Mixed tabs and spaces (?) cause strange display in github in json.h from 555 through 670 or so.
Also at the start of json.h it seems a shame to repeat __builtin_expect rules, how about #if defined() || ?
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#23Earlier quoted context omitted.
It looks very convenient for making some relatively simple web services (based on me not knowing much C++, others would get more mileage probably). It looks like the kind of C++ project of a moderately small size that's implementing something that I'm very familiar with already, so I think it will be useful to help me learn C++. I have a couple of questions, and that is what is the reason for only having .h files wit…
Header-only libraries have several advantages (see http://en.wikipedia.org/wiki/Header-only ). Most-notably, they are dead-simple to include with a project, as opposed to having to separately build and link to a shared-library.
Inlining everything is bad because:
- it makes the binary much bigger.
- the smallest code change forces library users (applications) to be recompiled.
For libraries it's usually better to go to the other extreme: hide as much code and data as possible in the source files. See, for example, https://en.wikipedia.org/wiki/Opaque_pointer. It greatly reduces the need for applications to be recompiled when the library is updated.It's actually very unusual to put all function implementations inline (edit: as in, inside the class declaration) in C++. I wonder whether the author is a heavy Java user.
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#24Earlier quoted context omitted.
Header-only libraries have several advantages (see http://en.wikipedia.org/wiki/Header-only ). Most-notably, they are dead-simple to include with a project, as opposed to having to separately build and link to a shared-library.
Yeah but usually "header-only" implies templates, of which there seems to be little in this case. Without templates there's little point in putting everything in headers because all the code becomes inline. Inlining everything is bad because: - it makes the binary much bigger. - the smallest code change forces library users (applications) to be recompiled. For libraries it's usually better to go to the other extreme:…
The language says that's just a suggestion to the compiler, right? Does any compiler actually inline for non-trivial methods?
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#25I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#26Earlier quoted context omitted.
Yeah but usually "header-only" implies templates, of which there seems to be little in this case. Without templates there's little point in putting everything in headers because all the code becomes inline. Inlining everything is bad because: - it makes the binary much bigger. - the smallest code change forces library users (applications) to be recompiled. For libraries it's usually better to go to the other extreme:…
> because all the code becomes inline. The language says that's just a suggestion to the compiler, right? Does any compiler actually inline for non-trivial methods?
And whether or not the compiler inlines the code, applications will still have to be recompiled whenever there's a code change in the library.
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#27Earlier quoted context omitted.
Yeah but usually "header-only" implies templates, of which there seems to be little in this case. Without templates there's little point in putting everything in headers because all the code becomes inline. Inlining everything is bad because: - it makes the binary much bigger. - the smallest code change forces library users (applications) to be recompiled. For libraries it's usually better to go to the other extreme:…
> because all the code becomes inline. The language says that's just a suggestion to the compiler, right? Does any compiler actually inline for non-trivial methods?
// header.hpp
inline int f(int x) { return x + 1; }
// a.cpp
#include "header.hpp"
// b.cpp
#include "header.hpp"
If f was not marked inline, linking a.cpp and b.cpp together would find a conflicting method f, and compilation would fail. `inline` lets the compiler ignore this, and it simply picks one of the multiple definitions as the 'real' one and moves on with the compilation.Re: Crow – C++ Microframework for Web, inspired by Python Flask
#28This is going to sound overly critical and judgmental to many - but to me, I just don't understand how you can spend the time involved in developing an entire web framework, and don't have the time to write a couple paragraphs for a README on how to use it and what it's all about along with some examples. I'm not talking full documentation - I'm just talking a few sentences and an example or two. Why bother releasing…
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#29I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.
This looks nice. I would suggest avoiding macros in the final release; it should be possible to implement CROW_ROUTE() using template meta-programming instead of #define's.
To check whether handler is valid with given URL at compile time, `url' (string literal) argument requires in compile time and in run time. const char* value is invalid for template argument and argument of non-constexpr function cannot be constexpr value. Thus I used macro to provied `url' argument twice; in template argument through constexpr function and in argument.
Re: Crow – C++ Microframework for Web, inspired by Python Flask
#30Earlier quoted context omitted.
This looks nice. I would suggest avoiding macros in the final release; it should be possible to implement CROW_ROUTE() using template meta-programming instead of #define's.
I also want to remove CROW_ROUTE, but with the current c++ standard, it cannot be avoided. To check whether handler is valid with given URL at compile time, `url' (string literal) argument requires in compile time and in run time. const char* value is invalid for template argument and argument of non-constexpr function cannot be constexpr value. Thus I used macro to provied `url' argument twice; in template argument…
You might be interested in metaparse [1] which can greatly simplify compile time parsing of strings but has a very steep learning curve.