m1ten / scratchnative

Convert Scratch3 projects to native executables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scratchnative

Compile scratch3 code to native executables.

Goal

The goal of this project is to safely compile Scratch3 projects to fast, native C++ code.

Used in

Supported opcodes

  • event_whenflagclicked
  • data_setvariableto
  • data_showvariable
  • operator_add
  • operator_substract
  • operator_multiply
  • operator_divide
  • operator_lt
  • operator_equals
  • operator_gt
  • operator_and
  • operator_or
  • operator_not
  • operator_random (TODO)
  • operator_join (TODO)
  • operator_letter_of (TODO)
  • operator_length (TODO)
  • operator_contains (TODO)
  • operator_mod (TODO)
  • operator_round (TODO)
  • control_if
  • control_repeat
  • Extern C functions through procedures_call
  • the rest

How to use

First, you need to build the program using cmake (Look it up if you don't know how).

Program usage:

scratchnative [OPTIONS] [INPUT]

OPTIONS:
    --freestanding: enable freestanding mode (compile without libc)
    -o: set output file

INPUT: input file, defaults to project.json

Limitations

  • Currently, scratchnative doesn't support any kind of graphics.
  • Compile-time errors could be largely improved.

About

Convert Scratch3 projects to native executables

License:MIT License


Languages

Language:C++ 90.2%Language:Python 8.0%Language:CMake 1.9%