Огни
Or what
~Screenshots
Tokin
He's asking what have you achieved coding in C++ alone right?
Mar!o
were is Rust :(
Огни
Omg python has owertaken c++...
crt
java and c still be highest
Pavel
Well, for me it gives roughly same results each time on MSVC, there are fluctuations but trend is observable.
Pavel
Well, yes, results are pretty chaotic
Pavel
Well, that explains everything. But that's sad that it's difficult to measure effect of such things.
Огни
MVSC Compiler or MINGW compiler?
Anunay
Former
Dima
clang
Anunay
clang
This best
Anunay
But out of the two, mvsc
Dima
yeah I ain’t kidding
Anunay
NOOOO
Mingw over mvsc?
Anunay
Clang is the best, I agree
Anonymous
MinGW SUCKS
Dima
Mingw over mvsc?
the hard choice tho
Dima
But out of the two, mvsc
out of two, none:D
Dima
intel one lmao
Anonymous
Lol
Anunay
Patrick
Apologies in advance for this complicated garbage: union { double num; uint64_t u64 = 0xfffc000000000000; struct { bool isSimple : 1; uint16_t qNaN : 12; uintptr_t ptr : 48; } tags; struct { uint64_t : 40; char s08 : 8; SimpleValType type : 8; } simple; } as; Why isn't isSimple true when u64 is definitely that value at runtime? I suppose unions and bitfields don't work the way I expect
Patrick
Maybe bitfields go from top-to-bottom as right-to-left in binary? Edit: nope, because I can put isSimple either end and it's not true
Patrick
I think I've figure it out - it's backwards and you can't use bool
Anonymous
https://paste.debian.net/1157073/ i wrote this to specifically test short circuit evaluation when the expression involved is a comparison between two floats (use ctrl+f CUSTOMISE HERE to customise the probabilities)
Anonymous
however, it seems you were right. bitwise is faster than logical for this type of expression, even when 100% of the tests fail at the first short-circuit point. i tested as many compilers and optimisation levels as i could. the result is consistent and the difference is staggering (double to ten times slower when using &&).
Anonymous
also tagging @lightness_races_in_orbit
Wei
Indolent
string s(1, str[5]) // What is this line doing?
Indolent
Assume str is a string
tyoc213
/get cbook
tyoc213
/get cppbookguide
tyoc213
What would be a fast refresher/updater to current (guess 2018) C++ ways???? I have learned C++ like 10 years a go and want to get "up to date"
olli
I noted that MSVC generates different disassembly for these two cases: https://godbolt.org/z/bsn93G As far as I know conditional jumps are bad for branch predictor and unnecessary conditional jumps are better to be avoided. In this case I expected that the compiler will not do short-circuit evaluation because it's only float comparisons (shouldn't they be simple enough?). Can someone explain why the compiler didn't get rid of the jumps and didn't make it the same with the second variant? Does the second variant have some disadvantages?
I would argue the compiler is not allowed to, [expr.log.and] guarantees "the second operand is not evaluated if the first operand is false". Looking at [intro.abstract] one could argue the compiler is allowed to evaluate the second operand as well if it does not have any side effects. The compiler use the UCOMISS instruction, according to intel this "[...] instruction [...] signals an invalid-operation exception when a source operand is an SNaN." Hence the second operand has a side effect and cannot be evaluated. According to quick bench the bitwise and is faster unless the exception is triggered in which case the logical and is faster.
Exp(i \theta)=cos(\theta)+isin(\theta)
I have written a kennel module. (In /proc)This module supports read and write. Now I write some userland code to read or write from it. Why do I have to execute it with sudo
Pavel
however, it seems you were right. bitwise is faster than logical for this type of expression, even when 100% of the tests fail at the first short-circuit point. i tested as many compilers and optimisation levels as i could. the result is consistent and the difference is staggering (double to ten times slower when using &&).
We discussed it earlier with Madhu in this chat that he had different results in his tests, and also one colleagues tested it in wandbox and results there were almost reverse (no difference where my tests shown big difference, and logical AND faster 3 times when the check almost always fails). So as Madhu said earlier it is dependent on different factors including the processor architecture and prediction algorithms used in it.
tyoc213
> i have learned C++ like 10 years ago So what do you know about C++?
Classes, generics, templates... But AFAIK things have changed... So want to update
tyoc213
Anonymous
https://en.cppreference.com/w/cpp/compiler_support
I don't think that it's the fastest way😂
Anonymous
Classes, generics, templates... But AFAIK things have changed... So want to update
You can try Modern and Effective C++ book by Scott Mayers
tyoc213
Thought I was thinking more of a if you want to do this or use this feature here is the example instead of a whole book, but will do
tyoc213
:)
Anonymous
C++11 is a huge update which changed the way people write C++ code
Anonymous
Same thing with C++20
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
C++23 will do it
MᏫᎻᎯᎷᎷᎬᎠ
really Even after concepts, compiler's error messages still sucks
tyoc213
hehe, thx people
MᏫᎻᎯᎷᎷᎬᎠ
hehe, thx people
You're welcome
Artöm
What will change it?
Artöm
Reflection is far from standartization
MᏫᎻᎯᎷᎷᎬᎠ
Reflection is far from standartization
My statement reflections were regarded But here You have Standard modular library Contracts Pattern matching
Artöm
I thought pm is also not done
MᏫᎻᎯᎷᎷᎬᎠ
coroutines standard library
Artöm
coroutines standard library
Thats a thing we need
MᏫᎻᎯᎷᎷᎬᎠ
I thought pm is also not done
There is a library out there It's very possible it will be included
Artöm
There was core language proposal
MᏫᎻᎯᎷᎷᎬᎠ
Here you just have some std::ranges with module system which possible won't be applied to much of the existing projects as I don't hope that
MᏫᎻᎯᎷᎷᎬᎠ
And creepy concepts hahah
MᏫᎻᎯᎷᎷᎬᎠ
Artöm
Like?!
wg21.link/P1371
Artöm
Syntax is alienating but powerful
MᏫᎻᎯᎷᎷᎬᎠ
wg21.link/P1371
Oh Yeah you meant that
MᏫᎻᎯᎷᎷᎬᎠ
I wonder if it will exhaustive
MᏫᎻᎯᎷᎷᎬᎠ
It's hard to implement hahah
Artöm
Yep. I do not believe a library will be sufficient
Artöm
As hard as concepts maybe