Discuss Scratch

Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

helloworldp wrote:

I have a suggestion! There are a few hidden blocks in the scratch editor, that don't show up in the menu. You can gain them by modifying an SB3 file you use for your project! You should add them into your text editor! Here, I have uploaded a project containing all of the known hidden blocks.
https://scratch.mit.edu/projects/1174055272/
(Use “See inside” to view the code, and take the blocks.)
That's a good idea – currently, importing a project with these blocks removes them, which isn't ideal. Thanks for the suggestion!
blob8108
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

Maximouse wrote:

blob8108 wrote:

I miss being able to hit cmd+return to trigger the green flag, for even faster feedback when developing :-)
Added!
Nice, thanks!

My current solution is to simply store the text-based code in the project as an additional JSON property for each sprite
If you store the tosh code inside the scratch project — how will you handle importing existing Scratch projects?

tosh automatically renames things in imported projects to fix conflicts
I don't remember doing this at all!

I do remember one of the design goals I had for tosh was to be perfectly inter-compatible with Scratch, in both directions. This led to things like spending far too long writing code to measure the height of Scratch scripts, so they would be perfectly “cleaned up” when you opened the project, rather than all on top of one another.

I do like the idea of allowing you to edit scripts while they're running, that's one of the key limitations tosh has compared to the ethos behind Scratch itself!
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

blob8108 wrote:

If you store the tosh code inside the scratch project — how will you handle importing existing Scratch projects?
When a project is loaded, the editor generates the code for any sprites that don't have it yet. I used the code generator from tosh, with the necessary changes to work with Scratch 3 and a few bug fixes.

blob8108 wrote:

I do like the idea of allowing you to edit scripts while they're running, that's one of the key limitations tosh has compared to the ethos behind Scratch itself!
Another advantage of Scratch is how many languages it's translated into – I think it would be really nice if it was possible to write code using a tosh-like syntax in languages other than English. A lot of the work for each language will probably have to be done by hand (parts of the grammar, the list of reserved variable names), but I think adding at least a few additional languages could be a long-term goal for TB3.
Jonathan50
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

TB3 TB3 TB3 TB3 TB3 TB3 TB3 TB3 TB3





Ehh chances are no one's gonna get the joke. (Unless blob reads this, hi blob) This is pretty hype though
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

I've just pushed some fixes:
  • Changing the UI language no longer breaks the code editor.
  • The “when _ > _” and “when video motion > _” blocks now have autocomplete.
CST1229
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

Jonathan50 wrote:

(#44)
TB3 TB3 TB3 TB3 TB3 TB3 TB3 TB3 TB3





Ehh chances are no one's gonna get the joke. (Unless blob reads this, hi blob) This is pretty hype though
i think i also get it.. it's the “tosh tosh tosh tosh” thing, isn't it

Last edited by CST1229 (May 16, 2025 13:30:18)

Jonathan50
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

CST1229 wrote:

i think i also get it.. it's the “tosh tosh tosh tosh” thing, isn't it
I did not think some of us taking a joke too far and annoying blob up to the release would ever classify as the sort of history ever likely to be rediscovered by later ATers

Last edited by Jonathan50 (May 17, 2025 11:37:51)

blob8108
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

Jonathan50 wrote:

chances are no one's gonna get the joke.
It’s okay, I wrote a whole explainer

Maximouse wrote:

adding at least a few additional languages could be a long-term goal for TB3.
Yes! I really wanted to do this, but never got around to it.

I think it should be possible to automate the trickier parts of the grammar. I think the main thing that has special handling in tosh is the math, I don’t think there’s too much else I had to special-case?

edit: okay wow this thing has more hardcoded than I remembered (and is somewhat inscrutable, a decade on!). Still should be possible to generalise it some more though!

edit edit: oh right yeah there’s also a page with the entire grammar on it (which, fun fact, loads the entire editor? Including the warning, if you’re in Safari, that saving might not work right )

Last edited by blob8108 (May 19, 2025 23:09:16)

mc20000
Scratcher
20 posts

TB3: text-based Scratch 3 (beta)

is there extenoson support yet
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

mc20000 wrote:

is there extenoson support yet
If you mean Scratch extensions: Pen, Music, Video Sensing, Text to Speech, Translate, and Makey Makey are supported. The rest are experimental (see here) – if you have any of the devices that can be connected to Scratch, please test it and tell me if it works.

Last edited by Maximouse (July 3, 2025 05:43:08)

makksi
New Scratcher
1 post

TB3: text-based Scratch 3 (beta)

Could you think to add the possibility to test partial code execution, fo example only one sprite or partial code (for example “selected code”)?

Many compliments for the project!

Last edited by makksi (Sept. 20, 2025 06:13:47)

Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

makksi wrote:

Could you think to add the possibility to test partial code execution, fo example only one sprite or partial code (for example “selected code”)?
That's a very good suggestion – thanks!
B-Jay
Scratcher
10 posts

TB3: text-based Scratch 3 (beta)

It would be nice if there was a professional domain
redspacecat
Scratcher
500+ posts

TB3: text-based Scratch 3 (beta)

B-Jay wrote:

It would be nice if there was a professional domain
I could host it on tb3.quuq.dev or something.
Spy-One
Scratcher
8 posts

TB3: text-based Scratch 3 (beta)

Is there nowarp for custom blocks?
Spy-One
Scratcher
8 posts

TB3: text-based Scratch 3 (beta)

By the way; this is very cool but I noticed documentation is little, there's some but it's outdated it seems and unreliable.
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

Spy-One wrote:

Is there nowarp for custom blocks?
It's the default behavior. If you want the block to run without screen refresh, as they do by default in goboscript, you can use the define-atomic keyword instead of define.

Spy-One wrote:

By the way; this is very cool but I noticed documentation is little, there's some but it's outdated it seems and unreliable.
The docs linked in the original post are from tosh, an older project by blob8108 that TB3's compiler is based on, but they should be mostly accurate. I'll probably make an updated version when the project is more complete.
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

Ubdate: fixed broadcast blocks with a reporter input not being compiled correctly. The following now works, for example:
when flag clicked
set my variable to 1
broadcast join "message" (my variable)

when I receive "message1"
say "message received!"
FurryR
Scratcher
14 posts

TB3: text-based Scratch 3 (beta)

Tosh is not appliable for most projects (yup i mean Turbowarp). Consider using another language that supports better decompilation.
Maximouse
Scratcher
1000+ posts

TB3: text-based Scratch 3 (beta)

FurryR wrote:

Tosh is not appliable for most projects (yup i mean Turbowarp). Consider using another language that supports better decompilation.
I don't understand – what does TurboWarp have to do with tosh or TB3?

Powered by DjangoBB