Skip to content

Commit ae89513

Browse files
committed
chore: prepare v0.4.0 release
1 parent acc120d commit ae89513

File tree

3 files changed

+46
-9
lines changed

3 files changed

+46
-9
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,22 @@
7070
- New assembly instructions for binary operations (add, sub, imul, idiv)
7171
- Proper handling of division and remainder with EAX/EDX registers
7272
- Sign extension support using cdq instruction
73-
- Updated instruction fix-up pass for binary operation constraints
73+
- Updated instruction fix-up pass for binary operation constraints
74+
75+
## 0.4.0.0 -- 2024-12-03
76+
77+
### Added
78+
- Hierarchical modules for better code organization:
79+
- Halcyon.Core
80+
- Halcyon.Frontend
81+
- Halcyon.Backend
82+
- Halcyon.Driver
83+
84+
### Changed
85+
- Split Driver.Pipeline into focused modules:
86+
- Driver.Stages for pure compilation stages
87+
- Driver.External for GCC interactions
88+
- Driver.Output for handling stage results
89+
- Driver.Pipeline remains as high-level orchestration
90+
- Reorganized module exports in cabal file
91+
- Improved module documentation and organization

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,34 @@ The compiler currently handles C programs with unary operators and integer const
88

99
```c
1010
int main(void) {
11-
return ~(-42);
11+
return -((42 * 10) / (2 + 3)); // Returns -84
1212
}
1313
```
1414
1515
### Compilation Pipeline
1616
17-
The compiler processes source code through the following stages:
17+
The compiler is organized into several major subsystems:
1818
19-
1. **Lexical Analysis**: Breaks source code into a sequence of tokens
20-
2. **Parsing**: Converts tokens into an Abstract Syntax Tree (AST)
21-
3. **TACKY Generation**: Transforms AST into TACKY intermediate representation
22-
4. **Code Generation**: Transforms AST into x86_64 assembly
23-
5. **Code Emission**: Outputs the assembly code to an executable
19+
- **Frontend** - Parsing and analysis
20+
- Lexical analysis (breaks source into tokens)
21+
- Parsing (converts tokens to AST)
22+
- Token definitions
23+
24+
- **Core** - Core data types and compiler infrastructure
25+
- AST, Assembly, and TACKY intermediate representations
26+
- Compiler monad and error handling
27+
28+
- **Backend** - Code generation
29+
- TACKY to assembly conversion
30+
- Register allocation
31+
- Assembly output
32+
33+
- **Driver** - Pipeline coordination
34+
- Command line interface
35+
- Compilation pipeline stages
36+
- External tool integration (GCC for preprocessing and linking)
37+
38+
Each subsystem is organized as a hierarchical module that provides a clean interface to its functionality while hiding implementation details.
2439
2540
### Internal Representations
2641
@@ -85,20 +100,24 @@ Programs are represented internally using a series of increasingly lower-level d
85100
├── lib/ # Main library code
86101
│ ├── Halcyon.hs # Library entry point
87102
│ └── Halcyon/ # Core modules
103+
│ ├── Backend.hs # Backend subsystem interface
88104
│ ├── Backend/ # Code generation and emission
89105
│ │ ├── Codegen.hs # TACKY to Assembly conversion
90106
│ │ ├── Emit.hs # Assembly to text output
91107
│ │ └── ReplacePseudos.hs # Register/stack allocation
108+
│ ├── Core.hs # Core subsystem interface
92109
│ ├── Core/ # Core data types and utilities
93110
│ │ ├── Assembly.hs # Assembly representation
94111
│ │ ├── Ast.hs # C language AST
95112
│ │ ├── Monad.hs # Compiler monad stack
96113
│ │ ├── Settings.hs # Compiler settings and types
97114
│ │ ├── Tacky.hs # TACKY IR definition
98115
│ │ └── TackyGen.hs # AST to TACKY transformation
116+
│ ├── Driver.hs # Driver subsystem interface
99117
│ ├── Driver/ # Compiler driver
100118
│ │ ├── Cli.hs # Command line interface
101119
│ │ └── Pipeline.hs # Compilation pipeline
120+
│ ├── Frontend.hs # Frontend subsystem interface
102121
│ └── Frontend/ # Parsing and analysis
103122
│ ├── Lexer.hs # Lexical analysis
104123
│ ├── Parse.hs # Parsing

halcyon.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: halcyon
3-
version: 0.3.0.0
3+
version: 0.4.0.0
44
-- synopsis:
55
-- description:
66
license: BSD-3-Clause

0 commit comments

Comments
 (0)