diff --git a/ModData/About/About.xml b/ModData/About/About.xml
index 464e823..d2b4897 100644
--- a/ModData/About/About.xml
+++ b/ModData/About/About.xml
@@ -1,40 +1,97 @@
-
- StationeersSlang
- JoeDiertay
- 0.1.0
-
- Slang (Stationeers Language) is a high-level programming language that compiles directly into IC10 within the game.
+
+ StationeersSlang
+ JoeDiertay
+ 0.1.1
+
+[h1]Slang: High-Level Programming for Stationeers[/h1]
- Features:
- - In-Game Compilation: Write C-style code directly in the IC editor.
- - Automatic Register Management: Define variables with 'let' (e.g., let x = 10) without managing r0-r15.
- - Standard Control Flow: Use if/else, while, loop, break, and continue.
- - Functions: Define and call functions with arguments.
- - Smart Editor: Real-time syntax highlighting and error checking (red text for errors).
- - Persistent Source: Your high-level source code is saved inside the chip data, so you can edit it later.
- - Constant Folding: Mathematical operations on constants are calculated at compile time to save instructions.
- - Device Aliasing: Easy device mapping (e.g., device sensor = "d0").
+Stop writing assembly. Start writing code.
- Installation:
- This is a StationeersLaunchPad Plugin Mod. It requires BepInEx to be installed.
+Slang (Stationeers Language) brings modern programming to Stationeers. It allows you to write scripts using a familiar C-style syntax (variables, functions, if/else, loops) directly in the in-game editor. When you hit confirm, Slang compiles your code into IC10 instantly.
- Usage:
- 1. Open any IC10 housing or editor.
- 2. Write Slang code.
- 3. Press Confirm to compile and run.
-
-
- Logic
- Scripting
- Code
- BepInEx
- StationeersLaunchPad
- Quality of Life
-
- = 28c;
+}
+[/code]
+
+[h2]Known Issues (Beta)[/h2]
+[list]
+[*] [b]Code Size:[/b] Compiled output is currently more verbose than hand-optimized assembly. Optimization passes are planned.
+[*] [b]Stack Access:[/b] Direct stack memory access is disabled to prevent conflicts with the compiler's internal memory management.
+[*] [b]Documentation:[/b] In-game tooltips for syscalls (like load, set) are WIP. Check the "Slang" entry in the Stationpedia (F1) for help.
+[*] [b]Debugging:[/b] Runtime errors currently point to the compiled IC10 line number, not your Slang source line. Source mapping is coming soon.
+[/list]
+
+[h2]Planned Features[/h2]
+[list]
+[*] Side-by-side view: Slang vs. Compiled IC10.
+[*] Compiler optimizations (dead code elimination, smarter register allocation).
+[*] Enhanced LSP features (Autocomplete, Go to Definition).
+[*] Full feature parity with all IC10 instructions.
+[*] Tutorials and beginner script examples.
+[/list]
+
+[h2]FAQ[/h2]
+[b]Q: What is the DLL extracted to my temp folder?[/b]
+A: The Slang compiler is built in Rust for performance and reliability. It is compiled as a native library and bundled with the mod. It must be extracted temporarily to function within the game's C# environment.
+
+[b]Q: Is this compatible with my current save?[/b]
+A: Yes! Slang does not modify any existing IC10 code, it is only a compiler. As a matter of fact: if you wish to stop using Slang at any time, your compiled IC10 will still exist on the chip. However: Slang adds a comment at the bottom of your compiled IC10 which is a GZIP and base64 encoded version of your Slang source code. This might break line limits with Slang not installed. If you wish to no longer use Slang, I recommend you remove this comment from the source code after uninstalling Slang.
+
+[h2]Useful Links[/h2]
+[url=https://github.com/dbidwell94/stationeers_lang]Source Code on GitHub[/url]
+[url=https://discord.gg/stationeers]Stationeers Official Discord[/url]
+[url=https://discord.gg/M4sCfYMacs]Stationeers Modding Discord[/url]
+
+
+ 3619985558
+
+ Logic
+ Scripting
+ Code
+ BepInEx
+ StationeersLaunchPad
+ Quality of Life
+
+
+
+ Slang - High Level Language Compiler
- A modern programming experience for Stationeers. Write C-style code that compiles to MIPS assembly instantly.
+ A modern programming experience for Stationeers. Write C-style code that compiles to IC10 instantly.
Features
- In-Game Compilation: Write high-level logic directly in the chip editor.
@@ -61,10 +118,5 @@
See: https://github.com/StationeersLaunchPad/StationeersLaunchPad
Source Code: https://github.com/dbidwell94/stationeers_lang
- ]]>
-
-
- IC10Editor
-
- IC10Editor
+ ]]>
diff --git a/csharp_mod/Plugin.cs b/csharp_mod/Plugin.cs
index 94d177b..fa576fe 100644
--- a/csharp_mod/Plugin.cs
+++ b/csharp_mod/Plugin.cs
@@ -41,7 +41,7 @@ namespace Slang
{
public const string PluginGuid = "com.biddydev.slang";
public const string PluginName = "Slang";
- public const string PluginVersion = "0.1.0";
+ public const string PluginVersion = "0.1.1";
public static Mod MOD = new Mod(PluginName, PluginVersion);
diff --git a/csharp_mod/stationeersSlang.csproj b/csharp_mod/stationeersSlang.csproj
index 0880395..a86c204 100644
--- a/csharp_mod/stationeersSlang.csproj
+++ b/csharp_mod/stationeersSlang.csproj
@@ -5,7 +5,7 @@
enable
StationeersSlang
Slang Compiler Bridge
- 0.1.0
+ 0.1.1
true
latest
diff --git a/rust_compiler/Cargo.lock b/rust_compiler/Cargo.lock
index 664669d..5b620a0 100644
--- a/rust_compiler/Cargo.lock
+++ b/rust_compiler/Cargo.lock
@@ -843,7 +843,7 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
[[package]]
name = "slang"
-version = "0.1.0"
+version = "0.1.1"
dependencies = [
"anyhow",
"clap",
diff --git a/rust_compiler/Cargo.toml b/rust_compiler/Cargo.toml
index ee900f1..6ac3e63 100644
--- a/rust_compiler/Cargo.toml
+++ b/rust_compiler/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "slang"
-version = "0.1.0"
+version = "0.1.1"
edition = "2021"
[workspace]
diff --git a/rust_compiler/libs/parser/src/sys_call.rs b/rust_compiler/libs/parser/src/sys_call.rs
index cb6e85b..c44ec95 100644
--- a/rust_compiler/libs/parser/src/sys_call.rs
+++ b/rust_compiler/libs/parser/src/sys_call.rs
@@ -9,97 +9,97 @@ documented! {
/// ## IC10
/// `acos r? a(r?|num)`
/// ## Slang
- /// `(number|var).acos();`
+ /// `let item = acos(number|var|expression);`
Acos(Box>),
/// Returns the angle in radians whose sine is the specified number.
/// ## IC10
/// `asin r? a(r?|num)`
/// ## Slang
- /// `(number|var).asin();`
+ /// `let item = asin(number|var|expression);`
Asin(Box>),
/// Returns the angle in radians whose tangent is the specified number.
/// ## IC10
/// `atan r? a(r?|num)`
/// ## Slang
- /// `(number|var).atan();`
+ /// `let item = atan(number|var|expression);`
Atan(Box>),
/// Returns the angle in radians whose tangent is the quotient of the specified numbers.
/// ## IC10
/// `atan2 r? a(r?|num) b(r?|num)`
/// ## Slang
- /// `(number|var).atan2((number|var));`
+ /// `let item = atan2((number|var|expression), (number|var|expression));`
Atan2(Box>, Box>),
/// Gets the absolute value of a number.
/// ## IC10
/// `abs r? a(r?|num)`
/// ## Slang
- /// `(number|var).abs();`
+ /// `let item = abs((number|var|expression));`
Abs(Box>),
/// Rounds a number up to the nearest whole number.
/// ## IC10
/// `ceil r? a(r?|num)`
/// ## Slang
- /// `(number|var).ceil();`
+ /// `let item = ceil((number|var|expression));`
Ceil(Box>),
/// Returns the cosine of the specified angle in radians.
/// ## IC10
/// `cos r? a(r?|num)`
/// ## Slang
- /// `(number|var).cos();`
+ /// `let item = cos((number|var|expression));`
Cos(Box>),
/// Rounds a number down to the nearest whole number.
/// ## IC10
/// `floor r? a(r?|num)`
/// ## Slang
- /// `(number|var).floor();`
+ /// `let item = floor((number|var|expression));`
Floor(Box>),
/// Computes the natural logarithm of a number.
/// ## IC10
/// `log r? a(r?|num)`
/// ## Slang
- /// `(number|var).log();`
+ /// `let item = log((number|var|expression));`
Log(Box>),
/// Computes the maximum of two numbers.
/// ## IC10
/// `max r? a(r?|num) b(r?|num)`
/// ## Slang
- /// `(number|var).max((number|var));`
+ /// `let item = max((number|var|expression), (number|var|expression));`
Max(Box>, Box>),
/// Computes the minimum of two numbers.
/// ## IC10
/// `min r? a(r?|num) b(r?|num)`
/// ## Slang
- /// `(number|var).min((number|var));`
+ /// `let item = min((number|var|expression), (number|var|expression));`
Min(Box>, Box>),
/// Gets a random number between 0 and 1.
/// ## IC10
/// `rand r?`
/// ## Slang
- /// `rand();`
+ /// `let item = rand();`
Rand,
/// Returns the sine of the specified angle in radians.
/// ## IC10
/// `sin r? a(r?|num)`
/// ## Slang
- /// `(number|var).sin();`
+ /// `let item = sin((number|var|expression));`
Sin(Box>),
/// Computes the square root of a number.
/// ## IC10
/// `sqrt r? a(r?|num)`
/// ## Slang
- /// `(number|var).sqrt();`
+ /// `let item = sqrt((number|var|expression));`
Sqrt(Box>),
/// Returns the tangent of the specified angle in radians.
/// ## IC10
/// `tan r? a(r?|num)`
/// ## Slang
- /// `(number|var).tan();`
+ /// `let item = tan((number|var|expression));`
Tan(Box>),
/// Truncates a number by removing the decimal portion.
/// ## IC10
/// `trunc r? a(r?|num)`
/// ## Slang
- /// `(number|var).trunc();`
+ /// `let item = trunc((number|var|expression));`
Trunc(Box>),
}
}
@@ -160,7 +160,9 @@ documented! {
/// ## IC10
/// `l r? d? var`
/// ## Slang
- /// `load(deviceType, "LogicType");`
+ /// `let item = load(deviceHash, "LogicType");`
+ /// `let item = l(deviceHash, "LogicType");`
+ /// `let item = deviceAlias.LogicType;`
LoadFromDevice(Spanned, Spanned),
/// Function which gets a LogicType from all connected network devices that match
/// the provided device hash and name, aggregating them via a batchMode
@@ -168,6 +170,7 @@ documented! {
/// `lbn r? deviceHash nameHash logicType batchMode`
/// ## Slang
/// `loadBatchedNamed(deviceHash, deviceName, "LogicType", "BatchMode");`
+ /// `lbn(deviceHash, deviceName, "LogicType", "BatchMode");`
LoadBatchNamed(
Spanned,
Spanned,
@@ -180,26 +183,31 @@ documented! {
/// `lb r? deviceHash logicType batchMode`
/// ## Slang
/// `loadBatched(deviceHash, "Variable", "LogicType");`
+ /// `lb(deviceHash, "Variable", "LogicType");`
LoadBatch(Spanned, Spanned, Spanned),
/// Represents a function which stores a setting into a specific device.
/// ## IC10
/// `s d? logicType r?`
/// ## Slang
- /// `set(deviceType, "Variable", (number|var));`
+ /// `set(deviceHash, "LogicType", (number|var));`
+ /// `s(deviceHash, "LogicType", (number|var));`
+ /// `deviceAlias.LogicType = (number|var);`
SetOnDevice(Spanned, Spanned, Box>),
/// Represents a function which stores a setting to all devices that match
/// the given deviceHash
/// ## IC10
/// `sb deviceHash logicType r?`
/// ## Slang
- /// `setBatched(deviceHash, "LogicType", (number|var))`
+ /// `setBatched(deviceHash, "LogicType", (number|var));`
+ /// `sb(deviceHash, "LogicType", (number|var));`
SetOnDeviceBatched(Spanned, Spanned, Box>),
/// Represents a function which stores a setting to all devices that match
/// both the given deviceHash AND the given nameHash
/// ## IC10
/// `sbn deviceHash nameHash logicType r?`
/// ## Slang
- /// `setBatchedNamed(deviceHash, nameHash, "LogicType", (number|var))`
+ /// `setBatchedNamed(deviceHash, nameHash, "LogicType", (number|var));`
+ /// `sbn(deviceHash, nameHash, "LogicType", (number|var));`
SetOnDeviceBatchedNamed(
Spanned,
Spanned,