Skip to content

Commit

Permalink
deploy: f6bc75f
Browse files Browse the repository at this point in the history
  • Loading branch information
Overcastan authored and Overcastan committed Nov 29, 2023
1 parent f7ed789 commit 139ae82
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
26 changes: 26 additions & 0 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,9 @@ <h1 id="miden-repl"><a class="header" href="#miden-repl">Miden REPL</a></h1>
<p>Miden REPL can be started via the CLI <a href="tools/../intro/usage.html#cli-interface">repl</a> command like so:</p>
<pre><code class="language-Shell">./target/optimized/miden repl
</code></pre>
<p>It is also possible to initialize REPL with libraries. To create it with Miden standard library you need to specify <code>-s</code> or <code>--stdlib</code> subcommand, it is also possible to add a third-party library by specifying <code>-l</code> or <code>--libraries</code> subcommand with paths to <code>.masl</code> library files. For example:</p>
<pre><code class="language-Shell">./target/optimized/miden repl -s -l example/library.masl
</code></pre>
<h3 id="miden-assembly-instruction"><a class="header" href="#miden-assembly-instruction">Miden assembly instruction</a></h3>
<p>All Miden instructions mentioned in the <a href="tools/../user_docs/assembly/main.html">Miden Assembly sections</a> are valid. One can either input instructions one by one or multiple instructions in one input.</p>
<p>For example, the below two commands will result in the same output.</p>
Expand Down Expand Up @@ -547,6 +550,29 @@ <h3 id="memaddr"><a class="header" href="#memaddr">!mem[addr]</a></h3>
<pre><code>&gt;&gt; !mem[87]
Memory at address 87 is empty
</code></pre>
<h3 id="use"><a class="header" href="#use">!use</a></h3>
<p>The <code>!use</code> command prints out the list of all modules available for import. </p>
<p>If the stdlib was added to the available libraries list <code>!use</code> command will print all its modules:</p>
<pre><code>&gt;&gt; !use
Modules available for importing:
std::collections::mmr
std::collections::smt
std::collections::smt64
...
std::mem
std::sys
std::utils
</code></pre>
<p>Using the <code>!use</code> command with a module name will add the specified module to the program imports:</p>
<pre><code>&gt;&gt; !use std::math::u64

&gt;&gt; !program
use.std::math::u64

begin

end
</code></pre>
<h3 id="undo"><a class="header" href="#undo">!undo</a></h3>
<p>The <code>!undo</code> command reverts to the previous state of the stack and memory by dropping off the last executed assembly instruction from the program. One could use <code>!undo</code> as often as they want to restore the state of a stack and memory <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> instructions ago (provided there are <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> instructions in the program). The <code>!undo</code> command will result in an error if no remaining instructions are left in the Miden program.</p>
<pre><code>&gt;&gt; push.1 push.2 push.3
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions tools/repl.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ <h1 id="miden-repl"><a class="header" href="#miden-repl">Miden REPL</a></h1>
<p>Miden REPL can be started via the CLI <a href="../intro/usage.html#cli-interface">repl</a> command like so:</p>
<pre><code class="language-Shell">./target/optimized/miden repl
</code></pre>
<p>It is also possible to initialize REPL with libraries. To create it with Miden standard library you need to specify <code>-s</code> or <code>--stdlib</code> subcommand, it is also possible to add a third-party library by specifying <code>-l</code> or <code>--libraries</code> subcommand with paths to <code>.masl</code> library files. For example:</p>
<pre><code class="language-Shell">./target/optimized/miden repl -s -l example/library.masl
</code></pre>
<h3 id="miden-assembly-instruction"><a class="header" href="#miden-assembly-instruction">Miden assembly instruction</a></h3>
<p>All Miden instructions mentioned in the <a href="../user_docs/assembly/main.html">Miden Assembly sections</a> are valid. One can either input instructions one by one or multiple instructions in one input.</p>
<p>For example, the below two commands will result in the same output.</p>
Expand Down Expand Up @@ -247,6 +250,29 @@ <h3 id="memaddr"><a class="header" href="#memaddr">!mem[addr]</a></h3>
<pre><code>&gt;&gt; !mem[87]
Memory at address 87 is empty
</code></pre>
<h3 id="use"><a class="header" href="#use">!use</a></h3>
<p>The <code>!use</code> command prints out the list of all modules available for import. </p>
<p>If the stdlib was added to the available libraries list <code>!use</code> command will print all its modules:</p>
<pre><code>&gt;&gt; !use
Modules available for importing:
std::collections::mmr
std::collections::smt
std::collections::smt64
...
std::mem
std::sys
std::utils
</code></pre>
<p>Using the <code>!use</code> command with a module name will add the specified module to the program imports:</p>
<pre><code>&gt;&gt; !use std::math::u64

&gt;&gt; !program
use.std::math::u64

begin

end
</code></pre>
<h3 id="undo"><a class="header" href="#undo">!undo</a></h3>
<p>The <code>!undo</code> command reverts to the previous state of the stack and memory by dropping off the last executed assembly instruction from the program. One could use <code>!undo</code> as often as they want to restore the state of a stack and memory <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> instructions ago (provided there are <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> instructions in the program). The <code>!undo</code> command will result in an error if no remaining instructions are left in the Miden program.</p>
<pre><code>&gt;&gt; push.1 push.2 push.3
Expand Down

0 comments on commit 139ae82

Please sign in to comment.