Skip to content

Commit

Permalink
rebuild documents
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Dec 13, 2023
1 parent c96fa49 commit e3aa408
Show file tree
Hide file tree
Showing 14 changed files with 230 additions and 199 deletions.
90 changes: 45 additions & 45 deletions docs/documentation.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/library-docs.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tutorials.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctypehtml><html lang="en"><meta charset="UTF-8"><title>Yaksha Programming Language</title><link rel="apple-touch-icon"sizes="180x180"href="/apple-touch-icon.png"><link rel="icon"type="image/png"sizes="32x32"href="/favicon-32x32.png"><link rel="icon"type="image/png"sizes="16x16"href="/favicon-16x16.png"><link rel="manifest"href="/site.webmanifest"><link rel="mask-icon"href="/safari-pinned-tab.svg"color="#5bbad5"><meta name="msapplication-TileColor"content="#ffc7fd"><meta name="theme-color"content="#ffffff"><meta name="description"content="Yaksha Programming Language"><meta name="viewport"content="width=device-width,initial-scale=1"><link rel="preconnect"href="https://fonts.googleapis.com"><link rel="preconnect"href="https://fonts.gstatic.com"crossorigin><link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&family=Source+Code+Pro:wght@400;600;900&family=Ubuntu&display=swap"rel="stylesheet"><link rel="stylesheet"href="/assets/normalize.min.css"><link rel="stylesheet"href="/assets/medium-font.min.css"id="font-size-link"><link rel="stylesheet"href="/assets/style.light.min.css"id="theme-link"><link rel="stylesheet"href="/assets/printing.min.css"media="print"><div class="container"><div class="table-of-contents"><img id="yaksha-logo"alt="Yaksha Programming Language"src="images/yk-banner.png"style="max-width:100%;display:none"><p id="pages-text-toc">Pages<nav><a href="/">Home</a> <a href="/library-docs.html">Lib</a> <a href="/documentation.html">Docs</a> <a href="/tutorials.html">Tutorials</a> <a href="/demos.html">Demos</a> <a href="/yama.html">YAMA</a> <a href="/blog.html">(B)log</a></nav><button id="btn-toggle"class="button action-button"><svg xmlns="http://www.w3.org/2000/svg"width="32"height="32"fill="currentColor"class="bi bi-brightness-high"viewBox="0 0 16 16"><path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/></svg></button> <button id="btn-small-font"class="button action-button"><svg xmlns="http://www.w3.org/2000/svg"width="32"height="32"fill="currentColor"class="bi bi-fonts"viewBox="0 0 32 32"><path d="M12.258 3h-8.51l-.083 2.46h.479c.26-1.544.758-1.783 2.693-1.845l.424-.013v7.827c0 .663-.144.82-1.3.923v.52h4.082v-.52c-1.162-.103-1.306-.26-1.306-.923V3.602l.431.013c1.934.062 2.434.301 2.693 1.846h.479L12.258 3z"/></svg></button> <button id="btn-medium-font"class="button action-button"><svg xmlns="http://www.w3.org/2000/svg"width="32"height="32"fill="currentColor"class="bi bi-fonts"viewBox="0 0 24 24"><path d="M12.258 3h-8.51l-.083 2.46h.479c.26-1.544.758-1.783 2.693-1.845l.424-.013v7.827c0 .663-.144.82-1.3.923v.52h4.082v-.52c-1.162-.103-1.306-.26-1.306-.923V3.602l.431.013c1.934.062 2.434.301 2.693 1.846h.479L12.258 3z"/></svg></button> <button id="btn-large-font"class="button action-button"><svg xmlns="http://www.w3.org/2000/svg"width="32"height="32"fill="currentColor"class="bi bi-fonts"viewBox="0 0 16 16"><path d="M12.258 3h-8.51l-.083 2.46h.479c.26-1.544.758-1.783 2.693-1.845l.424-.013v7.827c0 .663-.144.82-1.3.923v.52h4.082v-.52c-1.162-.103-1.306-.26-1.306-.923V3.602l.431.013c1.934.062 2.434.301 2.693 1.846h.479L12.258 3z"/></svg></button><div>&nbsp;</div><div class="real-toc"><div>&nbsp;</div><p>Table of Contents<div class="toc-item"><a href="#getting-started">Getting started</a></div></div></div><div class="boxes"><hr><div class="box"><div class="content"></div><div class="note"></div></div><div class="box"><div class="content"><h2 id="getting-started">1 Getting started</h2><span class="timestamp">Created 2023-07-30, Last Updated 2023-09-07</span><ul><li>Author(s): Bhathiya Perera</ul><h3 id="setting-things-up">1.1 Setting things up</h3><h4 id="downloading">1.1.1 Downloading</h4><ul><li><p>Head to <a href="https://github.com/YakshaLang/Yaksha/releases">releases</a><li><p>Pick an archive format you like <code>.7z</code> or <code>.zip</code> (both has same content and <code>.7z</code> is almost always likely to be smaller in size)<li><p>Since this is a new language we recommend you always download latest version. Please expect things to not work.</ul><h4 id="installing">1.1.2 Installing</h4><ul><li><p>After download is completed you can extract the archive. Here are few ways:</ul><ul><li>Windows: use <a href="https://www.7-zip.org/">7zip application</a></ul><ul><li>GNU/Linux: use <code>7za</code> or <code>unzip</code> depending on archive format.</ul><ul><li><p>Now you can add <code>bin</code> directory to PATH.<li><p>If you are in GNU/Linux ensure that binaries in the <code>bin</code> directory have <code>+x</code> (executable) permission assigned. <code>chmod +x *</code></ul><h4 id="basics-of-yaksha-programming-language">1.1.3 Basics of Yaksha Programming Language</h4><h5 id="hello-world">1.1.3.1 Hello World</h5><p>Steps:<p>First save below code to a file named "hello.yaka"<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">main</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="nb">int</span><span class="p">:</span>
<span class="nb">println</span><span class="p">(</span><span class="s2">&quot;Hello World!&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="mi">0</span>
</pre></div><p>In Yaksha we use <code>.yaka</code> extension for source files. Also, we use <code>-&gt;</code> to denote return type of a function.<p>Additionally entry point of a program is <code>main</code> function. Main function must always return an <code>int</code> value. In this case we return <code>0</code> to indicate that program has exited successfully. Additionally we use <code>println</code> builtin function to print a line to standard output.<p>Now you can compile it using <code>yaksha</code> command.<div class="highlight"><pre><span></span>yaksha<span class="w"> </span>build<span class="w"> </span>-R<span class="w"> </span>hello.yaka
</pre></div><p>In Yaksha we use <code>.yaka</code> extension for source files. Also, we use <code>-&gt;</code> to denote return type of a function.<p>Additionally entry point of a program is <code>main</code> function. Main function must always return an <code>int</code> value. In this case we return <code>0</code> to indicate that program has exited successfully. Additionally we use <code>println</code> builtin function to print a line to standard output.<p>Now you can compile it using <code>yaksha</code> command.<div class="highlight"><pre><span></span>yaksha build -R hello.yaka
</pre></div><p>Internally <code>yaksha build</code> command will invoke <code>carpntr</code> binary included in the distribution. <code>carpntr</code> is the builder tool for Yaksha. It will compile the source file and generate a binary named <code>hello</code> in the current directory. Additionally it will generate a <code>hello.c</code> file which is the <code>C</code> code generated by the compiler. You can inspect this file to see how the compiler works. <code>-R</code> option for <code>carpntr</code> (or <code>yaksha build</code>) will execute the binary after compilation.<p><code>carpntr</code> (or <code>yaksha build</code>) has many options. You can see them by running <code>yaksha build --help</code> or <code>carpntr --help</code>. Under the hood <code>carpntr</code> uses bundled <code>zig</code> compiler (with <code>zig cc</code>) and compile <code>c</code> code to a binary.<h5 id="comments">1.1.3.2 Comments</h5><p>Yaksha programming language use <code>#</code> as an indicator for starting a comment.<div class="highlight"><pre><span></span><span class="c1"># This is a comment</span>
<span class="k">def</span> <span class="nf">main</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="nb">int</span><span class="p">:</span>
<span class="n">a</span> <span class="o">=</span> <span class="s2">&quot;Hello # This is not a comment&quot;</span>
Expand Down
Loading

0 comments on commit e3aa408

Please sign in to comment.