Live data from Hacker News

Crow – C++ Microframework for Web, inspired by Python Flask

github.com

11–20 of 65 posts

Re: Crow – C++ Microframework for Web, inspired by Python Flask

#15
post #6

I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.

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 with no .cpp files in the main part of the microframework? Did something force you to do it that way or was it done like that because you like that code structure?

Re: Crow – C++ Microframework for Web, inspired by Python Flask

#16
post #6

I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.

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.

Re: Crow – C++ Microframework for Web, inspired by Python Flask

#17
post #10

I like the technique to generate compile error when there is a mismatch between format string and actual argument list and type - This is what only statically typed language can do and dynamically typed languages like python can't do. Maybe this technique could be applied in printf or other C++ APIs using format string.

Not sure if you're being ironic, but you're describing e.g. GCC's "format" function attribute (https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#...), it makes the compiler verify the arguments for printf() and other format-string functions.

It's not new, it has been in GCC for quite a number of years (not sure how to check this quickly).

UPDATE: I found a list (https://ohse.de/uwe/articles/gcc-attributes.html#func-format) that says format was added in GCC 2.3-3.4 (whatever the range means). GCC 3.4.0 was released on April 18 2004. Now I'm sad I didn't say "ten years" above, as my original hunch was. :)

Re: Crow – C++ Microframework for Web, inspired by Python Flask

#18
post #6

I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.

Took a look at the source code. Noticed

  crow::black_magic::is_equ_p(...)
I haven't yet tried the framework, but I already like you.
Post reply on HN