Compare commits

..

5 Commits

Author SHA1 Message Date
8f9e8f5b25 update docs1 2025-12-25 22:40:00 +11:00
e0fb187a7c Update docs 2025-12-24 22:04:03 +11:00
d15cd17f23 Update playground with latest version 2025-12-24 22:02:15 +11:00
f35f908175 e 2025-12-24 16:26:43 +11:00
3af5f15165 Merge pull request 'testing' (#1) from testing into master
Reviewed-on: max/sols.dev#1
2025-12-23 23:43:46 +11:00
2 changed files with 29 additions and 13 deletions

View File

@@ -14,7 +14,9 @@
<h3>Navigation</h3> <h3>Navigation</h3>
<ul> <ul>
<li><strong><a href="#core_concepts">Core Concepts</a></strong></li> <li><strong><a href="#core_concepts">Core Concepts</a></strong></li>
<li><strong><a href="#types">Types</a></strong></li> <li><strong><a href="#type_system">Type System</a></strong></li>
<li><a href="#value_types">Value Types</a></li>
<li><a href="#type_checker">Type Checker</a></li>
<li><strong><a href="#builtins">Built In Functions</a></strong></li> <li><strong><a href="#builtins">Built In Functions</a></strong></li>
<li><a href="#input_string_msg__string">input(string msg) string</a></li> <li><a href="#input_string_msg__string">input(string msg) string</a></li>
</ul> </ul>
@@ -44,6 +46,8 @@
<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>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> <li>Code blocks: this is the collection of values, identifiers, and operators, usually in between <code>{</code> and <code>}</code>.</li>
</ul> </ul>
<h3>Comments</h3>
<p>You can type <code>//</code> to insert a comment into your program. The rest of your line will be commented out.
<h3>puts</h3> <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>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> <p>Use it like this:</p>
@@ -56,9 +60,8 @@ puts "You can print out anything with puts!"</code></pre>
<pre class="code"><code>x = 5<br>puts x</code></pre> <pre class="code"><code>x = 5<br>puts x</code></pre>
<p>Types are automatically inferred by Solstice.</p> <p>Types are automatically inferred by Solstice.</p>
<h3>Maths</h3> <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>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> <p>Math operations take two values on either side, and perform the operation. Order of operations is supported.</p>
<pre class="code"><code>x = 5 + 3<br>y = 10<br>puts x + y</code></pre> <pre class="code"><code>x = 5 + 3<br>y = 10<br>puts x + y</code></pre>
<h3>Control Flow and Equalities</h3> <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>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>
@@ -88,17 +91,30 @@ while number &lt; 10 {
<h3>That's it!</h3> <h3>That's it!</h3>
<p>You now know everything you need to know about Solstice to start programming! You can continue reading for more information.</p> <p>You now know everything you need to know about Solstice to start programming! You can continue reading for more information.</p>
</div> </div>
<div id="types"> <div id="type_system">
<h2>Types</h2> <h2>Type System</h2>
<p>Solstice's type system is currently a work in progress, but what is so far implemented will be detailed.</p> <p>Solstice's type system is currently a work in progress, but what is so far implemented will be detailed.</p>
<h3>Value Types</h3> <div id="value_types">
<ul> <h3>Value Types</h3>
<li><code>int</code>: Signed 64 bit integer</li> <ul>
<li><code>double</code>: Double prescision floating point number</li> <li><code>int</code>: Signed 64 bit integer</li>
<li><code>string</code>: Character array</li> <li><code>double</code>: Double prescision floating point number</li>
<li><code>char</code>: A single character</li> <li><code>string</code>: Character array</li>
<li><code>bool</code>: Either true or false</li> <li><code>char</code>: A single character</li>
</ul> <li><code>bool</code>: Either true or false</li>
</ul>
</div>
<div id="type_checker">
<h3>Type Checker</h3>
<p>Solstice statically checks types at compile time to ensure your data is used as intended. These are the details of the type checker.</p>
<ul>
<li>Types of variables when setting with <code>=</code> are autoinferred and cannot be provided by the user. All variables must have a value.</li>
<li>When setting a variable with <code>=</code>, it's type must not mutate in any way.</li>
<li>Functions must have types annotated. There is no "any" type.</li>
<li>When using operators, integers are able to promote to doubles where required. No other types can automatically convert.</li>
<li>All equality operators require the same type on both sides of the equality.</li>
</ul>
</div>
</div> </div>
<div id="builtins"> <div id="builtins">
<h2>Built In Functions</h2> <h2>Built In Functions</h2>

Binary file not shown.