Haze
A compiler and linker toolchain for my custom programming language targeting x86 and RISC-V.
C++
x86 Assembly
RISC-V Assembly
WebSockets
Haze
A compiler and linker toolchain for my custom programming language targeting x86 and RISC-V.
A bespoke, from-scratch, full-stack toolchain for my custom programming language, haze, targeting x86 Windows (32-bit) and RISC-V bare-metal (32-bit). Haze includes a custom compiler, assembler, linker, and language server daemon designed to interface with Clarity, a powerful analysis tool designed to complement the toolset.
github.com/connorjlink/hazeCompiler
Atop a custom recursive-descent parser, the compiler implements my own haze compiled programming language with custom backends and linkers for both x86 and RISC-V processors.
Displayed below are a sample program compilation input and output formatted in haze intermediate representation assembly.
.include "std.hz"
function byte main()
{
asm
{
.define TEST = 1
.org &$8000
copy r0, #TEST
copy r1, #TEST
iadd r0, r1 ; 1 + 1
}
byte foo = (2 * 3) + 1; // 7
return foo;
}
; Generated by the haze optimizer
; @ 8/14/2024 23:11:02
.org &$8000
main:
copy r0, #7
push r0
exit
Interpreter
Sharing syntax with the haze compiler, the interpreter can hook the geo runtime as an intepreted scripting language using custom socket IPC or execute freestanding.
Shown below are both a standalone "unhook" and geo-interfacing script.
.include "std.hzi"
.define A = 1
.define B = 2
.define C = 3
.macro MUL = (x, y):
{
[x] * [y]
}
function nvr main()
{
// no MQTT hook install
.unhook
byte foo = $MUL(A, B) + C;
print(foo * 2); // output: 10
}
.include "std.hzi"
.define RANGE = 1
.macro X = (a):
{
a[0]
}
intrinsic sky_color = [.5, .5, .5];
intrinsic mouse_sensitivity = 50;
intrinsic fov = 90;
function nvr main(float ΔT)
{
if ($X(sky_color) < RANGE)
$X(sky_color) += ΔT;
else if ($X(sky_color) > RANGE)
$X(sky_color) -= ΔT;
}
Assembler
Internally utilizing the powerful haze frontend, the assembler transforms custom assembly language source code into haze machine code.
Emulator
Simulating haze machine code program execution at several KHz, the emulator eases smoke-testing with live data watches and on-the-fly disassembly.
Language Server
A fully LSP-compliant language server implementation, haze-ls offers contextual autocomplete and custom syntax highlighting for the haze language in VSCode.
github.com/connorjlink/haze-ls
marketplace.visualstudio.com/items?itemName=connorjlink.haze-ls
Clarity
A web-based source code editor and from-scratch LSP, DAP, and LSIF clients for Haze.
Svelte
HTML
CSS
TypeScript
LSP
DAP
LSIF
Clarity
A web-based source code editor and from-scratch LSP, DAP, and LSIF clients for Haze.
Absent of industry-standard development environments and tools for Haze, Clarity serves an important role in underpinning the software creation and testing experience with the language with several innovative representations and language intelligence features like LSP, DAP, and LSIF.
github.com/connorjlink/clarity
clarity.connorjlink.com
Compiling
Using a bespoke source editor and unique five-pane compiler interface, Clarity facilitates efficient writing and compilation of Haze source code powered by a custom LSP-compliant intelligence provider and LSIF-compliant indexer with deltas-based messaging and incremental builds and linking.
Analyzing
Clarity's novel five-pane interface clearly highlights each critical stage of the compilation process: source code, abstract syntax tree, intermediate representation, machine code, and packaged executable. Clarity depicts datapoints within each component as discrete but intrinsically linked with a novel K-partite dependency representation.
Debugging
Using a DAP client connected to my Mist debug server, Clarity offers a seamless development and testing experience with breakpoint management, execution stepping, and clear program data inspection using an expression-based watch.
Education
Clarity includes detailed documentation and work-ups to inform users about my process of designing and implementing the tool. Importantly, Clarity also provides extensive tutorials, explanations, and blog-form examples to teach fundamental concepts and noteworthy techniques to aspiring compiler engineers.
clarity.connorjlink.com/#learn
Horizon
A custom five-stage hardware-scheduled pipelined, branch-predicting, multithreaded RISC-V processor design.
VHDL
RISC-V Assembly
Python
Horizon
A custom five-stage hardware-scheduled pipelined, branch-predicting, multithreaded RISC-V processor design.
Processor
Engineered to suit modern RISC-V–compatible operating systems up to and including Linux, the design implements the base RV32-I instruction set as well as the extensions A, M, C, Zicsr, Zicntr, and Zifencei. The architecture uses both static and dynamic table-based branch prediction and intelligent simultaneous multithreading to support true instruction-level parallelism across five standard pipeline stages with hardware-accelerated hazard detection and data forwarding.
github.com/connorjlink/horizon
Stratus
A basic OS kernel with virtual memory, preemptive multitasking, and a custom GPU and keyboard driver.
C
RISC-V Assembly
Stratus
A basic OS kernel with virtual memory, preemptive multitasking, and a custom GPU and keyboard driver.
Kernel
Designed specifically for RISC-V (32-bit) and the QEMU "virt" platform with a VirtIO standard GPU, Stratus implements key features like hardware drivers, memory paging and virtual allocations, and preemptive, time-sharing scheduling. The kernel uses S-mode for critical operations and offers userland code a variety of typical system calls for assistance.
github.com/connorjlink/stratus
Mist
A modular software debugger for x86 Haze programs with support for stepping, tracing, breakpoints, and watches.
Rust
DAP
Mist
A modular software debugger for x86 Haze programs with support for stepping, tracing, breakpoints, and watches.
Debugger
Running as a standalone debug process communicating with the Clarity debug client via the Debug Adapter Protocol (DAP) over WebSockets and the Haze compiler via memory sharing, the debug server implements both hardware and software breakpoints, callstack-relative execution tracing and stepping, and memory, register, and variable watches. The server employs a custom protocol to leverage compiler symbol database information when servicing incoming requests and the Windows API debug and toolhelp libraries to facilitate kernel-level hardware debug features.
github.com/connorjlink/mist
Irradiance
A unidirectional path tracer with Cook-Torrance GGX BRDF global illumination and direct-light NEE with MIS.
C++
Python
Irradiance
A unidirectional path tracer with Cook-Torrance GGX BRDF global illumination and direct-light NEE with MIS.
Path Tracing
By simulating light rays with physically based materials, irradiance produces photorealistic scene renders with reflections, soft shadows, and global illumination. The renderer employs parallel processing and multiple importance sampling via next-event estimation and a Cook-Torrance BRDF with a bi-level BVH acceleration structure and full compatibility for ACES-alike HDR renders.
github.com/connorjlink/irradiancePost-Processing
Irradiance includes a post-process–pass Python script to simulate wave-based light effects like diffraction and depth-of-field. Beyond the in-render photographic modelling, the script uses dynamic PSF generation and convolution filtering to create physically based aperture diffraction spiking and blurring.
Depicted below are two example renders.
Luma
A modern interface for real-time setup and manipulation of path tracer programs.
C#
WinUI
Luma
A modern interface for real-time setup and manipulation of path tracer programs.
Application
Using a memory-mapped file for efficient interprocess bitmap sharing, Luma presents a sleek, modern interface for real-time setup and manipulation of path tracing programs' renders with minimal latency and maximal quality.
github.com/connorjlink/luma
AvioConnect
An iOS-based X-Plane 12 aircraft wireless control software utilizing device accelerometry.
Swift
SwiftUI
UDP
AvioConnect
An iOS-based X-Plane 12 aircraft wireless control software utilizing device accelerometry.
Application
Using onboard gyroscopic data and automated local Wi-Fi connectivity, AvioConnect provides seamless wireless control of X-Plane 12 aircraft and systems. Based around flexibility and precision, the application simplifies formerly complex setups and features strong compatibility and customizability over underlying datarefs to ensure faultless control in any scenario.
github.com/connorjlink/avioconnect
Locator
An easy-to-use photo metadata parser and geosummarizer tool.
Julia
Python
Locator
An easy-to-use photo metadata parser and geosummarizer tool.
Geotool
With EXIF metadata parsing and geospatial summarization capabilities, Locator simplifies the process of organizing and analyzing photo collections based upon location data. Locator takes a photo directory as input and produces a series of callout maps referencing individual points of interest and a collective summary to paint an overall geographical extent.
github.com/connorjlink/locator
Inspector
A sleek, performant MQTT monitoring client desktop application.
C#
WPF
MQTT
Inspector
A sleek, performant MQTT monitoring client desktop application.
An efficiency-first MQTT traffic monitoring client, inspector offers robust send/receive capabilities and high-level automation in a user-friendly, WPF-based window.
github.com/connorjlink/inspector
Rasterizer
A pair of software- and hardware-accelerated cross-platform rasterizer programs.
C++
GLSL
Rasterizer
A pair of software- and hardware-accelerated cross-platform rasterizer programs.
Voxelization
A modern-OpenGL–based voxel rendering program, geo utilizes geometry pre-generation, vertex batching, and indexed instancing for remarkable efficiency.
github.com/connorjlink/geoFlux
A compile-time ready templated linear algebra library for C++23 with an emphasis on computer graphics, Flux powers the voxel renderer with speed and ease of development.
github.com/connorjlink/fluxRasterization
Powered by a custom linear algebra library, rasterizer features frustum culling, depth buffering, and face-based shading to view arbitrary .obj models.
github.com/connorjlink/constexpr-linear-algebra-library
Depicted below are sample renders from both programs.
C8
An entirely custom software suite for a new 8-bit processor architecture.
C++
C
Yacc
Verilog
C8
An entirely custom software suite for a new 8-bit processor architecture.
Titanium
A novel programming language compiler designed for C8, Titanium uses the GNU Flex/Bison lexer and parser generators to transform custom source code into flat C8 assembly.
github.com/connorjlink/compilerDisplayed below are a sample program compilation input and output.
.macro BIT = (a):
{
(1 << [a])
}
function byte val test =
(byte val a,
byte val b,
byte val c)
{
return (a + b) | c;
}
function byte val main = ()
{
return $BIT(2);
}
.begin
.include "def.s"
@function_start_test:
ldb r0, %0
ldb r1, %1
adc r0, r1
ldb r1, %2
or r0, r1
push r0
@function_end_test:
pop IP
@function_start_main:
ldb r0, #1
rol r0, #2
push r0
@function_end_main:
pop IP
.end
Microcode
Extensively utilizing the C++ preprocessor, microcode synthesizes and serializes the custom μop sequences powering C8 instructions.
github.com/connorjlink/microcodeAssembler
Based around a GNU Flex/Bison lexer and parser, assembler flattens custom assembly language source code into raw C8 machine.
github.com/connorjlink/assemblerDisassembler
A fully custom binary analysis program, disassembler expands C8 machine code back into human-readable assembly source for debugging.
github.com/connorjlink/disassemblerEmulator
Designed to painlessly debug C8 binaries, emulator offers a readable behavior-level simulation of the C8 architecture.
github.com/connorjlink/emulatorHardware
A register-transfer-level design, hardware implements the C8 architecture in SystemVerilog for ultra-precise simulation.
github.com/connorjlink/hardware