Compare commits
3 Commits
3af5f15165
...
e0fb187a7c
| Author | SHA1 | Date | |
|---|---|---|---|
| e0fb187a7c | |||
| d15cd17f23 | |||
| f35f908175 |
@@ -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>
|
||||||
@@ -56,9 +58,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,9 +89,10 @@ while number < 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>
|
||||||
|
<div id="value_types">
|
||||||
<h3>Value Types</h3>
|
<h3>Value Types</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>int</code>: Signed 64 bit integer</li>
|
<li><code>int</code>: Signed 64 bit integer</li>
|
||||||
@@ -100,6 +102,18 @@ while number < 10 {
|
|||||||
<li><code>bool</code>: Either true or false</li>
|
<li><code>bool</code>: Either true or false</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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 id="builtins">
|
<div id="builtins">
|
||||||
<h2>Built In Functions</h2>
|
<h2>Built In Functions</h2>
|
||||||
<div id="input_string_msg__string">
|
<div id="input_string_msg__string">
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user