Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Linux is finally fully running on Scratch!
- Executec
-
100+ posts
Linux is finally fully running on Scratch!
presumably it's just a list of individual bytes?? writing a converter in cpp rn
- Executec
-
100+ posts
Linux is finally fully running on Scratch!
thanks to the amazing people in the C++ community I found a way to convert it back to bytes:
#include <cstdio>
#include <filesystem>
#include <iostream>
#include <fstream>
int main() {
std::ifstream input_stream("input.txt");
std::ofstream output_stream("output.txt");
for (;;) {
int byte;
input_stream >> byte;
if (input_stream.eof())
break;
output_stream << (char)byte;
}
}
- ScratchcatandGobo
-
1000+ posts
Linux is finally fully running on Scratch!
Sorry I am like 6 months late, but it may be possible to run System 4 (really old Mac OS) on Scratch using a motorola 68000 emulator.None of that is true lolsorry to say,but everyone on scratch uses windows,not linux or anything like that. i bet supercomputers can't run scratch unless their browsers support webgl,which is unlikelyWould be crazy if you could get a full desktop environment working using this. I bet it would require insane amounts of optimization to get it to run at usable speed, however.unless you ran it on a supercomputer, but who runs Scratch on a supercomputer? Besides, most of those already run UNIX-like systems
Honestly, I think it's a cool project and a cool idea. Eventually, though, you're going to run into the project json limit or it's going to lag like hell even on Turbowarp.
Supercomputers generally don't have web browsers at all but there isn't anything preventing you from installing one and running scratch on it, aside from the lack of display outputs
- Executec
-
100+ posts
Linux is finally fully running on Scratch!
the default ROM for the emulator this was based on doesn't seem to work on here…. no output, just a blinking cursor. my conversion script converts back-and-forth just fine, and the ROM used in the scratch project works fine in the native version of the emulator. i don't know what I could do next to try and debug honestly 

- Executec
-
100+ posts
Linux is finally fully running on Scratch!
converter code in full if anyone finds it useful, compiles fine on the latest G++ compiler:
#include <fstream>
#include <iostream>
void convert_to_scratch(std::string input, std::string output) {
std::ifstream input_stream("input.txt");
std::ofstream output_stream("output.txt");
for (;;) {
char byte;
input_stream >> byte;
if (input_stream.eof())
break;
output_stream << std::to_string(int(byte) + 128) << "\n";
}
}
void convert_from_scratch(std::string input, std::string output) {
std::ifstream input_stream("risc.txt");
std::ofstream output_stream("output.txt");
for (;;) {
int byte;
input_stream >> byte;
if (input_stream.eof())
break;
output_stream << (char)byte;
}
}
int main(int argc, char* argv[]) {
std::cout << "Linux on Scratch ROM Converter - easter man 2024\n";
if (argc == 3) {
std::cout << "t - to Scratch\nf - from Scratch\nAnswer:";
std::string conversion_mode;
std::cin >> conversion_mode;
if (conversion_mode == "t") {
convert_to_scratch(argv[1], argv[2]);
} else if (conversion_mode == "f") {
convert_from_scratch(argv[1], argv[2]);
}
std::cout << "Finished!";
} else {
std::cout << "Invalid argument\nCorrect format:\n./converter input.txt output.txt\n";
}
}
- cat-code-crazy
-
2 posts
Linux is finally fully running on Scratch!
noThe limitation is that it takes a lot of time and effort to do so, there isn’t a technical limitation How?! I thought Linux on Scratch was imposssible due to scratch´s inability to make operating systems that arent simulated/fake
You´re quite wrong,just look at Scratch Wiki´s statement.Scratch does not have the capability to create a true operating system.
- BigNate469
-
1000+ posts
Linux is finally fully running on Scratch!
Very late response, but no. -snip-sorry to say,but everyone on scratch uses windows,not linux or anything like that. i bet supercomputers can't run scratch unless their browsers support webgl,which is unlikelyWould be crazy if you could get a full desktop environment working using this. I bet it would require insane amounts of optimization to get it to run at usable speed, however.unless you ran it on a supercomputer, but who runs Scratch on a supercomputer? Besides, most of those already run UNIX-like systems
Honestly, I think it's a cool project and a cool idea. Eventually, though, you're going to run into the project json limit or it's going to lag like hell even on Turbowarp.
The last time I used Scratch on Windows for more than 5 minutes was 2021.
I only use Scratch for any period of time on Linux, ChromeOS (Linux-based), and iPadOS (very far removed from UNIX, but still bears some resemblance).
- leogames2016
-
500+ posts
Linux is finally fully running on Scratch!
You're wrong when i mean everyone uses windows on scratch.Very late response, but no. -snip-sorry to say,but everyone on scratch uses windows,not linux or anything like that. i bet supercomputers can't run scratch unless their browsers support webgl,which is unlikelyWould be crazy if you could get a full desktop environment working using this. I bet it would require insane amounts of optimization to get it to run at usable speed, however.unless you ran it on a supercomputer, but who runs Scratch on a supercomputer? Besides, most of those already run UNIX-like systems
Honestly, I think it's a cool project and a cool idea. Eventually, though, you're going to run into the project json limit or it's going to lag like hell even on Turbowarp.
The last time I used Scratch on Windows for more than 5 minutes was 2021.
I only use Scratch for any period of time on Linux, ChromeOS (Linux-based), and iPadOS (very far removed from UNIX, but still bears some resemblance).
Many people here on scratch uses Windows.
- BigNate469
-
1000+ posts
Linux is finally fully running on Scratch!
I'm willing to bet that you're even wrong about that- many Scratchers use Scratch in schools, and schools, for the most part, don't buy Windows laptops (too expensive, for the most part). They buy Chromebooks and iPads.You're wrong when i mean everyone uses windows on scratch. snip
Many people here on scratch uses Windows.
The world does not run on Windows.
Last edited by BigNate469 (Jan. 16, 2025 15:53:06)
- leogames2016
-
500+ posts
Linux is finally fully running on Scratch!
I'm willing to bet that you're even wrong about that- many Scratchers use Scratch in schools, and schools, for the most part, don't buy Windows laptops (too expensive, for the most part). They buy Chromebooks and iPads.You're wrong when i mean everyone uses windows on scratch. snip
Many people here on scratch uses Windows.
The world does not run on Windows.
Anyone can buy a cheap low end windows laptop to use scratch,and Scratch isn't hardware intensive.
Last edited by leogames2016 (Jan. 16, 2025 16:20:21)
- BreadcatGames
-
1000+ posts
Linux is finally fully running on Scratch!
many people here use linux, especially in the ATs, and not everybody can just go buy a laptop.I'm willing to bet that you're even wrong about that- many Scratchers use Scratch in schools, and schools, for the most part, don't buy Windows laptops (too expensive, for the most part). They buy Chromebooks and iPads.You're wrong when i mean everyone uses windows on scratch. snip
Many people here on scratch uses Windows.
The world does not run on Windows.
Anyone can buy a cheap low end windows laptop to use scratch,and Scratch isn't hardware intensive.
most “cheap” laptops nowadays run chromeOS, which is basically a locked down linux
Last edited by BreadcatGames (Jan. 16, 2025 18:06:39)
- leogames2016
-
500+ posts
Linux is finally fully running on Scratch!
Well,if that's true,i'm the exception..many people here use linux, especially in the ATs, and not everybody can just go buy a laptop.I'm willing to bet that you're even wrong about that- many Scratchers use Scratch in schools, and schools, for the most part, don't buy Windows laptops (too expensive, for the most part). They buy Chromebooks and iPads.You're wrong when i mean everyone uses windows on scratch. snip
Many people here on scratch uses Windows.
The world does not run on Windows.
Anyone can buy a cheap low end windows laptop to use scratch,and Scratch isn't hardware intensive.
most “cheap” laptops nowadays run chromeOS, which is basically a locked down linux
I use an Windows 10 PC with old but still modern components from around early 2010s (at the latest) with a Celeron G530 cpu, Intel HD Graphics (Sandy Bridge) and Realtek PCIe FE Family Controller (RTL8136).
Last edited by leogames2016 (Jan. 16, 2025 19:34:46)
- Discussion Forums
- » Advanced Topics
-
» Linux is finally fully running on Scratch!