Unsigned dword/qword

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Unsigned dword/qword

Post by wilbert »

Keya wrote::( What did I say that was offensive??? It's a Feature Request or "constructive criticism" at worst! You still haven't given a single reason why it would be beneficial not to be implemented, which surely would be simple if such a reason existed.
It's just one of those requests that come up on a regular base (like OOP).
To work around not having unsigned long and quad is usually not a very big problem but can surely be inconvenient.
I made a request a bit along the line to help working around it http://www.purebasic.fr/english/viewtop ... =3&t=62838 but unfortunately that also hasn't been implemented (yet).
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Unsigned dword/qword

Post by Tenaja »

Keya wrote::( What did I say that was offensive???
This:
Keya wrote:Sorry freak but with all due respect all of your "reasons" sound purely just like "it's too hard for us to do". :( but it's without doubt that Fred is talented enough to implement it, PB speaks for itself there!
The truth is that they have the skills to do it, but it is my impression they have determined that the amount of work does not justify the benefit. Maybe that is another way of saying "it's too hard", but you were whining the way you said it.
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: Unsigned dword/qword

Post by DontTalkToMe »

The truth is
...hard to know. That's why we read a lot of opinions here, and there is nothing wrong with that. Not much useful either, but nevertheless.

Other languages can mix signed/unsigned, and have many other features missing from PB or have similar ones implemented a lot better.
And my opinion is most of them are missing from PB not because they are extravagant or they would be not much useful, but because they are hard to implement in general and especially very hard to ADD to the current PB compiler considering its current state. This come before any other consideration, again in my opinion.
The hints, for who can read them, are in the bug forum.

I didn't consider keya's post whining. It's true the feature request has been already addressed and answered though. If one can consider the answer satisfying or not, it's up to him. But it's an answer.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Unsigned dword/qword

Post by Tenaja »

DontTalkToMe wrote:
The truth is
...hard to know.
Seriously?!?!?! Hard to know if they have the skills?!?!

No, it is not hard to know, if you just pay attention to what they have already accomplished. They OBVIOUSLY have the skills.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Unsigned dword/qword

Post by User_Russian »

Let's say that it is difficult to put unsigned variables due to libraries. But probably add a function Unsigned(expression), similar Bool().

Code: Select all

x.l=0
y.l=$FFFFFFFF

If Unsigned(x<y) ; unsigned comparison.
  Debug "OK"
EndIf
It is not difficult to do and does not require global modifications libraries.
I have already suggested, but it was not done.

Also, pay attention to this topic. If unsigned variables are not added, it is necessary to add a logical shift for signed variables.
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: Unsigned dword/qword

Post by DontTalkToMe »

Tenaja wrote:
No, it is not hard to know, if you just pay attention to what they have already accomplished. They OBVIOUSLY have the skills.
You have your opinion, I have mine based on what I can see on the forum, using the compiler and using other languages.
Please don't try to force yours on me (I don't try to do that to you saying "I know" how things are and you don't) and let's leave it at that.
BTW: I'm not saying they are incompetent or anything like that, just what I said above. And yes, I believe some things are too much for them.
Some things are hard to do, especially for just two people who have to work with a compiler which if written today would have a totally different internal structure for many reasons.
But I don't find realistic to wear a blindfold and ignore what is available in the world beyond PB, where someone else was able to implement what PB lacks.
At least we can talk about it.

Again, I'm with keya, excluding the fact this was already discussed as others have pointed out, but it's not the case to go on the defensive.
Things are what they are, and again, the forum and the compiler output tell me all I have to know to form an opinion about how the compiler is written, and what can be reasonably added to it or not.
I don't need to see its source code to have a general idea. One thing is to respect the work done with PB basically by Fred alone, kudos to him, a gigantic work for one person and a very young one. Impressive and requiring a lot of tenacity and perseverance. There are many good programmers, not many with enough focus an tenacity to pull this off by themselves alone. Crossplatform... 32/64 bits... It's a great accomplishment.
Another is to be blind and don't see PB for what it is, both as a language and as a compiler.

My last post on the subject, unless there is a very valid reason.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Unsigned dword/qword

Post by Tenaja »

DontTalkToMe wrote:
Tenaja wrote:
No, it is not hard to know, if you just pay attention to what they have already accomplished. They OBVIOUSLY have the skills.
You have your opinion, I have mine based on what I can see on the forum, using the compiler and using other languages.
Please don't try to force yours on me (I don't try to do that to you saying "I know" how things are and you don't) and let's leave it at that.
BTW: I'm not saying they are incompetent or anything like that, just what I said above. And yes, I believe some things are too much for them.
Some things are hard to do, especially for just two people who have to work with a compiler which if written today would have a totally different internal structure for many reasons.
But I don't find realistic to wear a blindfold and ignore what is available in the world beyond PB, where someone else was able to implement what PB lacks.
At least we can talk about it.

Again, I'm with keya, excluding the fact this was already discussed as others have pointed out, but it's not the case to go on the defensive.
Things are what they are, and again, the forum and the compiler output tell me all I have to know to form an opinion about how the compiler is written, and what can be reasonably added to it or not.
I don't need to see its source code to have a general idea. One thing is to respect the work done with PB basically by Fred alone, kudos to him, a gigantic work for one person and a very young one. Impressive and requiring a lot of tenacity and perseverance. There are many good programmers, not many with enough focus an tenacity to pull this off by themselves alone. Crossplatform... 32/64 bits... It's a great accomplishment.
Another is to be blind and don't see PB for what it is, both as a language and as a compiler.

My last post on the subject, unless there is a very valid reason.
They obviously have the skills. If you cannot admit that, then you are either naive or a moron. My observation of their skills are the only thing I have stated as fact.

What they do not have is the time and/or interest. I guess that, too, is a fact, because they have stated it.

As for "looking at other languages," there is not one language out there that does not lack something compared to another language. Java does not have unsigned integers, either. C does not have string variables natively (integer arrays are not "native" strings, they are a hack that works).
They ALL lack something. They ALL compromise somewhere.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Unsigned dword/qword

Post by Danilo »

Tenaja wrote:They obviously have the skills.
Well, let's say PB is a 'very special kind of thing'. It started without any study and knowledge of compiler design
and compiler construction - and you could feel that in the earlier years - just by using the product.
Going 'there own way', instead of using known algorithms and ways for building compilers,
results most likely in a very complex code, that may not be easy to change and is hard to maintain.
The resulting product works most of the time, but I think it may have its very own limits
when it comes to extensibility/expandability.
If such a limit is reached, do you expect the team to admit it to public by saying "we are not able to do it"?
It would be a shame, that's why freak talks like he could do everything and reasons for not doing it are other things.
Fred and freak are both humans. I met them in real-life, and they are not super-humans, in my opinion.
Just ordinary coders, but with a good/special talent to turn something into an saleable end-user product.
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: Unsigned dword/qword

Post by DontTalkToMe »

Ok, the valid reason is you continue to talk like you know the truth and there is no space for a different opinion.
Tenaja wrote: They obviously have the skills. If you cannot admit that, then you are either naive or a moron.
I didn't negate that, if you read my post. The skill part, not being a moron I mean. Or naive.
I don't see why you should be entitled to give me a binary choice, there is a third one.
Again you say your point of view is the evident truth. I disagree.

I have already admitted the dedication and constancy (from Fred). The skill is there up to a point. It's not certainly exceptional if you really want to pull it out of my throat. Ok, are you happy now ? Anyway it's my opinion. Stop telling me what I should see to make you happy because I don't see it. I don't see this godlike status many here see. Geez.
Tenaja wrote: As for "looking at other languages," there is not one language out there that does not lack something compared to another language.
Sure. But there are a lot of languages, most of them implement features PB doesn't have and so it shouldn't be a problem to talk about that features and asking for them. Even if probably useless to do it for the reasons I have hinted and you can read in Danilo's post too. Mixing signed/unsigned is a feature PB does not have, while many languages have.
I don't even contest this particularly feature could may have been omitted more by deliberately choice than anything else, something I don't think it's true for most of the rest. That's I think why libraries grows with every version while the language has, from time to time, just very little incremental updates well localized and with minimal impact to the generated code. Nothing major.

And then there is the quality of compilers. If you look at other compilers their quality is vastly superior to the PB compiler.
On every aspect. The quality of the code generated, the lack of the incredibly naive bugs the PB compiler has, the fact they have to parse language constructs 10 time more complex then the simple, linear syntax of PB constructs and yet they do it while in PB syntax choices are often to help the compiler to understand something and not the programmer.
They were made not by one person sure, and by people who has a background in building compilers, but that's not the point.
Their existence is the point.
PB it's a nice product, simple to learn, easy to use, with many problems a lot of people here don't consider problems, and elevated to some ideals of near-perfection I don't think it deserve together with its developers (good as they are up to a point). I would just like to be realist since so few people here are.

To me what I said it's plain evident. And I don't think if you don't see it you are a moron, just a little ignorant about what a compiler is expected to do and how or how a language should be to be consider contemporary and not from the 70s. But it's fine with me. And you can have a different opinion, I just wanted to write mine.
Just don't be upset if when someone who does read that some features are missing just because it was a stylistic choice but was absolutely doable by Fred and co if they just wanted to do it raises some doubts about that. I have a lot of doubts, to be polite.
Danilo wrote:It started without any study and knowledge of compiler design
and compiler construction - and you could feel that in the earlier years - just by using the product.
Going 'there own way', instead of using known algorithms and ways for building compilers,
results most likely in a very complex code, that may not be easy to change and is hard to maintain.
The resulting product works most of the time, but I think it may have its very own limits
when it comes to extensibility/expandability.
That's my point of view too.
Danilo wrote: If such a limit is reached, do you expect the team to admit it to public by saying "we are not able to do it"?
It would be a shame, that's why freak talks like he could do everything and reasons for not doing it are other things.
That's also my view.

Thread asking to be locked now, I suppose.

Yet there no reason, we were just talking about mixing signed/unsigned integers (like it's possible in other languages), when someone started to say everything would be possible if the developers just wanted to and wanted to convince me about that.
But I don't think it's true.
Keya statement (the one considered offensive) it was true at its core, IMO.

OK tenaja, I will not post it here anymore in any case now because all has been said and done so if you want to call me moron a little more feel free :)
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Unsigned dword/qword

Post by Thunder93 »

Everyone posted makes valid points. However this reminds me of a particular idiom 'flog a dead horse.'

OOP support, Unsigned types... It's futile attempts if it hasn't been answered after all this time.

I've asked for bit support, like others had, and nothing came from that either.

The fact of the matter is, you can't make smallest, impressive optimized code with these limitations. Requiring to use the next best thing+ to support.. requiring much larger memory allocation is ridiculous. More memory requirements and processing power.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Unsigned dword/qword

Post by freak »

Keya wrote:
freak wrote:I'm not even going dignify that with a response.
:( What did I say that was offensive??? It's a Feature Request or "constructive criticism" at worst! You still haven't given a single reason why it would be beneficial not to be implemented, which surely would be simple if such a reason existed.
I just don't like it when people imply that the only reason we are not implementing one of their requests must be due to incompetence.

Its a simple design choice. We feel that the usefulness of such types is limited, and the drawbacks (including adding a lot of more corner cases to the language and the compiler, as explained in the other threads) are not worth it. As I mentioned, the designers of the Java language have made the same decision and its a perfectly valid one in my opinion.

Now, you may disagree with that and we respect your opinion. All we ask is that you respect ours as well.
quidquid Latine dictum sit altum videtur
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Unsigned dword/qword

Post by User_Russian »

freak wrote:We feel that the usefulness of such types is limited, and the drawbacks (including adding a lot of more corner cases to the language and the compiler, as explained in the other threads) are not worth it.
But in some cases the need for unsigned variables. It is usually necessary unsigned comparison. What do you think about what I have written above? http://www.purebasic.fr/english/viewtop ... 10#p485110
This is easy to do. Need an an similar function Bool(), but the expression must be considered as an unsigned.
fryquez
Enthusiast
Enthusiast
Posts: 391
Joined: Mon Dec 21, 2015 8:12 pm

Re: Unsigned dword/qword

Post by fryquez »

I think the Dev's made their point clear.

Why nobody creates a topic about the problems caused by missing unsigned integers
and possible workarounds?
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Unsigned dword/qword

Post by skywalk »

For the record, I never thought this is incompetence, but I strongly disagree with comparisons to Java, an OOP language with no pointers and all ByVal referencing?
We can import C libs but NOT Java or C++ libs.
I only want to follow the logic of signed/unsigned C header declares.
How is this a corner case when 2/3 of the constants are defined uint or unsigned long?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Unsigned dword/qword

Post by User_Russian »

fryquez wrote:Why nobody creates a topic about the problems caused by missing unsigned integers
and possible workarounds?
Topics have long were created. http://www.purebasic.fr/english/viewtop ... =3&t=52929
http://www.purebasic.fr/english/viewtop ... =3&t=54966

Several years have passed, but the developers did not react...
Post Reply