You are browsing as a guest. Sign up (or log in) to start making projects!

Helix

  • 2 Devlogs
  • 2 Total hours

A custom programming language written in Rust

Open comments for this post

1h 49m 59s logged

Compiler Kickoff

Started working on a bytecode compiler today which is a pretty big deal for the project. Up until now Helix has just been walking the AST directly to run code, but the goal is to eventually compile programs down to bytecode and run them on a virtual machine instead, which should be way faster and more interesting to build.

The first thing that actually works is arithmetic. You can write something like 1 + 2 * 3 and it’ll go through the compiler and come out as a sequence of opcodes. Also threw in a disassembler so you can actually see what bytecode gets generated, which is super useful for debugging.

Next up is getting variables and control flow working through the compiler, and then eventually building the VM that’ll run all of it.

0
0
4
Open comments for this post

30m 8s logged

Reduced source tracking overhead by introducing SourceHandle indirection

I replaced direct Source pointers throughout the compiler with 2-byte SourceHandle indices into a global source map. Each handle resolves to a Source entry (2 pointers) on lookup, eliminating redundant pointer storage across the codebase.

0
0
4

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…