34 lines
1.6 KiB
HTML
34 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf8" />
|
|
<title>nix</title>
|
|
<link rel="stylesheet" href="/assets/style2.css" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>nix</h1>
|
|
</header>
|
|
<section>
|
|
<h2>the language</h2>
|
|
<p>Nix is a language. It has numbers. You can add them.</p>
|
|
<pre><code><span class="num">1</span> <span class="op">+</span> <span class="num">2</span></code></pre>
|
|
<div class="eval">= 3</div>
|
|
<p>The above expression evaluates to <code><span class="num">3</span></code>. If you have nix installed, try running <code>nix repl</code> and pasting that in.</p>
|
|
<pre><code><span class="str">"hello nix!"</span></code></pre>
|
|
<div class="eval">= "hello nix!"</div>
|
|
<p>Here you can see a string.</p>
|
|
<pre><code><span class="str">"escapes\nand\nnewlines"</span> <span class="op">==</span> <span class="str">"escapes
|
|
and
|
|
newlines"</span></code></pre>
|
|
<div class="eval">= true</div>
|
|
<p>Nix has booleans.</p>
|
|
<pre><code><span class="op">!(</span><span class="key">true</span> <span class="op">&&</span> <span class="key">false</span><span class="op">) || </span><span class="key">false</span></code></pre>
|
|
<div class="eval">= true</div>
|
|
<p>Nix has sets, key value pairs known as records, maps, or objects in other lanugages. They can be nested.</p>
|
|
<pre><code><span class="op">{ </span><span class="id">foo</span> <span class="op">=</span> <span class="num">123</span><span class="op">; }.</span><span class="id">foo</span></code></pre>
|
|
<div class="eval">= 123</div>
|
|
</section>
|
|
</body>
|
|
</html>
|
|
|