Changelog
This record lists major changes to the Co (colang) language/compiler by release version. Versioning policy: 0.* = development/test releases, 1.* = official releases, 2.* = bootstrap.
V1.0.0
- Official release.
V0.7.0
classnow supports properties: a class member can be defined as a property via an accessor pair —int a { get { return _a; } set { _a = value; } }; readingobj.a/ writingobj.a = xuses the same syntax as an ordinary field and dispatches toget/setautomatically. Read-only (onlyget), write-only (onlyset) and auto-property sugar (int b { get; set; }, where the compiler synthesizes a hidden backing field) are supported; inside an auto-property’s accessor the contextual keywordfieldreads/writes that backing storage directly (matching C# 14 style).obj.prop++/--(prefix / postfix) and compound assignmentobj.prop += xall expand correctly as “read, modify, write”; a property has no independent storage address, so taking its address (&obj.prop) is an error.- New
privatekeyword + accessor-level visibility:privateis explicit sugar (semantically equivalent to omittingpublic; cross-module visibility is still governed by the singlepublicgate) and may precede members / methods / properties at the top level, the class header, and inside the class body;publicandprivatetogether on one declaration is an error. Each property accessor can carry its own visibility (e.g.public int a { get; private set; }) — an accessor markedprivatemay be called only inside the class that defines it, and external read/write is rejected per read-only / write-only. - Returning an owned class handle auto-retains: a function / method can now directly
returna class handle already held by a local variable or member; the compiler adds one reference-count increment, eliminating the previous double-free crash when returning an owned handle. This form was formerly rejected at compile time (“a function returning a class must return an unowned value”) and is now allowed. Read/write of handle-typed properties (whose type is a class) now participates correctly in reference counting. - Full type checking of
classmethod bodies: class methods and accessor bodies now receive the same level of checking as function bodies — undeclared identifiers, assignment and argument type compatibility, method-call argument count, unused variable / parameter warnings, missingreturnin a non-voidfunction, and other issues previously missed in method bodies are now diagnosed with wording and line/column positions aligned to clang (previously an undeclared name in a method body slipped through to a bareundefined symbolat link time). - Fix a class of compile-time misrejections in aggregate initialization: when a struct is partially initialized with a string literal for a char array and later members follow (e.g.
struct { unsigned char m1[3]; unsigned long m3; } b = { "12" };), and for ordered initialization involving unnamed / zero-width bit-fields, these were previously misjudged as type mismatches and rejected; they are now accepted like clang, with runtime values identical character-for-character. Known limitation: aunionwhose first member is an unnamed bit-field, and constant placement for a global initializer mixing “bit-field + zero-width bit-field + nested struct”, remain unsupported — such forms give a loud compile error rather than a silent wrong value. winapi.cocontinues to expand: added the service-control, desktop / window-station, named-pipe, and network-interface-table (GetIfTable2/MIB_IF_ROW2/MIB_IF_TABLE2) API families and struct layouts; the total now stands at about 565 Win32 API prototypes and 78 struct / union layouts, with about 12,600 constants (including the fullwinerror.herror-code mirror).
V0.6.1
winapi.coconstants greatly expanded: Win32 constants grow from a few hundred to roughly 12,600, including a full mirror of thewinerror.herror codes (7416 entries, line-by-line against Windows SDK 10.0.26100.0shared\winerror.h) and the user32 window / message / style, CommCtrl common-control, edit-box / menu / scrollbar / tray / hotkey families. Every entry was verified against SDK 10.0.26100.0 with 0 wrong values.winapi.cofixes 18 mismatches with the SDK: 14 function prototypes’ return / parameter types (e.g.SetLastErrorreturnsvoid,CreateSemaphoreWreturnsHANDLE,GetAsyncKeyStatereturnsSHORT), 1 constant value (IDC_NO), and 3 struct layouts (LOGPENrewritten per SDK,MODULEENTRY32Wfield names,WSADATA.szSystemStatuslength); before these fixes, calling these APIs could silently pass wrong arguments or read wrong values.[[subsystem("windows")]]can now be written at the top of a source file (application scope): previously the attribute only took effect when attached to themain/WinMainfunction; it can now be written as a standalone directive at the top level of a.cofile, so a Windows GUI program can be produced from the directive plusimportand top-level bare code — the “minimal Windows GUI example” in the docs (file-level[[subsystem("windows")]]+import * from winapi;+ bareMessageBoxA) now works. It takes effect only in the main module; the attribute in an imported module is ignored with a warning.winapi.cointernal restructure (transparent to users): the monolithicwinapi.cois split into an umbrella trio (winapi.co+ internal partswinapi_core.co/winapi_winerror.co) merged back via#includetext inclusion — existingimport … from "winapi.co"is unchanged and keeps working, with no user code needing modification.
V0.6.0
- C
_Complexsupport (core slice):.c/.conow support thefloat _Complex/double _Complextypes,+ - * /arithmetic,== !=comparison, the constantI(_Complex_I), and the<complex.h>accessorscreal/cimag/conj/cabs/carg/projection(withfvariants). This batch is a core slice: transcendental functions such ascexp/clog/csqrtand the standalone_Imaginarytype are not yet supported;int _Complexis an error when written;__STDC_NO_COMPLEX__remains defined, so portable code that relies on it to skip complex behaviour is unchanged. - Linker errors now report the source location: link-time
undefined symbolpreviously always pointed at<obj>:1:1with no source line; each undefined symbol is now resolved back to the real call-site file, line and column (falling back to the old form only when it cannot be located). <threads.h>adds the C11 timed functions:thrd_sleep/mtx_timedlock/cnd_timedwaitare now provided; and<threads.h>now includes<time.h>, sostruct timespecis directly visible without the user including the header themselves.- Fix duplicate
publicglobal declarations in one module making consumers read the initial value: previously, declaring the samepublicglobal variable twice in one.comodule split the module-internal instance from the exported one, so consumers read the initial value (0) instead of the latest; the two declarations now resolve to a single instance.
V0.5.4
ptr - ptrpointer difference fixed to 64 bits: subtracting two pointers was truncated to a 32-bitint, so a span over 2 GiB came out negative or wrong; it now returns a 64-bit value like clang, andsizeof(p - q)is corrected from 4 to 8.- Referencing a
public structno longer crashes: when apublic structhad a member type not markedpublic, the importing compiler used to crash outright; it now gets the size correctly and reports a clear error only when expanding the non-exported member’s fields. Member types referenced by apublic structshould still be markedpublic. math.hadds declarations forcopysign,nan,nextafterfand 2 more (5): these lacked prototypes, so calls were treated as returning an integer and silently produced wrong values; they are now declared and compute correctly.float.hadds C23 floating-point feature macros: new macros such asFLT_DECIMAL_DIG,DBL_DECIMAL_DIG,FLT_EVAL_METHODandFLT_HAS_SUBNORM(9 in total) for feature detection.#ifnow compares unsigned values correctly:u-suffixed constants and unsigned values over 32 bits were evaluated as signed inside#if, giving wrong results (e.g.#if 2147483648u > -1tested false); this now matches clang and tests true.winapi.coconstants corrected: 6 wrong values fixed (among themSTD_INPUT_HANDLE/STD_OUTPUT_HANDLE/STD_ERROR_HANDLEwere misaligned, soGetStdHandle(STD_OUTPUT_HANDLE)got the wrong handle) and 6 names that do not exist in the SDK removed. Code using these constants will change behaviour.
V0.5.3
- The top-level type aliases in
winapi.coare now usable across modules: 36 aliases —DWORD/WORD/BYTE/BOOL/HANDLE/HWND/LPARAM/WNDPROCand the rest — were not markedpublic, so even afterimport * from winapi;they still produceduse of undeclared identifier(and variables declared with those aliases were cascaded into the same error). All 36 are nowpublic typedef, so imported names can be declared and used directly. Behaviour change to note: these names now take part in cross-module same-name detection — if the imported module and the importing side each declare atypedefor a tag with one of these names, they clash. - Calling a non-
publicfunction across modules is now a compile-time error: calling a function that another module defines with a body but did not markpublicused to compile fine and then fail at link time with a bareundefined symbol: X(no source position); it is now rejected at compile time withcannot import non-public symbol 'X'plus source context for the offending line. The rule covers only functions that have a body and are notpublic; non-publicpure declarations such as[[lib]]/ external C library prototypes are still allowed. - Argument-count checking tightened (now including external API declarations): previously only functions with at least one parameter and a body were arity-checked. From this release, hand-written external API prototypes (no body) and zero-parameter functions
int f()/int f(void)are checked too and reporttoo many arguments/too few arguments— they used to pass silently and emit the call with the wrong arguments (mismatched registers/stack; when a[[lib]]import hit a real export, even linking succeeded).setjmp(env)is exempt by name (itssetjmp.hprototype takes 2 parameters, and the compiler injects the second). - Function prototype semantics now follow C23 (
()is equivalent to(void)): an empty parameter list is a zero-parameter prototype, and the whole legacy “non-prototype declaration” compatibility rule set is removed.void f(void); void f(int);is now a declaration conflict;void f(); void f(int a) { … }(previously accepted) is now rejected; calling a parameterlessf()with arguments now reportstoo many arguments. K&R-style definitions remain unsupported. Behaviour change to note: code relying on legacy non-prototype declarations turns into compile errors — matching what clang-std=c23decides. public typedef struct X Y;now has complete types inside non-root modules: after importing the module,sizeof(Y)/ a localY y;used to be falsely reported as incomplete, andp->amember access or anf(Y h)by-value parameter could even crash the compiler (0xC0000005, no diagnostic); usingY inner;as a struct value member failed only in LLVM verification. From this release the five alias forms are fully equivalent to thestruct Xtag form; genuinely incomplete types are still rejected in the front end with clang-matching diagnostics.
V0.5.2
math.hgains thelong doublemaths declarations (all 56 of the C standard family): thel-suffixed functions —asinhl/acoshl/atanhl/sqrtland the rest — had no declarations at all inmath.h. Following the C implicit-function-declaration rule, colang treated an undeclared function as returningint, so the call site read a floating-point result out of an integer register: compilation and linking both succeeded with no diagnostic, while the program produced garbage integers (which could even differ from run to run). This release adds all 56l-suffixed declarations, each prototype taken verbatim from the Windows UCRT header (including the host-specific spellings:nexttowardl’s second parameter islong double,ilogblreturnsint,lrintl/lroundlreturnlong,llrintl/llroundlreturnlong long, andscalblnl’s second parameter islong). Correctness fix: code that called these functions and received wrong values now receives the right ones.- New minimal
complex.h:#include <complex.h>used to fail outright because the standard library shipped no such header. This release deliverscomplex.h, which defines__STDC_NO_COMPLEX__per the C standard (honestly reporting that complex support is absent). colang still does not implement the_Complex/_Imaginarytypes, and this header deliberately does not defineI— definingIas a real number would let1.0 + 2.0 * Isilently evaluate to3.0(a wrong value with no diagnostic at all); sources that really use complex constructions still get explicit diagnostics instead of degrading into real arithmetic. Programs that merely include the header without using complex constructs now compile and run normally.
V0.5.1
- Warning-diagnostic classification system landed: added the command-line flags
-Werror(promote warnings to errors) and-Wno-<group>(silence a specific warning by group name); every warning is now trailed by its group tag[-Wxxx], so they can be toggled precisely. - Several clang
-Wall/-Wextrawarnings added: new-Wunused-variable,-Wunused-function,-Wunused-but-set-variable,-Wswitch(an enumswitchthat does not cover all enumerators and has nodefault), and-Wunused-parameter, each verified case by case against clang; also fixed a bug where a warning was emitted twice for a call to a forward-declared function with no body. - Bit-field and integer-width diagnostic conformance: spellings that were previously accepted silently — bit-field widths,
_BitInt/wchar_tunit widths, redefinition in the same scope, andfor/if/switchinit-statement scopes — are now all rejected with clang-matching wording and line/column positions. - Major
winapi.coexpansion: on top of V0.5.0 it adds process/thread enumeration, Shell/clipboard/process operations, Hook/keyboard/mouse input, resource loading/power/user name, synchronization objects/memory-mapped files/named pipes, file attributes/volume information/security tokens, heap/process times/handle duplication/IO control, priority/console/environment strings/symbolic links/disk space, console mode /VirtualQuery, registry enumeration/deletion, and named sync objects/waitable timers/heap operations/page locking, among others; the module now totals about 481 Win32 API prototypes, 72 struct/union layouts and 815 constants. Every struct layout was verified line by line against Windows SDK 10.0.26100.0 viasizeof/offsetof.
V0.5.0
long/unsigned longin.cosources is now 8 bytes (Windows target);longandlong longare now the same type..c/.hare unchanged and still follow the target data model (4 bytes on Windows / 8 on Linux). Three migration consequences: ①longandlong longcan no longer both appear in one_Generic; ② taking the address of a.colongvariable and passing it to an API prototype declared withint/unsigned int(winapi.cofollows the SDK spellings and never useslong) is now rejected as incompatible pointer types; ③ printing a 64-bit integer requires%lld—%ldreads only 4 bytes and yields a wrong value.winapi.coconstants corrected and expanded (every one of the 509 constants in the section was re-verified numerically against Windows SDK 10.0.26100.0):SM_CXSCREEN78→0,SOMAXCONN-1→0x7FFFFFFF,FILE_NOTIFY_CHANGE_LAST_WRITE0x8→0x10,PATCOPY0x00F00062→0x00F00021— code using these four constants changes runtime behaviour, since it previously passed wrong values. Also addedFILE_NOTIFY_CHANGE_SIZE,SM_CYSCREEN,SM_XVIRTUALSCREEN,SM_YVIRTUALSCREEN,SM_CXVIRTUALSCREENandSM_CYVIRTUALSCREEN, so locally re-declared stand-in constants can go back to thewinapi.coones.- Literal and type-specifier diagnostic conformance: the spellings below were silently accepted, folded to wrong values, or crashed the compiler with no diagnostic at all; they are now all rejected, with message text and line/column positions matching clang case by case: ① truncated exact-width suffixes (
1w,0x1w→invalid suffix 'w' on integer constant); ②signed/unsignedon floating-point types (signed float,unsigned double→'float' cannot be signed or unsigned); ③ mixed-case suffixes (1lL,1wB,1.0lF); ④ illegal digit strings (0b2,08,1f); ⑤ a missing exponent digit (1e,0x1p) and hexadecimal floating constants missing a significand or an exponent (0x.,0x1.5); ⑥ integer literals wider thanunsigned long long(18446744073709551616,0xFFFFFFFFFFFFFFFFFFFF). Valid spellings are unaffected:1uwb/1UWB/0b1010wb,1.0f/1.0L,08.5/09e1and9223372036854775808(typedunsigned long long) are still accepted. winapi.cobatch XIII expansion and two return-type corrections: correctedSendMessageA’s return typeint→long long(SDK returns LRESULT, 8 bytes on x64; the old spelling truncated the high 32 bits of the return value) andRegisterClassA’s return typeshort→unsigned short(SDK returns ATOM=WORD; window-class atoms always land in 0xC000–0xFFFF and read as negative when taken asshort). Added theWNDCLASSWstruct, 18 prototypes (user32CreateMenu/GetMenu/SetMenu/GetSubMenu/EnableMenuItem/RegisterClassW/UnregisterClassW/RegisterHotKey/UnregisterHotKey/LoadStringW; kernel32CopyFileW/RemoveDirectoryW/GetFileSizeEx/FormatMessageW/LocalAlloc/LocalFree; gdi32GetTextMetricsW; comdlg32GetSaveFileNameW) and 37 constants each verified line by line against Windows SDK 10.0.26100.0 (MOD_*/WM_HOTKEY/VK_F1..F4/MF_*/FORMAT_MESSAGE_*/LMEM_*/GENERIC_*/CREATE_*/FILE_*/ERROR_*, etc.), bringing the module to 374 prototypes / 46 struct-union layouts / 546 constants. A “known boundaries” section at the end ofwinapi.codocuments the compiler-layer limits still outstanding for consumers.- Windows x64 by-value struct/union ABI fix: the compiler used to lower every by-value struct/union parameter and return to
ptr, which does not match the winx64 ABI (aggregates of ≤ 8 bytes must be packed into a single general-purpose register; only larger ones take an implicit byval pointer). colang’s caller and callee sides shared the same lowering so internal calls stayed self-consistent — the mismatch only showed up when calling external Win32 APIs. Now aligned with clang: aggregates whose store size is 1/2/4/8 are lowered to the matching integer scalar (i8/i16/i32/i64) at the signature boundary; larger or non-power-of-two sizes stay asptr(the correct Microsoft x64 “pass by reference” lowering).WindowFromPoint(struct POINT)behaviour is corrected;SetFilePointerEx(union LARGE_INTEGER)is added towinapi.co; the corresponding item in the “known boundaries” section is flipped to fixed. Remaining boundaries: the 16-byte pure-integer aggregate “two-register” special case, and external APIs with >8-byte aggregates, are still passed by pointer. Non–Windows-x64 targets are unchanged byte-for-byte.
V0.4.1
- Diagnostics-conformance wave: compile-time errors/warnings and the diagnostic context were realigned with clang and ISO C/C++, converging several silent-wrong-value/misjudgement sites (file-scope
bool/integer constant folding now follows “nonzero is true”). - Diagnostics: every error/warning now shows the offending line with +/-2 lines of surrounding source and a caret;
-fno-diag-contextdisables it. - CLI and source-surface tightening: new
-l/--libto specify external libraries;[[lib]]andclassdefinitions are restricted to.cosources (rejected in.c/.h). - Co-layer robustness: fixed the degradation/crash when using a cross-module
public structby value inside animported module. winapi.cocontinues to expand: from V0.4.0’s 323 prototypes / 39 struct-union layouts / 396 constants up to roughly 356 prototypes / 45 struct-union layouts / 503 constants, adding the winsock (ws2_32) socket family, the crypt32 string-encoding family, and more.
V0.4.0
- The
classreference type (heap-only + automatic reference counting): instantiation vianew, member access viathis, instance methods and static members viaC::m(); handles are released in reverse frame order when leaving scope, andbreak/continue/gotopath terminations release them correctly. - Member and parameter types opened up: primitives,
class,struct/union/arrays all work — astruct/union/array member is embedded by value (not reference counted, allocated and freed with its host); a class handle as a parameter borrows (ownership is not transferred), as a member it is owned by the host (assignment takes ownership, the destructor releases cascadingly). - The
deletestatement: forced destruction (bypasses the count — destructor + cascading release + free); the slot is null-ed to prevent a double free; it can also be used to break reference cycles manually. public class: in a single module and under-o *.dll, exports the lifecycle protocols, the instance/static methods and the members.- Current boundaries: no inheritance and no virtual functions; a
public classin animported module cannot yet be consumed across modules; reference cycles are not broken automatically (usedelete). - Major
winapi.coexpansion: 323 Win32 API prototypes, 39 struct/union layouts and 396 constants, each re-verified against Windows SDK 10.0.26100.0; beyond the window/message-loop/drawing base it now adds dialogs, menus, common controls, tray icons, DWM, PDH, input method (imm32), file-time/directory enumeration and more. - Bare tags in the Co layer (C++ style): in
.cosources astruct/union/enumvariable definition, parameter orsizeofmay drop the keyword (Point p;), and apublictag of an imported module may be used bare as well; not enabled for.c, which stays byte-for-byte ISO C. - Version strings extended to four segments
MAJOR.MINOR.PATCH.Build: the fourth is a build counter increased by a real MSVC rebuild (it resets to zero when the three-segment version changes);-voutput and the PE version info of artifacts follow suit. - New default settings header
include/colang.h: expanded ahead of the main source at compile time (main source only, not for imported modules), for your own global macro definitions.
The last three items above (bare tags, the four-segment version, the default settings header) were already-shipped changes that never got recorded — the first two landed within the V0.3.1 cycle, the third in the V0.3.2 cycle; they are back-filled here.
V0.3.2
- Built-in resource compiler: parses
.rcsyntax, supports ICON / BITMAP / RCDATA / STRINGTABLE / VERSIONINFO / ACCELERATORS / DIALOGEX / MENU resource types; output embedded directly into the PE executable (byte-level alignment with rc.exe). - Linux cross-compilation & native linking:
--target=x86_64-unknown-linux-gnuemits ELF objects; the in-process lld ELF linker provides end-to-end executables; LP64 data model (long=8, void*=8, wchar_t=4) correctly dispatched. - Per-module compilation model promoted: each module compiles as an independent closure, cross-module same-name symbols are automatically routed (no collision); qualified access
mod.func()/mod.varsupported. wchar_tfully target-aware: width and signedness follow target (Win unsigned short 2 bytes / Linux int 4 bytes);wint_t,L'…'overflow judgement, and TC-prefixed characters dispatch correctly.- const diagnostics aligned with clang: read-only violations now carry
note: … declared const herepointing at the declaration site; new-Wdefault-const-initwarning (function-local const objects or those with const members without initializer). - DLL production: synthesised
DllMainentry carrier, top-level initialisation code driving,publicfunctions written into the export table. - Multiple fixes in integer literal type selection, bit-field masking, and dynamic CRT linking.
V0.3.1
- The
winapi.comodule:import … from "winapi.co"replaceswindows.h, an SDK-verified set of Win32 API prototypes / struct-union layouts / constants; the module grows across releases and totals 323 prototypes / 39 struct-union layouts / 396 constants as of 0.4.0. First introduced covering common GUI APIs for window creation, message loops, drawing and text metrics. - Windows GUI programs: the
[[subsystem("windows")]]attribute (or definingWinMain) produces a console-less windowed program. - Co-layer enhancements:
public const int/public structetc. from an imported module can be used across modules directly; designated initializers support chained designators and anonymousunionmembers. - C compatibility: universal character names (
\uXXXX) in identifiers;u8/u/U/Lprefixed character constants;sizeof(string literal);static_assertin multiple scopes; the[[nodiscard]]/[[noreturn]]/[[deprecated]]attributes. - Diagnostics:
constread-only enforcement, up-front incomplete-type diagnostics and rejection of non-constantswitchcaselabels, with wording aligned to mainstream compilers. - Fixes: two families of runtime crashes caused by global initializers being mis-folded to null.
- Release package flattened to
colang.exe + include/(no runtime redistributable, no extra configuration); native Linux (WSL) build brought up.
V0.3.0
- Built-in linker:
-cemits a COFF.obj, and the default action links the object into an executable — no dependency on an externalclang. - Static CRT linked by default: the produced exe ships without requiring the VC runtime to be installed.
-o <name>.dllproduces a Windows dynamic library: with an export table, and a.libimport library generated alongside the base name.[[lib("user32")]]declares library attribution, with no command-line flag needed.- Linking requires a locally installed Windows SDK / VC runtime (auto-located).
import(.cosource merge) landed:- Syntax:
import * | name [as alias], … from ("file" | module_name) [as ModAlias];; - Consumes
.cosources only;publicis the sole cross-module visibility gate; - Top-level statements run exactly once at first load, unified before the main entry in DFS-postorder topological order;
- Normalized absolute path dedup; DFS cycle detection reporting the full chain;
- Identifier form
from ais accepted, equivalent tofrom "a.co"(same directory only).
- Syntax:
- Referencing a non-imported symbol from the main source is rejected; importing a non-
publicsymbol via named or*form is rejected. - Non-
publicimported symbols are forced toInternalLinkageduring codegen (no externally-visible LLVM value is emitted).
See the “import (Module Import)” and “Module” chapters for semantics.
V0.2.0
- Added bare top-level code,
publicfunctions, andimportsupport; - Added DLL/SO generation;
- Fixed several issues against the C language test suite.
V0.1.0
A development/test release; the C language compiler is complete.
- The compiler supports C compilation; Co’s object-oriented and other extensions (such as class) are at the specification/planning stage and are not yet implemented.
V0.0.x
Development/test versions (historical). Features and syntax followed the then-current test versions and are not a release baseline.