<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>book/src/cli-installation.md - fork/numbat @ v1.6.3</title>
<meta name="description" content="book/src/cli-installation.md in fork/numbat at v1.6.3.">
<meta property="og:title" content="book/src/cli-installation.md - fork/numbat @ v1.6.3">
<meta property="og:description" content="book/src/cli-installation.md in fork/numbat at v1.6.3.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="v1.6.3" data-tip="52bc0d26a5b7aeb998746750385871b44749f8f4">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/numbat</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/numbat</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">David Peter</span><span class="commit-message" data-commit="52bc0d26a5b7aeb998746750385871b44749f8f4">Bump version numbers</span><span class="snapshot-sha sha" data-commit="52bc0d26a5b7aeb998746750385871b44749f8f4">52bc0d2</span><time datetime="2023-09-26T23:10:26+02:00" title="2023-09-26 23:10:26 +0200">2023-09-26</time></p>
<header class="topbar"><details class="switcher"><summary>v1.6.3</summary><div class="menu"><strong>branches</strong><a href="/fork/numbat/ref/master/">master</a><strong>tags</strong><a href="/fork/numbat/ref/v1.6.0/">v1.6.0</a><a href="/fork/numbat/ref/v1.6.1/">v1.6.1</a><a href="/fork/numbat/ref/v1.6.2/">v1.6.2</a><a class="current" href="/fork/numbat/ref/v1.6.3/">v1.6.3</a><a href="/fork/numbat/ref/v1.7.0/">v1.7.0</a><a href="/fork/numbat/ref/v1.8.0/">v1.8.0</a><a class="all" href="/fork/numbat/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/numbat/">numbat</a> / <a href="/fork/numbat/ref/v1.6.3/tree/book/">book</a> / <a href="/fork/numbat/ref/v1.6.3/tree/book/src/">src</a> / <span class="cur">cli-installation.md</span></nav>
<span class="view-stats"><span>3.2 KiB</span><span>84 lines</span></span><span class="actions"><a class="raw" href="/fork/numbat/raw/5fae86fb779955be9aaf8420d3487e1a37d2fe6e/book/src/cli-installation.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>Installation</h1>
<h2>Linux</h2>
<h3>On Ubuntu</h3>
<p><em>... and other Debian-based Linux distributions.</em></p>
<p>Download the latest <code>.deb</code> package from <a href="https://github.com/sharkdp/numbat/releases">the release page</a>
and install it via <code>dpkg</code>. For example:</p>
<pre class="language-bash"><a-f>curl</a-f> <a-co>-LO</a-co> https://github.com/sharkdp/numbat/releases/download/v1.6.3/numbat_1.6.3_amd64.deb
<a-f>sudo</a-f> dpkg <a-co>-i</a-co> numbat_1.6.3_amd64.deb</pre>
<h3>On Arch Linux</h3>
<p>In Arch Linux and Arch based distributions, you can install the
<a href="https://aur.archlinux.org/packages/numbat-bin">prebuilt package of Numbat</a> from the AUR:</p>
<pre class="language-bash"><a-f>yay</a-f> <a-co>-S</a-co> numbat-bin</pre>
<p>You can also install the <a href="https://aur.archlinux.org/packages/numbat">numbat</a>
AUR package, which will download the source and compile it.</p>
<pre class="language-bash"><a-f>yay</a-f> <a-co>-S</a-co> numbat</pre>
<h2>macOS</h2>
<h3>Homebrew</h3>
<p>You can install Numbat with Homebrew:</p>
<pre class="language-bash"><a-f>brew</a-f> install numbat</pre>
<h2>From source</h2>
<p>Clone the Git repository, and build Numbat with <code>cargo</code>:</p>
<pre class="language-bash"><a-f>git</a-f> clone https://github.com/sharkdp/numbat
<a-f>cd</a-f> numbat/
<a-f>cargo</a-f> install <a-co>-f</a-co> <a-co>--path</a-co> numbat-cli</pre>
<p>Or install the latest release using</p>
<pre class="language-bash"><a-f>cargo</a-f> install numbat-cli</pre>
<h2>Guidelines for package maintainers</h2>
<p>Thank you for packaging Numbat! This section contains instructions that are not strictly necessary
to create a Numbat package, but provide users with the best-possible experience on your target platform.</p>
<p>Numbat has a <a href="/fork/numbat/ref/v1.6.3/blob/book/src/prelude.md">standard library</a> that is written in Numbat itself. The sources for this
so called "prelude" are available in the <a href="https://github.com/sharkdp/numbat/tree/master/numbat/modules"><code>numbat/modules</code></a> folder.
We also include this <code>modules</code> folder in the pre-built <a href="https://github.com/sharkdp/numbat/releases">GitHub releases</a>.
Installing this folder as part of the package installation is not necessary for Numbat to work, as the prelude is also
stored inside the <code>numbat</code> binary. But ideally, this folder should be made available for users. There are three reasons for this:</p>
<ul>
<li>Users might want to look at the code in the standard library to get a better understanding of the language itself.</li>
<li>For some error messages, Numbat refers to locations in the source code. For example, if you type <code>let meter = 2</code>, the compiler
will let you know that this identifier is already in use, and has been previously defined at a certain location inside the
standard library. If the corresponding module is available as a file on the users system, they will see the proper path and
can read the corresponding file.</li>
<li>Users might want to make changes to the prelude. Ideally, this should be done via a <a href="/fork/numbat/ref/v1.6.3/blob/book/src/cli-customization.md">user module folder</a>,
but the system-wide folder can serve as a template.</li>
</ul>
<p>In order for this to work, the <code>modules</code> folder should ideally be placed in the <a href="/fork/numbat/ref/v1.6.3/blob/book/src/cli-customization.md">standard location for the
target operating system</a>. If this is not possible, package maintainers can customize
numbat during compilation by setting the environment variable <code>NUMBAT_SYSTEM_MODULE_PATH</code> to the final locatiom.
If this variable is set during compilation, the specified path will be compiled into the <code>numbat</code> binary.</p>
<p>In order to test that everything is working as intended, you can open <code>numbat</code> and type <code>let meter = 2</code>. The
path in the error message should point to the specified location (and <em>not</em> to <code>&lt;builtin&gt;/…</code>).</p>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>Installation</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"><a-p>##</a-p> <a-tt>Linux</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-p>###</a-p> <a-tt>On Ubuntu</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">*... and other Debian-based Linux distributions.*</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">Download the latest `.deb` package from [the release page](https://github.com/sharkdp/numbat/releases)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">and install it via `dpkg`. For example:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>curl </a-p><a-co>-LO</a-co><a-p> https://github.com/sharkdp/numbat/releases/download/v1.6.3/numbat_1.6.3_amd64.deb</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-p>sudo dpkg </a-p><a-co>-i</a-co><a-p> numbat_1.6.3_amd64.deb</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>### </a-p><a-tt>On Arch Linux</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>In Arch Linux and Arch based distributions, you can install the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>[prebuilt package of Numbat](https://aur.archlinux.org/packages/numbat-bin) from the AUR:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>yay </a-p><a-co>-S</a-co><a-p> numbat-bin</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>You can also install the [numbat](https://aur.archlinux.org/packages/numbat)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>AUR package, which will download the source and compile it.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>yay </a-p><a-co>-S</a-co><a-p> numbat</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>## </a-p><a-tt>macOS</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>### </a-p><a-tt>Homebrew</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>You can install Numbat with Homebrew:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>brew install numbat</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"><a-p>## </a-p><a-tt>From source</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>Clone the Git repository, and build Numbat with `cargo`:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"><a-p>git clone https://github.com/sharkdp/numbat</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>cd numbat/</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"><a-p>cargo install </a-p><a-co>-f</a-co><a-p> </a-p><a-co>--path</a-co><a-p> numbat-cli</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>Or install the latest release using</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>```</a-p><a-tl> bash</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"><a-p>cargo install numbat-cli</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L59" href="#L59">59</a><span class="code-text"><a-p>## </a-p><a-tt>Guidelines for package maintainers</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L60" href="#L60">60</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"><a-p>Thank you for packaging Numbat! This section contains instructions that are not strictly necessary</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L62" href="#L62">62</a><span class="code-text"><a-p>to create a Numbat package, but provide users with the best-possible experience on your target platform.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L63" href="#L63">63</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"><a-p>Numbat has a [standard library](./prelude.md) that is written in Numbat itself. The sources for this</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L65" href="#L65">65</a><span class="code-text"><a-p>so called &quot;prelude&quot; are available in the [`numbat/modules`](https://github.com/sharkdp/numbat/tree/master/numbat/modules) folder.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L66" href="#L66">66</a><span class="code-text"><a-p>We also include this `modules` folder in the pre-built [GitHub releases](https://github.com/sharkdp/numbat/releases).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L67" href="#L67">67</a><span class="code-text"><a-p>Installing this folder as part of the package installation is not necessary for Numbat to work, as the prelude is also</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L68" href="#L68">68</a><span class="code-text"><a-p>stored inside the `numbat` binary. But ideally, this folder should be made available for users. There are three reasons for this:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L69" href="#L69">69</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L70" href="#L70">70</a><span class="code-text"><a-p>- Users might want to look at the code in the standard library to get a better understanding of the language itself.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L71" href="#L71">71</a><span class="code-text"><a-p>- For some error messages, Numbat refers to locations in the source code. For example, if you type `let meter = 2`, the compiler</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L72" href="#L72">72</a><span class="code-text"><a-p>  will let you know that this identifier is already in use, and has been previously defined at a certain location inside the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L73" href="#L73">73</a><span class="code-text"><a-p>  standard library. If the corresponding module is available as a file on the users system, they will see the proper path and</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L74" href="#L74">74</a><span class="code-text"><a-p>  can read the corresponding file.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L75" href="#L75">75</a><span class="code-text"><a-p>- Users might want to make changes to the prelude. Ideally, this should be done via a [user module folder](./cli-customization.md),</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L76" href="#L76">76</a><span class="code-text"><a-p>  but the system-wide folder can serve as a template.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L77" href="#L77">77</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L78" href="#L78">78</a><span class="code-text">In order for this to work, the `modules` folder should ideally be placed in the [standard location for the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L79" href="#L79">79</a><span class="code-text">target operating system](./cli-customization.md). If this is not possible, package maintainers can customize</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L80" href="#L80">80</a><span class="code-text">numbat during compilation by setting the environment variable `NUMBAT_SYSTEM_MODULE_PATH` to the final locatiom.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L81" href="#L81">81</a><span class="code-text">If this variable is set during compilation, the specified path will be compiled into the `numbat` binary.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L82" href="#L82">82</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L83" href="#L83">83</a><span class="code-text">In order to test that everything is working as intended, you can open `numbat` and type `let meter = 2`. The</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L84" href="#L84">84</a><span class="code-text">path in the error message should point to the specified location (and *not* to `&lt;builtin&gt;/…`).</span></span></pre></div></div>
</main>
</body>
</html>
