Discuss Scratch

i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

Using cloud variables and an external server - we can remake scratch-www in scratch, I mean making an engine to render pages (like homepage, profile pages, project pages, etc.) by receiving the scratch API data through cloud variables from an external server (the server would fetch the data and write the cloud variables)
INSERT-USER_NAME
Scratcher
1000+ posts

Re-making scratch-www in scratch

The 256-character limit on cloud variables is sure going to like this one!
i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
INSERT-USER_NAME
Scratcher
1000+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

INSERT-USER_NAME wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.

Last edited by i_eat_coffee (April 21, 2023 15:26:18)

applejuiceproduc
Scratcher
1000+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You do… What about the data the server gives back, like all the comments and the about me etc.

And rendering that stuff is a massive pain.
i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

applejuiceproduc wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You do… What about the data the server gives back, like all the comments and the about me etc.

And rendering that stuff is a massive pain.
Multiple cloud variables for different fields - one for the latest 3 comments, one for the about me, etc.
applejuiceproduc
Scratcher
1000+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

applejuiceproduc wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You do… What about the data the server gives back, like all the comments and the about me etc.

And rendering that stuff is a massive pain.
Multiple cloud variables for different fields - one for the latest 3 comments, one for the about me, etc.
just don't do it.

Also comments can be up to 500 characters, and the about me even more so…
INSERT-USER_NAME
Scratcher
1000+ posts

Re-making scratch-www in scratch

applejuiceproduc wrote:

i_eat_coffee wrote:

applejuiceproduc wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

The 256-character limit on cloud variables is sure going to like this one!
What 256 characters?
The scratch user would set the cloud variable to an encoded username (the username of the user page in the project), and the server will parse the data to be written to cloud variables.
I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You do… What about the data the server gives back, like all the comments and the about me etc.

And rendering that stuff is a massive pain.
Multiple cloud variables for different fields - one for the latest 3 comments, one for the about me, etc.
just don't do it.

Also comments can be up to 500 characters, and the about me even more so…
The “About Me” section has a character limit of 200, comments have a limit of 500.
SuperSonicmario
Scratcher
100+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

Yep, I know. And I'm saying we do not need even 1/6th of it.
Who wuold ever need more than 640 KiB of RAM?
alwayspaytaxes
Scratcher
500+ posts

Re-making scratch-www in scratch

SuperSonicmario wrote:

i_eat_coffee wrote:

Yep, I know. And I'm saying we do not need even 1/6th of it.
Who wuold ever need more than 640 KiB of RAM?
Almost forgot that everyone uses MS-DOS

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You have to encode every text into a number and use seperators to make sure it can be decoded correctly. It adds up
i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

alwayspaytaxes wrote:

SuperSonicmario wrote:

i_eat_coffee wrote:

Yep, I know. And I'm saying we do not need even 1/6th of it.
Who wuold ever need more than 640 KiB of RAM?
Almost forgot that everyone uses MS-DOS

i_eat_coffee wrote:

INSERT-USER_NAME wrote:

I'm saying that cloud variables can only store up to 256 number places.
Yep, I know. And I'm saying we do not need even 1/6th of it.
You have to encode every text into a number and use seperators to make sure it can be decoded correctly. It adds up
“hello” encoded: 0805121215
bigspeedfpv
Scratcher
500+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

“hello” encoded: 0805121215
yeah except this system breaks for any special characters outside the english alphabet
just use ascii?
mybearworld
Scratcher
1000+ posts

Re-making scratch-www in scratch

bigspeedfpv wrote:

(#13)

i_eat_coffee wrote:

“hello” encoded: 0805121215
yeah except this system breaks for any special characters outside the english alphabet
just use ascii?
yeah except this system breaks for any special characters outside the english alphabet
ScratchCatHELLO
Scratcher
1000+ posts

Re-making scratch-www in scratch

you’ve obviously not going to have all of utf-8 (unless you want one letter per ten digits and to make over a million symbols), so you’re going to have to pick and choose. about 100 symbols (two digits/char) should be enough for basic latin and cryllic. 1000 (three digits/char) is enough for a few simpler scripts or the more common emojis. you definitely won’t be including chinese, japanese, and the like if you want to be efficient about encoding.

Last edited by ScratchCatHELLO (April 21, 2023 19:36:15)

davidtheplatform
Scratcher
500+ posts

Re-making scratch-www in scratch

You could probably fit hiragana + katakana with 1000 characters but defiantly not kanji, theres like 40,000 of them
Also doesn't utf use 7 bits/byte for actual data, and the other bit is for whether the next byte is for the same character? that way ascii (which is what most text is) only takes 1 byte/character but you can have more
Also you can change cloud variables 10x/second so each variable can transfer about 1kBps
Roblox888i
Scratcher
1000+ posts

Re-making scratch-www in scratch

Ill help
Redstone1080
Scratcher
1000+ posts

Re-making scratch-www in scratch

ScratchCatHELLO wrote:

you’ve obviously not going to have all of utf-8 (unless you want one letter per ten digits and to make over a million symbols), so you’re going to have to pick and choose. about 100 symbols (two digits/char) should be enough for basic latin and cryllic. 1000 (three digits/char) is enough for a few simpler scripts or the more common emojis. you definitely won’t be including chinese, japanese, and the like if you want to be efficient about encoding.
You could have a system where there's a “Logographic Language Encoding Number” (LLEN) and anything between that and the next LLEN is encoded differently, to save space.
Chiroyce
Scratcher
1000+ posts

Re-making scratch-www in scratch

i_eat_coffee wrote:

What 256 characters?
You've got to be joking. This is the Scratch homepage load stats

i_eat_coffee wrote:

“hello” encoded: 0805121215
encoding doubles the length of input text and adding a separator takes up 2 extra characters as well

You have 128 decoded characters per cloud variable, multiplied by 10 variables is 1280 characters. There is a 0.1 second delay between each update, so the fastest to transfer 1280 characters is 10 * 0.1 => 1 second. Anywhere near the 530kB to be transferred would take more than 8 minutes. Not to mention that rendering isn't even being handled yet.

Last edited by Chiroyce (April 22, 2023 04:58:58)

i_eat_coffee
Scratcher
1000+ posts

Re-making scratch-www in scratch

bigspeedfpv wrote:

i_eat_coffee wrote:

“hello” encoded: 0805121215
yeah except this system breaks for any special characters outside the english alphabet
just use ascii?
It doesn't

It's from 1 to 99, 1-26 being the alphabet, and the rest are other characters, maybe even splitting the uppercase or lowercase characters

Chiroyce wrote:

i_eat_coffee wrote:

What 256 characters?
You've got to be joking. This is the Scratch homepage load stats
-snip-

i_eat_coffee wrote:

“hello” encoded: 0805121215
encoding doubles the length of input text and adding a separator takes up 2 extra characters as well

You have 128 decoded characters per cloud variable, multiplied by 10 variables is 1280 characters. There is a 0.1 second delay between each update, so the fastest to transfer 1280 characters is 10 * 0.1 => 1 second. Anywhere near the 530kB to be transferred would take more than 8 minutes. Not to mention that rendering isn't even being handled yet.
1. Without separator, no need for separator.
2. There is going to be a “load” button on each field

Powered by DjangoBB