From 7710b8923a2f150c1820f190d7a1becabb8208c2 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Wed, 28 Jan 2026 18:31:10 +1100 Subject: [PATCH] Update stuff --- .gitmodules | 3 +++ docs/highlight.js | 2 +- docs/index.html | 26 +++++++++++++++++++------- pkgs | 1 + 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 .gitmodules create mode 160000 pkgs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..47988a7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pkgs"] + path = pkgs + url = https://chookspace.com/solstice/pkgs diff --git a/docs/highlight.js b/docs/highlight.js index 566fa1a..057bd8d 100644 --- a/docs/highlight.js +++ b/docs/highlight.js @@ -64,7 +64,7 @@ function highlightSolstice(code) { const word = code.substring(i, end); // Check what type of word it is - if (['def', 'if', 'while', 'return', 'ground', 'puts', 'def', 'struct', 'new'].includes(word)) { + if (['def', 'if', 'while', 'return', 'ground', 'puts', 'def', 'struct', 'new', 'use'].includes(word)) { result += `${word}`; } else if (['input', 'print', 'println'].includes(word)) { result += `${word}`; diff --git a/docs/index.html b/docs/index.html index e4d696c..2401da8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -111,6 +111,11 @@ while number < 10 { }

Calling Functions

Function calling is done like in most other programming languages, with the syntax function(arg1, arg2, arg3).

+

Importing Other Code

+

Solstice allows you to write libraries in Solstice, or write wrappers for Ground libraries. Use the use keyword, followed by an identifier to import the library.

+
use io
+
+println("Hello!")

That's it!

You now know everything you need to know about Solstice to start programming! You can continue reading for more information.

@@ -173,23 +178,30 @@ while number < 10 {

Built In Functions

+

io library

-

input(string msg) string

+

input(string msg) string

Gets user input from the console until the next line. The msg is used as a prompt for the user. Returns inputted characters from the console.

-
guess = input("What is the password? ")
+                            
use io
+
+guess = input("What is the password? ")
 if guess == "password123" {
     puts "Good job!"
 }
-

println(string msg) string

+

println(string msg) string

Prints a string to the console. Appends a new line afterwards.

-
println("Hello, World!")
+
use io
+
+println("Hello, World!")
@@ -201,7 +213,7 @@ if guess == "password123" {
  • No functions at present
  • To try the native compiler, use this command:

    -
    solstice program.sols --output program --type native --nostdlib
    +
    solstice program.sols --output program --type native

    Debugging

    Solstice will create a temporary folder in your current directory which you can remove called ".(outputname)_solsbuild". In this folder is the assembly and object file generated by the compiler. If you think that there's a bug with Ground or Solstice, you can use these to find the issue.

    diff --git a/pkgs b/pkgs new file mode 160000 index 0000000..dbfcdb7 --- /dev/null +++ b/pkgs @@ -0,0 +1 @@ +Subproject commit dbfcdb7c85de864b5e43c3d2119a137de518efb3