C++11 and Boost - Succinct like Python
fendrich.se
C++11 and Boost - Succinct like Python
1–10 of 172 posts
Re: C++11 and Boost - Succinct like Python
#2To me, this post would have been 10X more interesting if there was some elementary benchmarking included. If it's about the same speed as the corresponding Python code, which I'd bet is easier to write for more programmers, then I don't quite see the point being as clearly proven.
If it's 100 times faster (or whatever), then it gives more credibility to the idea of writing code like this in C++ to begin with, and to learning all the new language features that makes it safe while being that much faster than Python.
Re: C++11 and Boost - Succinct like Python
#3 const map> TagDataMap {
{"title" , make_tuple( 3, 30, stripnulls)},
{"artist" , make_tuple( 33, 30, stripnulls)},
...
it will be succinct when the whole type can get reduced to "auto". Python would just do: TagDataMap = {
'title': (3, 30, stripnulls),
'artist': (33, 30, stripnulls),
...
Ord implementation is also crazy: int i = static_cast(s[0]);
return (boost::format("%1%") % i).str();
considering it doesn't even handle different string encodings.I don't want to complain about C++. It's a great language and has its uses. But it's not succinct and it's far away from what scripting languages provide. Claiming otherwise is close to fanboyism. Not being succinct is not a bad thing. There are many other things that C++ does for you that Python doesn't.
Re: C++11 and Boost - Succinct like Python
#4Great post, it's always fun to see the cutting edge of C++ revealed. It's such a strange land. :) To me, this post would have been 10X more interesting if there was some elementary benchmarking included. If it's about the same speed as the corresponding Python code, which I'd bet is easier to write for more programmers, then I don't quite see the point being as clearly proven. If it's 100 times faster (or whatever),…
Re: C++11 and Boost - Succinct like Python
#5Great post, it's always fun to see the cutting edge of C++ revealed. It's such a strange land. :) To me, this post would have been 10X more interesting if there was some elementary benchmarking included. If it's about the same speed as the corresponding Python code, which I'd bet is easier to write for more programmers, then I don't quite see the point being as clearly proven. If it's 100 times faster (or whatever),…
Re: C++11 and Boost - Succinct like Python
#6"you will notice that it is more or less as succinct as the Python code." ??? I hope that this person writes better python than this: const map > TagDataMap { {"title" , make_tuple( 3, 30, stripnulls)}, {"artist" , make_tuple( 33, 30, stripnulls)}, ... it will be succinct when the whole type can get reduced to "auto". Python would just do: TagDataMap = { 'title': (3, 30, stripnulls), 'artist': (33, 30, stripnulls), .…
Re: C++11 and Boost - Succinct like Python
#7Re: C++11 and Boost - Succinct like Python
#8Great post, it's always fun to see the cutting edge of C++ revealed. It's such a strange land. :) To me, this post would have been 10X more interesting if there was some elementary benchmarking included. If it's about the same speed as the corresponding Python code, which I'd bet is easier to write for more programmers, then I don't quite see the point being as clearly proven. If it's 100 times faster (or whatever),…
The program is I/O-bound, so the only speed improvement comes from not having to start up the Python interpreter.
If the task was CPU bound, you would get a great performance boost (sometimes 100x over CPython), but that is well known.
There can be other reasons than performance for writing in C++. Used well, the strong static type system can catch many bugs. I suspect (but I cannot prove) that it could be almost as good as Haskell.
I use Python for most things, though, so I don't really advocating switching to C++ for every little scripting task.
Re: C++11 and Boost - Succinct like Python
#9 cout
I'm sorry, but as "succinct" as it is, this is basically an unreadable bullshit. Reminds me strongly of a macro abuse in C.