Dōji Devlog #0: ???
Welcome to the first devlog entry of Dōji, a simple scripting language that I'm building!
Most of my knowledge of programming languages and interpreters comes from the amazing Crafting Interpreters book by Robert Nystrom, but that doesn't (yet?) cover a bunch of features that most modern languages have.
So I'm building Dōji to learn about these missing features. This includes
- fibers/green threads as a form of concurrency
- a copying garbage collector as a personal challenge/experiment
- pattern matching to improve ergonomics
- support for async I/O through fibers
- using Zig to build the interpreter
- an FFI to Zig (and back)
Dōji will mostly look like JavaScript, with some simplifications, different keywords and added pattern matching. Here's a snippet of the syntax:
let {
Debug,
Fiber,
} = import("std");
let my_first_fiber = Fiber.new(fn () {
Debug.print("Hello from my first fiber!");
});
let my_second_fiber = Fiber.new(fn () {
Debug.print("Hello from my second fiber!");
});
my_first_fiber.resume();
my_second_fiber.resume();
Debug.info(my_first_fiber.is_done());
// => true
Oh, and the name Dōji is just "concurrent" in Japanese. I’ve learned that translating random words to Japanese is an easy way to create (mostly) unique and very pronounceable names.
You can check out the code for the project here. That's all for now, onwards to the next devlog entry!