Skip to content

August 1, 2026 batch - #2227

Merged
SchoolyB merged 42 commits into
mainfrom
batch/august-1-2026
Jul 31, 2026
Merged

August 1, 2026 batch#2227
SchoolyB merged 42 commits into
mainfrom
batch/august-1-2026

Conversation

@SchoolyB

@SchoolyB SchoolyB commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

This PR contains several bug fixes, new features, added test coverage, documentation updates, performance & security improvements, and general cleanup.

Features

Bug Fixes

Security

Performance

Tests

Documentation

Misc.

SchoolyB added 30 commits July 27, 2026 13:18
…#2189)

Add pointer aliasing and const-sourced pointer documentation to
Section 3.1.10 and safety table rows to Section 11.7, reflecting
current compiler behavior after the addr() const changes.
Clarify E3122 to "cannot modify value through pointer; the pointee
is a const-declared variable" and update the call site comment and
integration test descriptions to match.
Add `gray cross build` and `gray cross targets` commands that route
the C compilation step through `zig cc` for cross-platform builds.
Zig is only required for cross-compilation — native builds are unchanged.

Adds `--cc` flag to grayc so the Go CLI can override the C compiler,
a target map (linux-amd64, linux-arm64, windows-amd64, mac-arm64,
mac-amd64), and Go unit tests for target validation, flag wiring,
and error handling.
new() previously only accepted struct types. It now works with
primitives, sized integers, floats, arrays, maps, enums (regular,
string, tagged), and arbitrarily nested collection types.
…ant zeroing (#2151)

Split gray_arena_alloc into a zeroing wrapper and an uninitialized core.
Callers that immediately overwrite the allocation (string ops, array
growth, map rehash/clone, bigint conversions) now skip the redundant
memset, eliminating double-writes on hot paths.
Add man doc blocks to threads, sync, channels, and atomic headers.
Fix malformed man blocks in channels.h. Skip unqualified man lookup
for stdlib names that collide with language keywords (e.g. gray man or
shows the keyword; gray man atomic.or shows the atomic op).
…revent spurious E4017 (#2197)

The Pass 3 generic re-check loop did not save/restore current_struct_name,
causing private-access checks to treat calls from within a struct function
as external calls when the function used wildcards.
)

Avoid calling the function twice on the same name by assigning the
result in the condition and reusing it.
…ations (#2215)

These were superseded by mem.init and mem.destroy but their table
entries remained, allowing invalid code to pass typechecking and
fail at C compilation.
…egfault

The inline assignment `(result = ...) != NULL` clobbered `result` with
NULL when the lookup returned nothing, replacing the TYPE_UNKNOWN
default and causing a segfault in the typechecker test suite.
Implement `alias Name = Type` for creating interchangeable type names
that are erased at compile time. Supports primitives, structs, enums,
collections, and pointers with transitive chain resolution.
)

The for_each collection parser only handled single-level member access
(obj.field). Replace the one-shot member expression with a while loop
that consumes all dot levels, enabling a.b.c.d etc.
…-return, error handling, pointers, containers (#2212)
SchoolyB added 9 commits July 28, 2026 02:45
Define GRAY_SYNTH_PREFIX, GRAY_SYNTH_TMP, and GRAY_SYNTH_OR in ast.h
and replace hardcoded "_gray_tmp", "_gray_or", and "_gray_" strings
in parser.c, typechecker.c, and codegen.c.
Cover strings, arrays, maps, math, fmt, encoding, and strconv with
direct C unit tests exercising happy paths, edge cases, and
result-returning error variants.
…codes (#2214)

Adds dedicated fail tests for 42 single-file error codes and 2
multi-file error codes that had no integration test coverage.

Covered codes: E1005, E2013, E2062, E2074, E2075, E2076, E2079,
E2080, E2081, E2083, E2087, E3007, E3038, E3072, E3075, E3076,
E3077, E3078, E3079, E3080, E3081, E3086, E3087, E3088, E3095,
E3100, E3111, E3112, E3113, E3114, E3115, E3116, E3125, E3127,
E3128, E3129, E4004, E4012, E4014, E5012, E5013, E5027, E5035,
E6004.
…name E4006 test (#2226)

Remove E3067 from error registry (duplicate of E3027, never emitted).
Fix E4021 private type alias check to strip module prefix before
comparing (lib_ID -> ID) so cross-module private alias access is
correctly rejected. Rename E4006_private_function_access test directory
to E4015 to match the error code it actually triggers.
@github-actions github-actions Bot added documentation Improvements or additions to documentation lexer Related to tokenization and lexical analysis parser Related to parsing and AST construction typechecker Related to type checking and validation module-system Related to imports, exports, and module loading stdlib General standard library issues tests Related to unit tests or test infrastructure error-messages Related to improving error messages CI/CD Continuous Integration/Continuous Deployment cli Command-line interface related grayc Related to the grayscale compiler core or its internal tooling labels Jul 31, 2026
@SchoolyB SchoolyB linked an issue Jul 31, 2026 that may be closed by this pull request
@SchoolyB SchoolyB changed the title August 1, 2026 August 1, 2026 batch Jul 31, 2026

void *gray_arena_alloc(GrayArena *arena, size_t size) {
void *ptr = gray_arena_alloc_uninitialized(arena, size);
memset(ptr, 0, ALIGN_UP(size, 8));
memcpy(sname_buf, fs->name, prefix_len);
sname_buf[prefix_len] = '\0';
if (is_struct_name(checker, sname_buf))
checker->current_struct_name = sname_buf;
Comment thread grayc/src/main.c
continue;
}
if (strcmp(argv[i], "--cc") == 0 && i + 1 < argc) {
cc_override = argv[++i];
@SchoolyB
SchoolyB merged commit 54041c8 into main Jul 31, 2026
4 of 8 checks passed
@SchoolyB
SchoolyB deleted the batch/august-1-2026 branch July 31, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Continuous Integration/Continuous Deployment cli Command-line interface related documentation Improvements or additions to documentation error-messages Related to improving error messages grayc Related to the grayscale compiler core or its internal tooling lexer Related to tokenization and lexical analysis module-system Related to imports, exports, and module loading parser Related to parsing and AST construction stdlib General standard library issues tests Related to unit tests or test infrastructure typechecker Related to type checking and validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants