<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Stack_machines on Inanna Malick</title>
    <link>https://recursion.wtf/tags/stack_machines/</link>
    <description>Recent content in Stack_machines on Inanna Malick</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 05 Oct 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://recursion.wtf/tags/stack_machines/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Single Pass Recursion in Rust</title>
      <link>https://recursion.wtf/posts/rust_schemes_3/</link>
      <pubDate>Wed, 05 Oct 2022 00:00:00 +0000</pubDate>
      <guid>https://recursion.wtf/posts/rust_schemes_3/</guid>
      <description>&lt;p&gt;This is the third post in a three-post series. In the &lt;a href=&#34;https://recursion.wtf/posts/rust_schemes&#34;&gt;first post&lt;/a&gt; we developed a stack-safe, ergonomic, and concise method for working with recursive data structures (using a simple expression language as an example). In the &lt;a href=&#34;https://recursion.wtf/posts/rust_schemes_2&#34;&gt;second post&lt;/a&gt; we made it fully generic, providing a set of generic tools for expanding and collapsing &lt;em&gt;any&lt;/em&gt; recursive data structure in Rust.&lt;/p&gt;&#xA;&lt;p&gt;In this post we will see how to &lt;em&gt;combine&lt;/em&gt; these two things - expanding a structure and collapsing it at the same time, performing both operations in a single pass. In the process, we will gain the ability to write arbitrary recursive functions over traditional boxed-pointer recursive structures (instead of the novel &lt;code&gt;RecursiveTree&lt;/code&gt; type introduced in my previous post) while retaining stack safety.&lt;/p&gt;&#xA;&#xA;&lt;link rel=&#34;stylesheet&#34; href=&#34;https://recursion.wtf/css/hugo-easy-gallery.css&#34; /&gt;&#xA;&lt;div class=&#34;box&#34; &gt;&#xA;  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;&#xA;    &lt;div class=&#34;img&#34;&gt;&#xA;      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://recursion.wtf/img/rust_schemes/stack_machines_1/simple_expr_eval.gif&#34; alt=&#34;execution graph for simultaneously expanding and collapsing a simple expression&#34;/&gt;&#xA;    &lt;/div&gt;&#xA;    &lt;a href=&#34;https://recursion.wtf/img/rust_schemes/stack_machines_1/simple_expr_eval.gif&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;&#xA;  &lt;/figure&gt;&#xA;&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
