<p>Welcome to the Solstice docs! Feel free to read in whichever order you like, or come back when you feel like it. You can read these head to tail if you want to understand the whole of the language as well.</p>
<p>See a mistake? Report it at <ahref="https://chsp.au/max/sols.dev">this site's repository</a>.
<p>Happy coding!</p>
<divid="core_concepts">
<h2>Core Concepts</h2>
<p>Solstice is a high level programming language. It compiles to Ground's bytecode.</p>
<h3>The <code>solstice</code> command</h3>
<p>Solstice's compiler is invoked via the <code>solstice</code> command. It provides some options:</p>
<ul>
<li><code>-o</code> or <code>--output</code>: Tells Solstice where to output a compiled file.</li>
<li><code>-t</code> or <code>--type</code>: Tells Solstice the type of file to output.<br>At present, Solstice only supports Ground source files as an output type, but more types may be added in future.</li>
<p>Solstice code consists of four main things: values, identifiers, operators, and code blocks.</p>
<ul>
<li>Values: these are your literal values in your program, like <code>"Hello!"</code>, <code>32</code>, or <code>true</code>. More on values and the Solstice type system later.</li>
<li>Identifiers: these are names of variables. They normally hold something in them.</li>
<li>Operators: these make up the actual logic of your program. Operators are thing like <code>+</code>, <code>=</code>, or <code>if</code>. (if and while are operators in Solstice.)</li>
<li>Code blocks: this is the collection of values, identifiers, and operators, usually in between <code>{</code> and <code>}</code>.</li>
</ul>
<h3>puts</h3>
<p>The <code>puts</code> command in Solstice is used to print out a value. It is not a function, but a built in operator, similar to <code>+</code> or <code>=</code>.</p>
<p>Use it like this:</p>
<preclass="code"><code>puts "Hello, World!"
puts 3.14
puts true
puts "You can print out anything with puts!"</code></pre>
<h3>Variables</h3>
<p>Solstice variables are quite simple. Assign values with <code>=</code>, and read them with the variable name.</p>
<p>Types are automatically inferred by Solstice.</p>
<h3>Maths</h3>
<p>Note: math is currently in beta. Order of Operations is harder to implement than I thought lol</p>
<p>You can use <code>+</code> (add), <code>-</code> (subtract), <code>*</code> (multiply), and <code>/</code> (divide) to do math.</p>
<p>Math operations take two values on either side, and perform the operation.</p>
<preclass="code"><code>x = 5 + 3<br>y = 10<br>puts x + y</code></pre>
<h3>Control Flow and Equalities</h3>
<p>Solstice supports <code>if</code> and <code>while</code> statements, as well as the <code>==</code>, <code>!=</code>, <code>></code>, <code>>=</code>, <code><</code>, and <code><=</code> operations.</p>
<p>Conditionals work just like maths: two values on either side, check whether the condition is correct or not based on those values, and output a boolean.</p>