Discuss Scratch

45afc4td
Scratcher
100+ posts

64-bit integers

Bu!mp
imfh
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

AFNNetworkK12 wrote:

No support. Scratch is supposed to be simple, that would be confusing to younger people.
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow?
Are you sure you mean unsigned integers? I think that people would find it pretty confusing if Scratch no longer supported negative numbers.

If Scratch started using 64 bit numbers rather than JavaScript's native double floats, not only would the large number of projects which rely on Scratch using the same number type break, Scratch would also become much slower.

All the new operators such as shift <<, assignment operators += ^=, and numeric or | used in your examples would cause extreme confusion for those new to programming(who Scratch is largely targeted at). If they were to be added to Scratch, they would need to be hidden away somewhere like an extension to prevent cluttering the operator pallet.

45afc4td wrote:

qucchia wrote:

These blocks seem like they would only be used in very specific cases, and so wouldn't be a very useful addition.
I think the best thing you can do is make some custom blocks that do the operations.
Custom blocks don't return values, they only themselves perform actions so they will further bloat the code.
It's really easy to make custom blocks return values. It might be a little bit messy, but it works perfectly fine.

define (a) ^ (b)
set [return v] to [1]
repeat (b)
set [return v] to ((return) * (a))
end

Return Statement ::grey hat
set [return v] to [] // Stop a custom block and return to
stop [this script v] // the calling code with a value
45afc4td
Scratcher
100+ posts

64-bit integers

imfh wrote:

Are you sure you mean unsigned integers? I think that people would find it pretty confusing if Scratch no longer supported negative numbers.

If Scratch started using 64 bit numbers rather than JavaScript's native double floats, not only would the large number of projects which rely on Scratch using the same number type break, Scratch would also become much slower.
The suggestion isn't for 64-bit integers to replace doubles. The suggestion is for 64-bit unsigned integers to be available alongside. If you take a look at the suggestion blocks, they are not the variable set blocks, they are their own type which always stores 64 bits. An array of four is 256 bits, and so on.
no8pupil
Scratcher
72 posts

64-bit integers

define <@greenFlag clicked?>
45afc4td
Scratcher
100+ posts

64-bit integers

no8pupil wrote:

define <@greenFlag clicked?>
Uh, what? This is off-topic to the suggestion.
imfh
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

imfh wrote:

Are you sure you mean unsigned integers? I think that people would find it pretty confusing if Scratch no longer supported negative numbers.

If Scratch started using 64 bit numbers rather than JavaScript's native double floats, not only would the large number of projects which rely on Scratch using the same number type break, Scratch would also become much slower.
The suggestion isn't for 64-bit integers to replace doubles. The suggestion is for 64-bit unsigned integers to be available alongside. If you take a look at the suggestion blocks, they are not the variable set blocks, they are their own type which always stores 64 bits. An array of four is 256 bits, and so on.
Would this add another set of variable and list blocks underneath the existing ones? I think you should clarify that this is adding new blocks using 64 bit arithmetic in the original post. It isn't immediately obvious which I think is leading to some confusion.
Nambaseking01
Scratcher
1000+ posts

64-bit integers

Hey, if you think I'm being offensive here, I've thought about this and it might be worth adding this as an extension but not as an original feature. Thank you.

Alright, let me just make this clear. These are too complicated for Scratch. 75% of the people on here don't know what it means. Scratch is targeting the younger audience.

I know the last time I told you this you just said “People with binary wisdom have a vast knowledge of this!” but a lot of people don't even know what binary is! I was looking at the Scratch Statistics yesterday, and the most people on here are 12-year-olds. Seventh grade. As far as I know, I'm in fifth grade and my teacher hasn't even mentioned the word “binary”, “integer”, and “64-bit” in the classroom. Belgium is rated number two for countries with most peaceful education, so no. I'm not going to learn what this is for a loooong time.

There is no point in making arithmetic and professional conversations on this, it's complicated and that's all.
45afc4td
Scratcher
100+ posts

64-bit integers

Nambaseking01 wrote:

Hey, if you think I'm being offensive here, I've thought about this and it might be worth adding this as an extension but not as an original feature. Thank you.

Alright, let me just make this clear. These are too complicated for Scratch. 75% of the people on here don't know what it means. Scratch is targeting the younger audience.

I know the last time I told you this you just said “People with binary wisdom have a vast knowledge of this!” but a lot of people don't even know what binary is! I was looking at the Scratch Statistics yesterday, and the most people on here are 12-year-olds. Seventh grade. As far as I know, I'm in fifth grade and my teacher hasn't even mentioned the word “binary”, “integer”, and “64-bit” in the classroom. Belgium is rated number two for countries with most peaceful education, so no. I'm not going to learn what this is for a loooong time.

There is no point in making arithmetic and professional conversations on this, it's complicated and that's all.
You could as well say this about many things that occur in programming.
zhuoranma2006
Scratcher
100+ posts

64-bit integers

AFNNetworkK12 wrote:

No support. Scratch is supposed to be simple, that would be confusing to younger people.
This is to be an extension.
Nambaseking01
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

You could as well say this about many things that occur in programming.

Last time I heard, a lot of programming languages other than Scratch are not meant for children. And Scratch is meant for children.
45afc4td
Scratcher
100+ posts

64-bit integers

Nambaseking01 wrote:

45afc4td wrote:

You could as well say this about many things that occur in programming.

Last time I heard, a lot of programming languages other than Scratch are not meant for children. And Scratch is meant for children.
How are non-Scratch programming languages NSFW?
CatsUnited
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

Nambaseking01 wrote:

45afc4td wrote:

You could as well say this about many things that occur in programming.

Last time I heard, a lot of programming languages other than Scratch are not meant for children. And Scratch is meant for children.
How are non-Scratch programming languages NSFW?
I think what they were trying to say is that most programming languages aren't designed with the primary intention being “kids have to be able to understand this”, but rather “our language is designed to be powerful (e.g multi dimensional arrays, bitwise operators, classes and objects etc.)”
Nambaseking01
Scratcher
1000+ posts

64-bit integers

CatsUnited wrote:

I think what they were trying to say is that most programming languages aren't designed with the primary intention being “kids have to be able to understand this”, but rather “our language is designed to be powerful (e.g multi dimensional arrays, bitwise operators, classes and objects etc.)”

Thank you so much for explaining! I would have died.

The point is, I don't see a lot of people who have been in other programming languages and then come to Scratch (only about 45%) so maybe as an extension but not as an actual feature.
Nambaseking01
Scratcher
1000+ posts

64-bit integers

Bump - this needs more discussion to see if this has to become an extension or not. I would like to see the answer.
45afc4td
Scratcher
100+ posts

64-bit integers

Interesting how extensions went from being used exclusively for exotic devices in 2.0 to adding programming concepts in 3.0.

Last edited by 45afc4td (Dec. 24, 2019 06:42:43)

CatsUnited
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

Interesting how extensions went from being used exclusively for exotic devices in 2.0 to adding programming concepts in 3.0.
True. I might this may be attributed to there being quite a few extensions that are useful for more than just people who own some weird Arduino-esque device. The pen and music components were originally classified as standard blocks but are now listed as extensions, and there are other extensions such as Text to Speech that pretty much everyone can use. I doubt that a concept like the one you're suggesting will be added to Scratch in any form, though once the ST (hopefully) releases third party extensions for Scratch 3, there's quite a high chance that more advanced programming concepts will be introduced into Scratch through the use of such extensions.
Nambaseking01
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

Interesting how extensions went from being used exclusively for exotic devices in 2.0 to adding programming concepts in 3.0.

I know, there was a sudden burst of extensions that was just normal code… :P
rj8wjeiw
New Scratcher
10 posts

64-bit integers

That's one of the biggest reasons for programmers to switch from Scratch to C++. But wouldn't these features in Scratch be a copyright infringement of C?

imfh wrote:

Are you sure you mean unsigned integers? I think that people would find it pretty confusing if Scratch no longer supported negative numbers.

If Scratch started using 64 bit numbers rather than JavaScript's native double floats, not only would the large number of projects which rely on Scratch using the same number type break, Scratch would also become much slower.
I'm afraid you're misunderstanding what integers are already. They don't store fractional values and THAT is the main reason it should be separate (like the suggestion) and not replace doubles.

Apparently this would certainly run awful in 3.0 (displaying the numbers as decimal itself is the worst operation) as someone said apparently JavaScript only uses doubles like Scratch does, no ors, ands, xors, nots, etc. so if anything this should be a 4.0 or up feature when Scratch gets moved to a language with unsigned 64-bit integers.

Last edited by rj8wjeiw (Feb. 15, 2020 15:06:59)

rdococ
Scratcher
1000+ posts

64-bit integers

Personally, I think Scratch should represent numbers internally as exact fractions, with a numerator and a denominator. This would fix most problems with floating point precision, but it might incur a performance penalty when they need to be simplified.
rj8wjeiw
New Scratcher
10 posts

64-bit integers

rdococ wrote:

Personally, I think Scratch should represent numbers internally as exact fractions, with a numerator and a denominator. This would fix most problems with floating point precision, but it might incur a performance penalty when they need to be simplified.
First of all, this would break existing projects using doubles. Also, it makes operations that are important in double arithmetic (sin, cos, tan, sqrt, log, etc.) undefined, making it impossible to take advantage of the exact representation. It would also be extremely costly to display such numbers, and in the end would lead to confusion.

The suggestion is: Keep doubles in variables, and add uint64_t variables and uint64_t arrays to make programming more enjoyable rather than copying JavaScript.

Powered by DjangoBB