Get Started
Install the scar command, create a .scar file, and run it. You can install a release binary without Go, or install from source with Go.
Install the compiler
Download a release binary
Download the binary for your operating system from GitHub Releases . The published release assets include:
| Platform | Release asset |
|---|---|
| Windows (x64) | scar-windows-amd64.exe |
| Linux (x64) | scar-linux-amd64 |
| macOS (Intel) | scar-darwin-amd64 |
| macOS (Apple Silicon) | scar-darwin-arm64 |
On Windows, rename the downloaded file to scar.exe if you want to use the scar command. On macOS or Linux, make the downloaded binary executable and put it somewhere on your PATH.
Check that it starts:
scar versionThe exact version depends on the binary you downloaded. Check the releases page for the current version.
Install with Go
If you have a supported Go toolchain installed, install the command from the module:
go install github.com/ScarfazeCompany/scar-script/cmd/scar@latestMake sure Go’s binary install directory is on your PATH, then check scar version.
Write a first program
Save this as hello.scar:
func greet(name: str) {
print("Hello, {name}!")
}
greet("world")Run the program
scar run hello.scarExpected output:
Hello, world!scar run compiles and runs the source file. It invokes Go to execute generated code, so a Go toolchain must be available on PATH for this command.
Build a native executable
scar build hello.scarChoose the output file explicitly with -o:
scar build hello.scar -o helloOn Windows, use a .exe extension, for example scar build hello.scar -o hello.exe. Building requires Go on the build machine; the resulting executable does not need the ScarScript compiler to run.
Next steps
- Learn ScarScript syntax.
- Read about types and inference.
- Browse the CLI reference and standard library.