Re:Coroutines are now in Clang trunk, libc++
by yzmtf2008 on Friday May 26, 2017 @07:18AM
(#14423256)
I think the point of being pythonic is that it's more friendly to the programmers. Bonus point if it's also optimized :)
Re:Coroutines are now in Clang trunk, libc++
by electrograv on Friday May 26, 2017 @07:23AM
(#14423285)
I love seeing the difference between Python and C/C++ coder cultures: To a Python'er, bonus points are given for performance and friendly coding is nearly assumed. To a C++'er, bonus points are awarded for friendly coding, and performance is nearly assumed.
(Even more, I love how we're seeing some convergence here: no-compromise improvements to weak spots on each "side" of the programming language spectrum.)
For example here is a test that verifies the optimized output for a simple (and misnamed) integer generator compiled at -O2. Notice the arguments to `print` are integer literals. (https://github.com/GorNishanov/clang/blob/Experiments/test/C...)
I'm no python expert, but I suspect C++ optimizes this code better.