Scrap is a new block based programming language with the aim towards advanced users. It is written in pure C and mostly inspired by other block based languages such as Scratch and its forks such as Turbowarp.
Warning
Scrap is currently in Beta stage. Some features may be missing or break, so use with caution!
- Faster runtime. The speed is achieved using compilation through LLVM (WIP)
- The addition of separate else if, else blocks (C-end blocks as i call them), which eliminates a lot of nested checks with if-else blocks (i.e. more flexible variant of if-else block in Snap!)
- Variables can have a lifetime, which avoids variable name conflicts and allows to make temporary variables
- Custom blocks can return values and can be used as an argument for other block
- Various string manipulation blocks and bitwise operator blocks
- Data type conversion functions
- More strict checks for [[] = []] and [[] != []] blocks. Now they are case sensitive and will check data type for equality
- Lists are now a data type instead of a different type of variable, this allows nesting lists inside a list (although it's not very convenient as of right now)
- The code runs in a separate thread. This solves some performance issues compared to Scratch
- Modularized interface. Most of the interface can be rearranged or moved to another tab
- (WIP) Standalone builds. Scrap projects can be built and run as native executables without significant runtime overhead
- Click on blocks to pick up them, click again to drop them
- You can use
Ctrlto take only one block andAltto pick up its duplicate - Hold left mouse button to move around code space
- Holding middle mouse button will do the same, except it works everywhere
- Press
Tabto jump to chain in code base (Useful if you got lost in code base) - Press
F5to run the project. PressF6to stop it. - Press arrow keys while the block is highlighted to move the block cursor around
- Press
Enterto enter the highlighted text box andEscto leave that text box - Press
Sto open block search menu
Scrap requires these dependencies to run:
- Raylib (Built in) (Patched to support SVGs) (Needs additional dependencies to build)
- tinyfiledialogs (Built in)
- cfgpath (Built in) (Heavily modified to workaround
windows.hconflicts) - gettext
- LLVM (WIP, only required if building with
USE_COMPILER=TRUEflag)
Currently Scrap can be built for Windows, Linux, MacOS and FreeBSD.
pacman -S mingw-w64-ucrt-x86_64-gcc make gettext
ln -sf "${MSYSTEM_PREFIX}/bin/windres.exe" "${MSYSTEM_PREFIX}/bin/x86_64-w64-mingw32-windres"If you are going to compile with USE_COMPILER=TRUE flag, then you need to install additional dependencies:
pacman -S mingw-w64-ucrt-x86_64-llvmsudo apt install libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev gettextDownload command for arch-based distributions:
sudo pacman -S libx11 libxrandr libxi libxcursor libxinerama gettextDownload command for openSUSE:
sudo zypper install libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel gettextBefore building the repo needs to be cloned along with its submodules. To do this, run:
git clone --recursive https://github.com/Grisshink/scrap.git
cd scrapNOTE: This guide will assume that you have MSYS2 installed and running on your system.
After that, run the following commands:
make -B TARGET=WINDOWS
./scrap.exeNOTE: When running make clean MSYS2 will occasionally drop you into command prompt.
To fix this, just type exit in the cmd and the cleanup process will proceed
To build and run Scrap on linux you need to install gcc and make. After install, just run following commands:
make -j$(nproc)
./scrapTo build and run Scrap on FreeBSD you need to install gcc and gmake. After install, just run following commands:
gmake MAKE=gmake -j$(nproc)
./scrapWarning
MacOS build is not being tested right now, so it may not work properly or not at all, you have been warned!
To build and run Scrap on macOS, you need to install gcc and make.
First, install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After that, you need to run the following commands:
brew install gettext
make -j$(nproc) TARGET=OSX
./scrapThanks to @arducat for MacOS support.
In examples/ folder you can find some example code writen in Scrap that uses most features from Scrap
In extras/ folder you can find some various artwork made for Scrap.
The splash art was made by @FlaffyTheBest,
the logo was made by @Grisshink with some inspiration for logo from @unixource,
the wallpaper was made by @Grisshink
All scrap code is licensed under the terms of GPLv3 license (Subject to change in near future).



