Compare commits

...

2 Commits

Author SHA1 Message Date
d16d6bd809 updates 2025-12-28 14:12:47 +11:00
a8ac07e8ab Update playground 2025-12-25 22:43:15 +11:00
5 changed files with 17 additions and 8 deletions

View File

@@ -86,6 +86,15 @@ while number < 10 {
puts number
}</<code></pre>
</code>
<h3>Functions</h3>
<p><strong>Note:</strong> Functions in Solstice are currently in beta. Type checking for functions is currently experimental, and arguments may not work as intended. Be warned!</p>
<p>In Solstice, function definitions have a syntax like this: <pre class="code"><code>def functionName(type arg1, type arg2, type arg3) returnType {<br> // code goes here<br>}</code></pre></p>
<p>Your types can be <code>int</code>, <code>double</code>, <code>string</code>, <code>bool</code>, or <code>char</code> (see the "Type System" section for more details)</p>
<p>Return a value (which must be the same type as your <code>returnType</code>) with <code>return value</code>.</p>
<p>Here's an example function:</p>
<pre class="code"><code>def add(int a, int b) int {
return a + b
}</code></pre>
<h3>Calling Functions</h3>
<p>Function calling is done like in most other programming languages, with the syntax <code>function(arg1, arg2, arg3)</code>.</p>
<h3>That's it!</h3>

1
docs/node_modules/.mf/cf.json generated vendored Normal file
View File

@@ -0,0 +1 @@
{"httpProtocol":"HTTP/1.1","clientAcceptEncoding":"gzip, deflate, br","requestPriority":"","edgeRequestKeepAliveStatus":1,"requestHeaderNames":{},"clientTcpRtt":12,"colo":"SYD","asn":9443,"asOrganization":"Vocus","country":"AU","isEUCountry":false,"city":"Sydney","continent":"OC","region":"New South Wales","regionCode":"NSW","timezone":"Australia/Sydney","longitude":"151.20732","latitude":"-33.86785","postalCode":"1001","tlsVersion":"TLSv1.3","tlsCipher":"AEAD-AES256-GCM-SHA384","tlsClientRandom":"daX8oL41wKEGQv5d7pl4Gz+FvxZY9qRPz8AwU1lq8WE=","tlsClientCiphersSha1":"kXrN3VEKDdzz2cPKTQaKzpxVTxQ=","tlsClientExtensionsSha1":"1eY97BUYYO8vDaTfHQywB1pcNdM=","tlsClientExtensionsSha1Le":"u4wtEMFQBY18l3BzHAvORm+KGRw=","tlsExportedAuthenticator":{"clientHandshake":"a677c57d6ea9007a40767d4e57b68c110114325d39d60b2863517e495f5fedb47b6d65db6b0b732420c3a845ebb9b7b7","serverHandshake":"290d01a7b75e9b8739f14abab625c4d18a458ef4c344c21deb141ecffdff506b7c06bd96ce86ac94b6600c255d8d6daa","clientFinished":"0635e92b7ba2caac307410878e7c35778b416890d460bf90703cc6c5ce869e41c1a62fe172c6ceffb734bbc20b41f426","serverFinished":"43843c9f186775a525ccd2c5e0769602e4572abca8075253c01eb26cb908e0c5281c55dbb3a93302a2304a7a45546e73"},"tlsClientHelloLength":"1603","tlsClientAuth":{"certPresented":"0","certVerified":"NONE","certRevoked":"0","certIssuerDN":"","certSubjectDN":"","certIssuerDNRFC2253":"","certSubjectDNRFC2253":"","certIssuerDNLegacy":"","certSubjectDNLegacy":"","certSerial":"","certIssuerSerial":"","certSKI":"","certIssuerSKI":"","certFingerprintSHA1":"","certFingerprintSHA256":"","certNotBefore":"","certNotAfter":""},"verifiedBotCategory":"","botManagement":{"corporateProxy":false,"verifiedBot":false,"jsDetection":{"passed":false},"staticResource":false,"detectionIds":{},"score":99}}

View File

@@ -25,7 +25,7 @@
<div class="feature-row">
<div class="feature">
<h3>Small and fast</h3>
<p>Solstice's compiler is 1216 lines of C++, and compiles code at lightning speed.</p>
<p>Solstice's compiler is 1833 lines of C++, and compiles code at lightning speed.</p>
</div>
<div class="feature">
<h3>Built on Ground</h3>

View File

@@ -20,8 +20,7 @@
<textarea class="code" id="editor" spellcheck="false" placeholder="Enter Solstice code here..." rows="20">
puts "Hello from Solstice via WebAssembly!"
puts "Let's do some math:"
puts 10 + 20 + 12
</textarea>
puts 10 + 20 + 12</textarea>
<div id="controls">
<button id="runBtn" style="font-size: 20px;">Loading WASM...</button>

Binary file not shown.