Skip to content

Repository files navigation

SlateScript

A modern, elegant programming language with built-in UI framework

SlateScript is a versatile programming language that combines clean syntax with powerful UI capabilities. Write once, run everywhere - from console applications to native GUI apps with the built-in Slattery UI framework.

Disclaimer

This project is in its beta stage expect lots of bugs!

Features

  • Clean, Intuitive Syntax - Simple and readable, designed for productivity
  • Built-in UI Framework (Slattery) - Create native GUI applications using CSS-like styling
  • Package Manager (SLIT) - Manage dependencies and extensions
  • Rich Type System - Strings, integers, floats, and booleans
  • Control Flow - if/elif/else statements and loop for iteration
  • Functions - User-defined functions with parameters
  • Expression Evaluation - Full arithmetic and comparison operators
  • CSS Styling - Style your UI components with .sts files
  • Developer Tools - Built-in devtools panel for debugging and inspection

Installation

From Source

git clone <repo>
cd slatescript
cargo build --release
sudo cp target/release/slate /usr/local/bin/

Beware that this is an experimental release and most features are yet to come

Making a new file

  • To make a new slatescript file type the file name with the extension .st

Print Statements

write("Hello, World!")

Variables

make name = henry
make age = 20

Functions

func greet<name> {
    write("Hello, " + name + "!")
}

greet<"world">

Control Flow

make age = 20

if <age >= 18> {
    write("You are an adult")
} elif <age >= 13> {
    write("You are a teenager")
} else {
    write("You are a child")
}

Loops

loop 5 {
    write("Iteration")
}

Expressions and Maths

make result = 10 + 20 * 3
make is_equal = (5 + 5) == 10
make message = "Hello " + "World"

i

// Counted loop
loop 5 {
    write("Iteration")
}

// Loop with counter variable
loop 10 with i {
    write("Number: " + i)
}

How to run .st Files

you can run using the executable by specifying the path

slate.exe run (yourfile.st)

or installing it via path by

slate run (yourfile.st)

How to install to path?

# Add to User PATH (doesn't need admin)
$SLATE_PATH = "C:\Users\$env:USERNAME\SlateScript\target\release"

[Environment]::SetEnvironmentVariable(
    "Path", 
    [Environment]::GetEnvironmentVariable("Path", "User") + ";$SLATE_PATH",
    "User"
)

# Restart terminal and test
slate --version

About

A new experimental programming language built from scratch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages