Discuss Scratch

minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

I have OS Project that I haven't started, and I want it to be able to run in a VM or muti-booted computer. I can't (obviously) muti-boot or run a OS made in scratch in a VM without compiling it first. Is there any compiler that lets me to Convert Scratch to C++?
(Sorry if this is the incorrect format, I'm new to the AT)
9gr
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

this guy done it i think, or use forkphorus project packager to convert it to an application. as far as i know, there isnt a way (there might be one by a better dev like garbomuffin or jeffalo)
edit: see @maximouse 's post, it much better than mine

Last edited by 9gr (March 12, 2021 17:56:32)

Maximouse
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

Instead of converting the project to C++ (which would probably cause it to behave differently), I recommend using HTMLifier to get a HTML file and configuring Chromium to run it at startup. Then you can get something like this.
9gr
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

Maximouse wrote:

Instead of converting the project to C++ (which would probably cause it to behave differently), I recommend using HTMLifier to get a HTML file and configuring Chromium to run it at startup. Then you can get something like this.
just going to add on to this, you can use the turbowarp packager/htmlifier for speed
Greg8128
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

It's possible but not practical at all.
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

bump
9gr
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

Do you want exactly C++?
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

bump
ElsieBreeze
Scratcher
100+ posts

Is it Possible to Convert Scratch to C++?

Converting Scratch to C++ wouldn't make it any easier to run it within a VM / Multiboot it, in fact, it'd probably make it far harder to do.

Your best option would be to convert the project to HTML and create a lightweight Linux image that starts X11 and then the project within a browser (perhaps something minimalistic like https://surf.suckless.org/ )

This would give the illusion of the Scratch OS running as an actual OS, but you'd never be able to convert the Scratch OS to being an actual OS, not even if you converted it to C++.
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

bump
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

bump
9gr
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

minecraftprox101 wrote:

bump
at least reply to the people who posted in the thread its not nice
game_pr0grammer
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

then why not program it in c++ in the first place?
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

9gr wrote:

Do you want exactly C++?
Yes.
9gr
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

minecraftprox101 wrote:

9gr wrote:

Do you want exactly C++?
Yes.
1. Nobody will take a scratch project as an ISO file.
2. Cloud variables will not be accessible.
3. Nobody has made a Scratch to C++ compiler. You have to use an html file on boot.

minecraftprox101 wrote:

I have OS Project that I haven't started,
ore os

Last edited by 9gr (March 24, 2021 07:32:06)

Raihan142857
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

yes, it is possible to convert scratch to c/c++, in theory. you can convert it to javascript using something like turbowarp/forkphorus or leopard, and then you have to convert the js to c; there are four main ways to do this:
  1. Use something like QuickJS, ts2c, or NectarJS to convert the Javascript directly to C
  2. Convert the Javascript to WASM using AssemblyScript and decompile it to C
  3. Convert the Javascript to Python using Js2Py and convert the Python to C using CPython
  4. Convert the js to Lua with castl, then translate the Lua to C

Last edited by Raihan142857 (March 24, 2021 15:30:06)

Aspirus
Scratcher
15 posts

Is it Possible to Convert Scratch to C++?


First you will need to get a debian installation. Goto debian.org and get the netinstall (its important to get the netinstall because we do not need to install any desktop enviroment)

then create a virtual machine and install debian (watch a tutorial maybe) just dont install any desktop environment.

now compile your scratch project using something like htmlifier or turbowarp into a HTML file.

now you need to boot into your debian virtual machine and then install a browser like firefox. then edit ~/.bashrc (this file can contain commands that run on startup) now we put the command startx firefox
make your html document the homepage of firefox
Raihan142857
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

Aspirus wrote:

First you will need to get a debian installation. Goto debian.org and get the netinstall (its important to get the netinstall because we do not need to install any desktop enviroment)

then create a virtual machine and install debian (watch a tutorial maybe) just dont install any desktop environment.

now compile your scratch project using something like htmlifier or turbowarp into a HTML file.

now you need to boot into your debian virtual machine and then install a browser like firefox. then edit ~/.bashrc (this file can contain commands that run on startup) now we put the command startx firefox
make your html document the homepage of firefox
LOL

also for a shortcut go to this link.
minecraftprox101
Scratcher
500+ posts

Is it Possible to Convert Scratch to C++?

Aspirus wrote:

First you will need to get a debian installation. Goto debian.org and get the netinstall (its important to get the netinstall because we do not need to install any desktop enviroment)

then create a virtual machine and install debian (watch a tutorial maybe) just dont install any desktop environment.

now compile your scratch project using something like htmlifier or turbowarp into a HTML file.

now you need to boot into your debian virtual machine and then install a browser like firefox. then edit ~/.bashrc (this file can contain commands that run on startup) now we put the command startx firefox
make your html document the homepage of firefox
That is not my question, convert a scratch project to C++.

Last edited by minecraftprox101 (March 26, 2021 13:17:30)

Raihan142857
Scratcher
1000+ posts

Is it Possible to Convert Scratch to C++?

minecraftprox101 wrote:

-snip-
I already answered your question.

Powered by DjangoBB