<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sam Vervaeck</title>
    <description>The latest articles on DEV Community by Sam Vervaeck (@samvv).</description>
    <link>https://dev.to/samvv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1033794%2F708d2df9-ce9b-4fef-9e6a-7434d8547beb.jpeg</url>
      <title>DEV Community: Sam Vervaeck</title>
      <link>https://dev.to/samvv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samvv"/>
    <language>en</language>
    <item>
      <title>Migrating The Bolt Programming Language To Rust</title>
      <dc:creator>Sam Vervaeck</dc:creator>
      <pubDate>Mon, 22 Jun 2026 19:07:58 +0000</pubDate>
      <link>https://dev.to/samvv/migrating-the-bolt-programming-language-to-rust-2dhp</link>
      <guid>https://dev.to/samvv/migrating-the-bolt-programming-language-to-rust-2dhp</guid>
      <description>&lt;p&gt;From today and onward I can quite confidently say that Rust is the final implementation language of the &lt;a href="https://github.com/boltlang/bolt" rel="noopener noreferrer"&gt;Bolt programming language&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After years of trying out different programming languages (from Haskell and OCaml to TypeScript)  and ideas (do I want an ML-style syntax or C-like?), I am very happy with how these experiments are converging. In this search Rust plays a pivotal role.&lt;/p&gt;

&lt;p&gt;Curious? Here's why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Losless syntax trees using Rowan
&lt;/h2&gt;

&lt;p&gt;Real editors not only type-check your code; they also might analyse and transform whitespace, formatting your code according to a certain set of rules.&lt;/p&gt;

&lt;p&gt;Above that, designing syntax trees in Rust can be quite a pain due to the way borrowing and ownership works. For one, it is very difficult to get a simple and safe pointer to the parent node in Rust.&lt;/p&gt;

&lt;p&gt;As opposed to abstract syntax trees, losless syntax trees keep track of this whitespace for you. The &lt;a href="https://crates.io/crates/rowan" rel="noopener noreferrer"&gt;Rowan&lt;/a&gt; libary provides a means for defining such syntax trees. It takes care of ownership and even thread-safety for you, so you can focus on things like type-checking.&lt;/p&gt;

&lt;p&gt;Rowan is based off the concept of red-green trees, where the green nodes contain the data and the red nodes are simple 'views' on this data. The red nodes are constructed whenever the program needs a node of a certain type, while the green nodes are usually constructed during parsing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Robust query engine with Salsa
&lt;/h2&gt;

&lt;p&gt;Another Rust crate that makes your life as a compiler writer that much easier is &lt;a href="https://crates.io/crates/salsa" rel="noopener noreferrer"&gt;Salsa&lt;/a&gt;. It is difficult to work with at first, but once you get the hang of it, it will speed up the development of your compiler tremendously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qkydt6t3ndoxdg2ot2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qkydt6t3ndoxdg2ot2i.png" alt="The Salsa logo" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Salsa is a tool to build an incremental query-based compiler. With Salsa, there are a few top-level queries one can make about the inputs (such as some programming code written in your language), which get split up in smaller queries. These queries trigger even more queries, all the way down until an answer is formed. The answer then is cached, so that if only a single bit of your inputs change, not everything has to be re-computed from scratch. &lt;/p&gt;

&lt;p&gt;The amazing thing is that you as a compiler designer need not to take into account the million ways of which an input might be changed. Salsa takes care of it. Brilliant!&lt;/p&gt;

&lt;p&gt;I highly recommend to read &lt;a href="(https://ollef.github.io/blog/posts/query-based-compilers.html)"&gt;this article from Olle Fredriksson&lt;/a&gt; and &lt;a href="https://salsa-rs.netlify.app/" rel="noopener noreferrer"&gt;the official Salsa documentation&lt;/a&gt; to learn more!&lt;/p&gt;

&lt;h2&gt;
  
  
  Beautiful error messages with Ariadne
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codeberg.org/zesterer/ariadne" rel="noopener noreferrer"&gt;Ariadne&lt;/a&gt; is a Rust crate that does all of the dirty work for you when all you want is print a diagnostic message to the terminal. It creates beautiful and very readable error messages, pointing exactly to the location in your source file where the error occurred.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4hp1suzcj4974ka75c6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4hp1suzcj4974ka75c6c.png" alt="Preview of Ariadne" width="668" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Thanks to the useful Rust libraries out there, writing a compiler has never been so easy. I will continue to work on my programming language called &lt;a href="https://github.com/boltlang/bolt" rel="noopener noreferrer"&gt;Bolt&lt;/a&gt; using this blueprint. I hope that you might consider it, too!&lt;/p&gt;

</description>
      <category>pldev</category>
      <category>rust</category>
      <category>opensource</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
