d28cdfcc7bf2a00afcd595de2d802ad593be6c0f
- Refactored dead_store_elimination to separate forward and backward passes - Improved register forwarding to better detect backward jumps - Fixed handling of JumpAndLink instructions in register tracking - Updated optimizer snapshots to reflect improved code generation The forward pass now correctly eliminates writes that are immediately overwritten. Register forwarding now better handles conditional branches and loops. Note: Backward pass for dead code elimination disabled for now - it needs additional work to properly handle return values and call site analysis.
Slang Language Documentation
Slang is a high-level programming language that compiles to IC10 assembly for Stationeers. It provides a familiar C-like syntax while targeting the limited instruction set of in-game IC10.
Quick Links
- Getting Started - Installation and first program
- Language Reference - Complete syntax guide
- Built-in Functions - System calls and math functions
- Examples - Real-world code samples
Overview
Slang aims to reduce the time spent writing IC10 assembly by providing:
- Familiar syntax - C-like declarations, control flow, and expressions
- Device abstraction - Named device bindings with property access
- Automatic register allocation - No manual register management
- Built-in functions - Math operations and device I/O as function calls
- Temperature literals - Native support for Celsius, Fahrenheit, and Kelvin
Example
device gasSensor = "d0";
device airCon = "d1";
const TARGET_TEMP = 20c;
loop {
yield();
airCon.On = gasSensor.Temperature > TARGET_TEMP;
}
This compiles to IC10 that monitors temperature and controls an air conditioner.
Project Status
Slang is under active development. It may produce suboptimal code for complex programs. It is not a replacement for IC10, for performance-critical or large scripts, hand-written IC10 may still be preferred.