Skip to content

GScriptModern G-code Alternative

A human-readable, type-safe language for CNC programming with built-in safety, validation, and optimization

Quick Example ​

Here's a simple GScript program that drills three holes:

gscript
tool drill_3mm {
    diameter: 3.0,
    flutes: 2,
    max_rpm: 15000,
}

drill {
    tool: drill_3mm,
    locations: [(10, 10), (20, 10), (30, 10)],
    depth: 5.0,
    feed: 300.0,
}

Compare this to the equivalent G-code:

gcode
G90 G21
G0 Z5.0
S15000 M3
G0 X10 Y10
G1 Z-5.0 F300
G0 Z5.0
G0 X20 Y10
G1 Z-5.0 F300
G0 Z5.0
G0 X30 Y10
G1 Z-5.0 F300
G0 Z5.0
M5

Why GScript? ​

🔍 Type Safety ​

GScript validates your programs at compile time. Tool dimensions, feed rates, and coordinates are all checked before generating G-code.

🎨 Expressive Operations ​

Use high-level operations like face, drill, pocket, and contour instead of manually calculating toolpaths.

🔧 Backend Flexibility ​

Target different CNC controllers without rewriting your programs. GScript handles the dialect differences automatically.

📊 Built-in Analysis ​

Get machining time estimates, material removal calculations, and cost breakdowns without external tools.

Getting Started ​

Install GScript using cargo:

bash
cargo install gscript

Or download pre-built binaries from the releases page.

Then write your first program:

bash
gscript compile my-program.gs --backend grbl

Check out the Getting Started Guide for a complete walkthrough.

Community & Support ​

License ​

GScript is open source software released under the Apache License 2.0.

Released under the Apache License 2.0