It’s been a while since I published the last chapter of LazyVim for Ambitious Developers on the website, but I was waiting for the print edition to be available to share it widely. And that required waiting (twice) for proofs to be mailed to me. But it’s finally here! For a direct link to purchase the print edition, click here. I’m proud of the book contents. I’m pretty confident that even seasoned Vim power users would pick up one or two tricks they didn’t already know.

Continue reading

In earlier articles, we implemented a tokenizer for the Wasm text syntax (WAT). In part 6, we started building a parser. We ended that part on a bit of a down note when I realized we were in for yet another refactor. I’m in a better mood today and it’s looking like it won’t be so bad, after all! Reminder: You are reading content that took a great deal of effort to craft, compose, and debug.

Continue reading

In earlier articles, I introduced this “WAT to Wasm compiler in Roc” project, wrote some Roc code to load an input file, and implemented a tokenizer for a “hello world” of Wat to Wasm compilation. It was… more work than I expected. Four blog posts more work, to be precise! I have no idea where it’s going to end. But I do know what’s next! Parsing. Reminder: You are reading content that took a great deal of effort to craft, compose, and debug.

Continue reading

In earlier articles, I introduced this compiler project, wrote some Roc code to load an input file, and started implementing a tokenizer with error handling.

I think I need to admit that I have absolutely no clue how to estimate how long a blog article is going to be. I thought “build a compiler” would be one article. And then I thought “build a tokenizer” would be one article. sigh

I swear we’ll be done with tokenizing at the end of this post. But first we’ll take a detour to have a look at Roc’s very elegant built-in testing syntax.

Reminder: You are reading content that took a great deal of effort to craft, compose, and debug. If you appreciate this work, consider supporting me on Patreon or GitHub.

Continue reading

In earlier articles, I introduced the project, wrote some Roc code to load an input file, and started implementing a Tokenizer. This part takes a bit of a detour with a refactor to support rudimentary error reporting. Reminder: You are reading content that took a great deal of effort to craft, compose, and debug. If you appreciate this work, consider supporting me on Patreon or GitHub. Handling Errors during Tokenizing Before we start adding more tokens to tokenize the Hello World module, I want to beef up our error handling a bit.

Continue reading

In part 1 and part 2 of this series, I introduced the project and we wrote some Roc code to load an input file and save the compiled result to a different file.

Note: Other articles in this series are collected here.

However, we are a long ways from actually having that compiled result available! This article introduces the phases involved in writing a compiler and focus on implementing the first phase, known as lexical analysis or tokenizing.

Continue reading

My latest hair-brained project is a WAT-to-Wasm compiler written in the Roc programming language. I explained my (ir)rationale for the project in Part 1 of this series, which also included an introduction to the technologies we’ll be using.

Note: Other articles in this series are collected here.

In this article, we’ll get started writing some Roc code. We won’t get to the point where we are doing anything with WAT or Wasm, yet, but we will be able to load an input file and parse some command line arguments.

Continue reading

I’ve been curious about the Roc programming language for a while now, but I haven’t had/taken the time to really dig into it. I’ve read through the tutorial several times, but only yesterday did I actually sit down and install Roc and implement the tutorial. Today, I woke up with the ridiculous idea to build a compiler in the language.

A simple compiler, to be clear.

Continue reading

I’m working on a new book! This one will be published online with plenty of begging for support on my Patreon. If there is sufficient interest, I’m planning physical and ebook editions later this year. LazyVim for Ambitious developers is a book for the modal-editor-curious out there. Vim and Neovim have a reputation for being hard to learn and configure. LazyVim really negates that reputation, but its documentation still assumes that you have a lot of prior knowledge with Vim and Neovim.

Continue reading

Dexie Cloud was released publicly today, and I love this product so much that I want to lend my voice to the marketing effort.

Dexie.js is an incredible library for interacting with IndexedDB in the browser. It wraps the sometimes-obtuse (and oft-buggy) IndexedDB APIs with much more developer-friendly interfaces. And it is fully reactive; if you change something in the database, your React, Svelte, Vue, Angular, or Solid.js (Solid support is weak) app will live update all by itself! It’s a truly heavenly coding experience.

However, web users do not live in a vacuum, and storing things in IndexedDB is fraught. The browser may delete that data on a whim, and who among us only has one device these days? You might be able to use IndexedDB as a cache, but it can’t be your source of truth.

Until today.

Continue reading

Author's picture

Dusty Phillips

Canadian author and software developer.

Author and software developer

New Brunswick, Canada