A Compiler Writing Journey
Recorded: March 25, 2026, 3 a.m.
| Original | Summarized |
GitHub - DoctorWkt/acwj: A Compiler Writing Journey · GitHub Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert DoctorWkt acwj Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security Insights
masterBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History240 Commits240 Commits00_Introduction00_Introduction 01_Scanner01_Scanner 02_Parser02_Parser 03_Precedence03_Precedence 04_Assembly04_Assembly 05_Statements05_Statements 06_Variables06_Variables 07_Comparisons07_Comparisons 08_If_Statements08_If_Statements 09_While_Loops09_While_Loops 10_For_Loops10_For_Loops 11_Functions_pt111_Functions_pt1 12_Types_pt112_Types_pt1 13_Functions_pt213_Functions_pt2 14_ARM_Platform14_ARM_Platform 15_Pointers_pt115_Pointers_pt1 16_Global_Vars16_Global_Vars 17_Scaling_Offsets17_Scaling_Offsets 18_Lvalues_Revisited18_Lvalues_Revisited 19_Arrays_pt119_Arrays_pt1 20_Char_Str_Literals20_Char_Str_Literals 21_More_Operators21_More_Operators 22_Design_Locals22_Design_Locals 23_Local_Variables23_Local_Variables 24_Function_Params24_Function_Params 25_Function_Arguments25_Function_Arguments 26_Prototypes26_Prototypes 27_Testing_Errors27_Testing_Errors 28_Runtime_Flags28_Runtime_Flags 29_Refactoring29_Refactoring 30_Design_Composites30_Design_Composites 31_Struct_Declarations31_Struct_Declarations 32_Struct_Access_pt132_Struct_Access_pt1 33_Unions33_Unions 34_Enums_and_Typedefs34_Enums_and_Typedefs 35_Preprocessor35_Preprocessor 36_Break_Continue36_Break_Continue 37_Switch37_Switch 38_Dangling_Else38_Dangling_Else 39_Var_Initialisation_pt139_Var_Initialisation_pt1 40_Var_Initialisation_pt240_Var_Initialisation_pt2 41_Local_Var_Init41_Local_Var_Init 42_Casting42_Casting 43_More_Operators43_More_Operators 44_Fold_Optimisation44_Fold_Optimisation 45_Globals_Again45_Globals_Again 46_Void_Functions46_Void_Functions 47_Sizeof47_Sizeof 48_Static48_Static 49_Ternary49_Ternary 50_Mop_up_pt150_Mop_up_pt1 51_Arrays_pt251_Arrays_pt2 52_Pointers_pt252_Pointers_pt2 53_Mop_up_pt253_Mop_up_pt2 54_Reg_Spills54_Reg_Spills 55_Lazy_Evaluation55_Lazy_Evaluation 56_Local_Arrays56_Local_Arrays 57_Mop_up_pt357_Mop_up_pt3 58_Ptr_Increments58_Ptr_Increments 59_WDIW_pt159_WDIW_pt1 60_TripleTest60_TripleTest 61_What_Next61_What_Next 62_Cleanup62_Cleanup 63_QBE63_QBE 64_6809_Target64_6809_Target LICENSELICENSE Readme.mdReadme.md View all filesRepository files navigationREADMEGPL-3.0 licenseA Compiler Writing Journey Part 0: Introduction to the Journey I've stopped work on acwj and now I'm writing a new language all source code and scripts are (c) Warren Toomey under About A Compiler Writing Journey c parsing compiler lexical-analysis Resources Readme GPL-3.0 license Uh oh! There was an error while loading. Please reload this page. Activity 12.9k 225 1.2k Report repository Releases Packages
Uh oh! There was an error while loading. Please reload this page. Uh oh! There was an error while loading. Please reload this page. Contributors Uh oh! There was an error while loading. Please reload this page. Languages C Shell Other
Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
Warren Toomey’s “acwj” GitHub repository documents a comprehensive, self-compiling compiler project, meticulously developed with a focus on practical learning and a detailed understanding of compiler construction. The project’s progression, outlined through 64 parts, demonstrates a systematic approach to building a compiler for a subset of the C language. It begins with foundational elements such as lexical scanning and parsing, progressing through operator precedence, statement structures, variable declarations, and type systems, eventually culminating in ARM assembly code generation. A significant portion of the work focuses on addressing challenges related to memory management, pointer manipulation, and optimization techniques like constant folding and lazy evaluation. The repository’s structure emphasizes a pragmatic approach, incorporating refactoring efforts and a gradual refinement of the compiler’s capabilities. Toomey invests in regression testing and introduces runtime flags to improve predictability and debuggability. The compiler’s evolution is notably marked by the incorporation of complex data types, including structs, unions, and enums, alongside their respective access mechanisms. Furthermore, the documentation delves deeper into areas such as the C preprocessor, control flow statements (switch, break, continue), casting, and variable initialization. Importantly, the project’s development acknowledges the influence of Nils M Holm’s “SubC” compiler, utilizing borrowed code under the public domain license. Toomey strategically applies a different license – the GPL-3.0 – to his own code, reflecting his intent to maintain a distinct codebase with its own educational and collaborative goals. The repository’s documentation not only details the core compiler logic but also includes elements like "What's Next?" and "Code Cleanup," indicative of a continuous refinement and expansion of the project. A notable addition towards the end showcases the integration of a QBE backend for the 6809 CPU, demonstrating a shift toward a more versatile and optimized architecture. The project’s organization and meticulous documentation serve as a valuable resource for aspiring compiler designers and anyone seeking a deep dive into the intricacies of compiler construction. |