How nickwanninger/alaska works
Major Components
• Compiler Front-End & Driver: Represented by the “compiler” directory. This contains the compiler executables in the “bin” folder, compiler header files under “include” and “ldscripts,” and build configuration via CMakeLists.txt. Emphasize that Alaska is designed to work as a drop-in replacement for clang.
• Compiler Passes & Optimizations: Under “compiler/passes” and “compiler/lib” you have custom passes (e.g., normalization, type inference, translation printer) that extend the compiler’s behavior. Identify these as a set of optimization and transformation modules which integrate with the front-end.
• Runtime System: Indicate the “runtime” directory as the module responsible for memory management. It contains “core” (which implements fundamental functions such as heap, thread cache, and object allocation), “include” for header definitions, “rt” for the runtime library glue code, and even specialized modules like “sim” and “yukon” for target-specific functionality.
• Test Suite: The huge “test” directory serves as the regression and correctness test bed. Represent it as a separate component which validates the behavior of both the compiler and the runtime.
• Tools & Utilities: Located in “tools,” include benchmarking notebooks, build scripts (e.g. for RISC-V and Yukon), and plotting utilities. These support building, profiling, and performance evaluation.
• Build & Dependency Management: Capture the build system (Makefile, CMakeLists.txt) and note the dependency management options (nix flakes, “make deps”) which are important for ensuring the correct versions of clang, llvm 16, and gclang are in use.
Relationships and Data Flow
• The Compiler Component consumes source code from the user and, using the custom passes (performing type inference, pointer flow analysis, and other translations), produces an executable that is instrumented to use handle‐based memory.
• The runtime system is linked (statically or dynamically) during compilation and at load time (via LD_PRELOAD for Yukon configurations) to provide actual memory management services.
• The build system (with CMake and nix) orchestrates the compilation of both the compiler modules and the runtime library.
• Tools interact with both the built compiler and runtime library to benchmark, test, and optimize performance.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly divide the compiler’s transformation passes from the runtime’s memory management functionalities.
Relevant Technologies and Frameworks
• Integration with LLVM infrastructure (clang, llvm 16) and gclang.
• Build and dependency management tools such as CMake/Make and Nix.
• For the runtime, show the production of shared libraries (e.g., runtime/libyukon.so.2) and the dynamic linking process.
Final Touches
• Annotations that mention dependency on clang/llvm16, usage of gclang, and specific notes about the Yukon build for RISCV.
• Components are interconnected in a way that visually presents the entire project lifecycle: from code input to compilation (with custom compiler passes) to runtime memory management, and finally to testing and performance evaluation using the provided tools.