« first day (1533 days earlier)      last day (1302 days later) » 

9:35 AM
I had an error message similar to this about "call of overloaded ~~~ is ambiguous" It would seem the actual problem is their is no constructor that takes the arguments I'm trying to pass. So why does it say ambiguous instead of "doesn't exist"? Is this a common catch for C++? github.com/wbhart/mpir/issues/254
 
nah, this is about integer conversions
if you have overloads for other integer types it will consider conversions
if 2 or more conversions have the same "conversion score" thingy then it's ambiguous
 
So I'm trying to construct a gmp_class object from type unsigned long long. How can this be done without ambiguity?
 
nwp
@iyop45 This is one way to do it. There might be better ways.
 
@northerner well the docs say "Construct an mpz_class. All the standard C++ types may be used, except long long and long double"
 
This gives an ambiguity error
const unsigned long long x = 18;
mpz_class y(x);
but if unsigned long long is replaced with int it works fine
 
9:40 AM
yeah, because there's an overload for int and one for long apparently
does the platform you're on even make a difference between long and long long?
 
ok I didn't see that part of the doc
what's the easiest way to check?
 
check sizeof(long) and sizeof(long long)
 
size of long: 4 size of long long 8
 
so you're on windows? too bad :P
 
What is Linux's?
 
9:44 AM
on 64 bit linux it's 8 and 8
I think 64-bit windows is the only one that kept long at 4
 
sucks
hmm going to have to do some refactoring
 
 
1 hour later…
11:13 AM
@sidd.v29 a) the latter is a C style cast technically so it could cast away or hide serious issues like narrowing. B) the former is easier to find if you're searching with tools because it doesn't look like a constructor
 
 
2 hours later…
user13415013
1:15 PM
Just came to ask question, Will julia replace c++ in future?
 
user13415013
as good syntax as python, as fast as c++,
 
@nerd we aren't fortune tellers
 
user13415013
I wanted to learn robotics, but found c++ is godfather,
but c++ is jibrish to me ,
 
user13415013
@PeterT just dont mind, why you are using c++?
 
because it suits my needs the best. High performance image processing and image synthesis
no other language has the ecosystem with it
even if I chose another language, I'd still have to use C or C++ for shaders or CUDA
 
user13415013
1:21 PM
Thanks for information.
 
user13415013
I am also interested in image processing and computer vision
 
well if you just want to prototype algorithms for it python and MATLAB are fine
 
@nerd unlikely, the claims of "As fast as" rarely pan out (and based on my research, haven't yet for Julia). Also migrating code is expensive. There are somethings some languages just don't do well.
 
Hi, I'm new to Cpp applications. Attempting to dockerize build process and having trouble. Please see this posting and let me know your suggestions/inputs. Thank you for your time and help!! stackoverflow.com/questions/63992485/…
 
user13415013
1:40 PM
@Mgetz, Thanks for informations, but that means, i have to stick to learn c++ , horrible syntax.
 
@nerd no you don't
you can learn whatever you want
 
user13415013
Although i asked this question many times
Why wouldnt c++ change its syntax to python like ,
Yes migrating is problem, how about building this idea on side and giving time on old side
 
@nerd why don't you just look at how minor the changes between python 2 and 3 were
and look at how that turned out
maybe there's some lessons to be learned in there if you really think about it
 
@nerd because syntax is syntax and python isn't a panacea. It actually has serious issues that were so bad they created a versioning crisis. C++ tries not to break backwards compat
 
if you need to break backwards compat, just make a new language
 
user13415013
1:44 PM
@PeterT, yes python 2 people still used and python recently stopped making products.
 
user13415013
Yes, I would like to see if this happens in c++ to be more pythonic or more easier as possible to write.
 
just choose another language if the syntax is a deal breaker
no one is saying "you can't write julia", if you like it, use it
 
user13415013
yes , :)
 
user13415013
but c++ acutally i am fan
 
nwp
In my experience the syntax doesn't matter. You get used to it after a month. Also I don't consider Python to have significantly better syntax.
If you really wanted to you could write a compiler from Pythonic-C++ to C++. It's just syntax, shouldn't be that difficult. But I bet you will see that it just makes no difference and you may as well just write C++.
Arguably there have been multiple C++ fixes, most notably D and Rust. They are ok, but haven't managed to replace C++ (yet).
 
2:00 PM
I would say rust is having the most success
but it has serious issues with Cargo I don't think they've reckoned with yet
 
@nwp uff
I agree with the first two statements, but strongly disagree with the last. Man is C++ ugly. So much unnecessary noise
 
nwp
Like what?
 
; {
 
nwp
Knowing the fuckery that is JavaScript I value the ;. And knowing the constant pain that is errors due to whitespace differences I value the {}.
But sure, just replace "\n" with ";\n" and the first step of Pythonic-C++ is made.
 
I program since 6years in Python and I never had a whitespace error, except when debugging students code at uni which for the first time program in their life. And yes JS is grose
 
2:04 PM
@Hakaishin if you knew how powerful operator } was you'd change your opinion ;)
 
@Mgetz for example?
 
nwp
That was more of a joke and doesn't really apply. You could have the same power without writing it.
 
lol, you mean with :D
 
being able to explicitly define scope is an incredibly useful tool
@nwp technically no, because you can't do mid function blocks without using a loop or if statement
at least without blocks
 
2:06 PM
like with open(foo) as f:
print(foo)
 
nwp
^ That's basically the same thing.
 
Does that have exception guarantees?
can that handle multiple items?
 
yes and yes
 
the most bonkers thing of all is the variable scoping of python
 
or do you end up with massive with indenting
 
2:07 PM
you mean the best thing :)
no you can all put them on one line
 
nwp
Nah, Python scoping has screwed me over so many times too. It's infuriating.
 
scoping is critical for C++
 
@nwp same
 
nwp
I'm sure it gets better when you actually know the rules and stop treating it like pseudo-code that runs.
 
lol. It's just function scope not block, easy no?
 
2:08 PM
the fact it's block scoped is incredibly intentional
 
@nwp xD
 
@Hakaishin that has serious side effects
but still better than Perl
 
nwp
It's the fact that sometimes variables are local and sometimes global and they change their scope depending on if you read or write.
 
I can't believe in 2020 there is no simple fast GUI solution to tweak some params in C++. stackoverflow.com/questions/4655824/… This is just sad
Or do you guys know some? Which doesn't have me compile half the country
 
@Hakaishin any modern version of Qt? or WinUI?
 
nwp
2:10 PM
C++ is a statically typed language. Whenever you don't know the type of something C++ doesn't work so well.
Python doesn't have that issue. It has the issue of being horribly inefficient instead because it doesn't know what the type of anything is.
 
@Hakaishin I don't quite understand the problem, are you re-inventing Qts *.ui or *.qml
 
@PeterT AFAIK they didn't exist 9 years ago when that question was asked
 
nwp
Actually I don't understand it anymore either. I thought it was about dynamically adding variables of unknown type, but apparently it's not.
 
user13415013
@nwp, putting backward compatibility on aside, there are other language like julia have not explicit datatype and also is dynamically typed. And performance is as better as c, but why would it be changed?
 
user13415013
But i was thinking , What makes C++ blazingly fast than python, yes it is compilar things, but
 
nwp
2:17 PM
I don't know anything about Julia. Sounds like magic to me. Either you know the type of stuff and can use this information or you don't and can't.
 
@nwp I mean JS vms internally keep track of types and aren't that slow compared to python
 
nwp
The difference is that when C++ sees a + b it knows that a is an int and b is an int and that you can implement the operation with an add instruction which the compiler will use, unless it finds a better way in context.
 
user13415013
@Peter Yes JS but not as fast as c++ or c.
 
nwp
When Python sees a + b it has no clue what types a and b are, has to look them up, at runtime decide how those can be added and do it. I'd guess that's somewhere between 10 to 100 times the instructions. And Python has no chance to look at context and decide that maybe there is a trick to be used.
I kinda got used to TypeScript. It's a pretty neat language, but the fact that it gets compiled to JS severely holds it back. I think there are ways to use types better than C++ currently does.
 
I think Tim Sweeney's right about types twitter.com/TimSweeneyEpic/status/1307778368562171904
 
nwp
2:22 PM
For example I don't understand anymore why void f(int i) { i %= 10; char c = i; } causes a warning that you're truncating an int. You're clearly not. Compilers should know that.
 
they're a proxy for the kind of checking we want, they're a good first approximation, but not the ideal
I guess C++ contracts was trying to approach that, but they're also not a very good implementation. To get that a little more right, we really do need another language, and not bolt it onto C++
 
nwp
For me it's more about expressiveness than error checking. The error checking works ok most of the time. It's being able to say certain things that the language just doesn't allow that holds it back. And I can see a language emerging that can express more and will be faster because of it.
 
for sure, you see it in C sort versus C++ sort. And I agree that C++ isn't the end of the line by a long shot
 
user13415013
Guys what if c++ developers changed their mind and make c++ as pythonic as possible and accept Python zen rule.
 
nwp
They'd switch to Python and leave C++ alone. I hope.
Let me say something provocative too: What's the point of wasting time on Python when TypeScript exists?
 
2:32 PM
heh, full agreement from me on that one
 
@nwp loooool
Like Typescript could ever compete with Python. It's fine. But python is way better
 
user13415013
I personally feel when there is microsoft, you should stay away from that
 
nwp
Semi-serious question. I've grown to like TypeScript and despise Python. The lack of types just makes everything so difficult.
 
@PeterT that's pretty much the philosophy behind concepts
 
@Mgetz I think he was more talking about something even more powerful than concepts+contracts would be in C++
 
user13415013
2:37 PM
ok guys , lastly I am excersing to learn c++ .
 
@nwp Just let go. You will have a lot of fun with Python
 
nwp
I'm still using Python and it's just not working out for me.
Currently I'm trying to figure out how protobuf's oneof is implemented in Python and ... it's not obvious, there is no auto-complete allowing me to explore what members an object has and I'm reduced to run a test, print dict(obj), run the test again with dict(obj.member), get completely lost and give up.
 
user13415013
If someone make brainf*ck like programming langauge.
 
user13415013
Why not make c++ adopt zen principle
 
user13415013
There must be nerds working on such projects
 
nwp
2:41 PM
I don't know what that principle is and I wouldn't be surprised if most of those are already applied.
 
@nwp are you using pycharm?
are you using a debugger?
 
nwp
No, I'm using IDLE which is part of the problem. Supposedly Eric is the IDE to use, but I don't even have the rights to install it which is another problem.
 
IDLE, wow no wonder your python experience is bad. IDLE is terrible. Start using a proper ide like pycharm professional or even community is good
 
user13415013
@Hakaishin, what would you recommend me to use for c++ ide?
 
user13415013
that CLion seems perfect, but it is not free :(
 
2:43 PM
clion, yes
jetbrains is amazing in general
 
user13415013
yeah i use pycharm and starting to learn c++ , found clion but afraid that it has not community version
 
nwp
Qt Creator is ok, Visual Studio is ok, Visual Studio Code probably too. You need to set some plugins to make proper use of them. Clangd and clang-format help a lot.
I never used CLion, but supposedly it's good as well.
 
user13415013
I wanted to use visual studio but i dont want propetiary things, except from jetbrains.
 
nwp
I would not recommend Eclipse or ... what was the other one? Netbeans? Also code::blocks. Those you have to screw around with a lot before they become even semi-usable.
 
user13415013
but i really want cLion but it is not free.
 
nwp
2:49 PM
Welp, you got your Christmas wish.
 
@nerd that's the world
and I'm furious neither eigen nor c++ has a deg2rad and rad2deg function
 
user13415013
That Pytorch framework only support c++ and python. I had to go with c++ anyway
 
nwp
3:12 PM
Why would you just ignore my provocative statement? :(
 
work :D In case you meant me :P
 
nwp
Darn. And we could have figured out which language is the best once and for all. Oh well.
 
Hehe, love me some good nipple wars, but only from time to time and moderately :P
 

« first day (1533 days earlier)      last day (1302 days later) »