Discuss Scratch

ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

Have you ever wanted Scratch to be non-visual, like those other programming languages? No? Just me? Ok… That's what I'm doing anyway.

ScratchLang is a program that lets you code Scratch with text instead of blocks. It is programmed mainly in Python, but if you know other languages, you can program some stuff so people can have more options.

The project is currently being remade in C#, so expect that coming soon.
Screw C#, I'm gonna remake this in C++! The C# version will still be available here. (P.S. The C# version may resume development after I finish the C++ version.)
Never mind, I'm going to finish the C# version first lol

A repo for every version is available below.

All the info you need and more can be found in README.md.

This is a pretty big project, so I'm gonna need other people to help me. I will probably be the only contributor in a while because my code is hard to understand and I've been procrastinating on adding the comments…

If anything keeps you from contributing, just let me know and I'll try to fix it. (Yes, I'll add comments explaining what the code does when I feel like it.)


If you want to download the project or help, here are the GitHub links:
Original Program
C# Version // currently working on this one
C++ Version
Docs Repo
Organization link


Discuss development here, https://scratch.mit.edu/users/ScratchLangOfficial/, or GitHub.

image below is outdated, it will be updated soon



Last edited by ThatCoder77471 (Sept. 25, 2023 19:29:58)



A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

Not so sure about MSYS2, but I can definitely write a GCC version of this for Linux!
ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

wendiner wrote:

Not so sure about MSYS2, but I can definitely write a GCC version of this for Linux!
Okay. I am currently making something, so could you wait until a commit? It will probably come sometime today or tomorrow


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

wendiner wrote:

Not so sure about MSYS2, but I can definitely write a GCC version of this for Linux!
Okay. I am currently making something, so could you wait until a commit? It will probably come sometime today or tomorrow

Absolutely!
uwv
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

why would you write this in c? you have to do string processing so why not something higher level like c++ or yk any other language

i use arch linux (btw) with the linux zen kernel and enjoy writing silly things in silly languages using silly frameworks
wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

uwv wrote:

why would you write this in c? you have to do string processing so why not something higher level like c++ or yk any other language

C is good for CLI applications.
C++ is good for GUI applications.

Sure, it might be slightly easier to interpret the SS files in C++, but that's an unnecessary level of abstraction.
ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

wendiner wrote:

ThatCoder77471 wrote:

wendiner wrote:

Not so sure about MSYS2, but I can definitely write a GCC version of this for Linux!
Okay. I am currently making something, so could you wait until a commit? It will probably come sometime today or tomorrow

Absolutely!
the commit has been made. what are you planning to do?

Last edited by ThatCoder77471 (Sept. 19, 2022 15:47:06)



A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

uwv wrote:

why would you write this in c? you have to do string processing so why not something higher level like c++ or yk any other language
technically, I'm writing this in shell. I was going to write it in c but i realized i suck at c. I don't know about anyone else though


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

the commit has been made. what are you planning to do?

Rather than requiring an extensive folder structure, I plan on using a single-command utility to embed blocks and link assets within one .ss/.ss3 document.
Kinda like a readable source for project.json. It would have similar (if not identical) syntax to your files.

Example:

scratchscript -c source.ss cat-a.svg cat-b.svg meow.mp3 -o project.sb3

The only major difference would be that the .ss document will contain a special header for each sprite that describes things like local variables and default settings (volume, visual FX, etc).
ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

wendiner wrote:

ThatCoder77471 wrote:

the commit has been made. what are you planning to do?

Rather than requiring an extensive folder structure, I plan on using a single-command utility to embed blocks and link assets within one .ss/.ss3 document.
Kinda like a readable source for project.json. It would have similar (if not identical) syntax to your files.

Example:

scratchscript -c source.ss cat-a.svg cat-b.svg meow.mp3 -o project.sb3

The only major difference would be that the .ss document will contain a special header for each sprite that describes things like local variables and default settings (volume, visual FX, etc).
i think i get what you're saying.

/link/to/example.ss
/link/to/fasygdfoas.svg

it will go through the document and get each of them to pack into the .sb3?


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

i think i get what you're saying.

/link/to/example.ss
/link/to/fasygdfoas.svg

it will go through the document and get each of them to pack into the .sb3?

Exactly. No folders, just assets and the sprite source.
ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

wendiner wrote:

ThatCoder77471 wrote:

i think i get what you're saying.

/link/to/example.ss
/link/to/fasygdfoas.svg

it will go through the document and get each of them to pack into the .sb3?

Exactly. No folders, just assets and the sprite source.
what if you try to decompile a .sb3 and there is an asset with the same name as the asset it's trying to extract? I have an idea on how to fix that but im wondering if you have a plan.


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

what if you try to decompile a .sb3 and there is an asset with the same name as the asset it's trying to extract? I have an idea on how to fix that but im wondering if you have a plan.

Just append an incremental number to the duplicate, like how most modern operating systems do it.
If you've already got an image in the directory called “test.png” and you find a different image that's also called “test.png”, just name the second one “test(1).png” or “test-1.png”
ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

wendiner wrote:

ThatCoder77471 wrote:

what if you try to decompile a .sb3 and there is an asset with the same name as the asset it's trying to extract? I have an idea on how to fix that but im wondering if you have a plan.

Just append an incremental number to the duplicate, like how most modern operating systems do it.
If you've already got an image in the directory called “test.png” and you find a different image that's also called “test.png”, just name the second one “test(1).png” or “test-1.png”
i thought of that, but it made me realize that the decompiler will have to change all instances of that asset to “asset2.png” that will be hard to code, for me at least


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



wendiner
Scratcher
100+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

i thought of that, but it made me realize that the decompiler will have to change all instances of that asset to “asset2.png” that will be hard to code, for me at least

Nah, it'd be the user's responsibility to rename the references within the source file.
It wouldn't be too tough to automate, (just gotta edit the filepath within each sprite header that uses the asset), but still not necessary.

Last edited by wendiner (Sept. 20, 2022 03:24:04)

ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

I made the decompiler!!!! So far it can only decompile lists and variables.

For anyone that wants to help or is helping, I can explain the decompilation script if you don't understand it.


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



MagicCrayon9342
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

I honestly think ScratchLang sounds cooler, and can have some interesting logo design choices too

ThatCoder77471
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

MagicCrayon9342 wrote:

I honestly think ScratchLang sounds cooler, and can have some interesting logo design choices too
That's a good idea! Do you want to design the logo?


A Terminal-Based Scratch Programmer for Windows and Linux


Also,
osu!lazer



ISTILLMAKESTUFF
Scratcher
500+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

ThatCoder77471 wrote:

MagicCrayon9342 wrote:

I honestly think ScratchLang sounds cooler, and can have some interesting logo design choices too
That's a good idea! Do you want to design the logo?
Yeah, he's updated with the trends, you got a good choice. (maybe like $cratchScript cos bash?)

Last edited by ISTILLMAKESTUFF (Sept. 21, 2022 01:26:52)


Very first post- https://scratch.mit.edu/discuss/topic/565039/ And no, I am totally not embarassed about it. (Especially the blocks)

MagicCrayon9342
Scratcher
1000+ posts

<ScratchLang()> - Scratch as a Text-Based Programming Language || Open-Source

The logo so far

Last edited by MagicCrayon9342 (Sept. 21, 2022 01:30:20)


Powered by DjangoBB