How to Write a Compiler #7 - Top Level Statements
C-minor's top-level statements are implemented by manipulating the AST before invoking the other compilation stages and are easy introduction to working with the AST.
C-minor's top-level statements are implemented by manipulating the AST before invoking the other compilation stages and are easy introduction to working with the AST.
For language products typical unit testing doesn't work well long term. Instead I recommend sandboxing for early prototyping and a dedicated test case file runner for more end-to-end style testing.
If ever there was a design pattern that's perfectly suited to a job, it's the visitor pattern for working with an abstract syntax tree. But what is the visitor pattern and why is it so well suited?
The Parser takes a stream of tokens, checks the syntax is valid and produces an Abstract Syntax Tree.
Ask anyone who's worked on a compiler, and they'll all agree that the Abstract Syntax Tree is the most important structure in the whole compiler. But what exactly is it and what is it used for?
Tokenization is the process of reading source code and splitting it into meaningful symbols that describe the program's content. It's the first step of any compiler.
C-minor is a strongly typed, garbage collected language that compiles to in-memory machine code for direct execution. Here's how I built it.
Recently I purchased a Microsoft Surface Laptop 4 to replace my aging MacBook Pro. The Surface is a great machine: excellent keyboard and trackpad, beautiful display. It's slim, lightweight, powerful, just enough storage and has good battery life. But what a pity that all of that is ruined by one
Configuring the Windows boot manager so third-party boot loaders can directly load different versions of Windows.
nvpatch is a command line utility to patch Windows x64 applications to enable NVidia and AMD discreet graphics GPUs on low power devices.
An algorithm for converting boolean bit flag expressions to fast bit mask and test operations and even faster execution via dynamic IL method generation.
Explains how to run EA Origin games on Linux under Steam and Proton, using NFS The Run as an example.