C3 0.8.6 Release Notes: Enhancements to Library Management and Compilation
The latest release of C3, version 0.8.6, introduces significant improvements to library packaging and fetching, along with enhancements to compilation speed and binary size reduction.

C3 0.8.6 introduces a revamped library fetch functionality and a new target for packaging full-source libraries. Previously, the process of downloading libraries relied on a stop-gap solution involving downloads from the c3lang/vendor repository. This approach lacked versioning support and created unnecessary friction. The new features include a target for building a library from source and a simple repository protocol with versions and checksums. This improvement is supported by the evidence from the HN (Official) source, which details the changes in the library management process. [1]
The release includes a new target type called 'source-lib' that allows C3 source files to be packed into .c3l files, which can then be shipped. This change is described in the HN (Official) source, which provides an example of how to create a source library using the 'c3c build' command. This functionality enables developers to create and distribute libraries more efficiently, ensuring that the source code is properly packaged and versioned. [1]
In addition to library management improvements, C3 0.8.6 reduces the binary size of safe-mode binaries by one third. The HN (Official) source highlights that this reduction is achieved through an optimization of the code for checks in safe mode. This optimization involves creating panic functions on demand and reusing them, which significantly reduces the size of the executable. This change is a key performance enhancement that benefits developers by reducing the footprint of compiled applications. [1]
C3 0.8.6 introduces a new target type called source-lib, which allows developers to package C3 source files into .c3l files. These files are zip archives that include C3 sources, headers, prebuilt binaries per target, and a manifest.json. The manifest.json may contain version, authors, and langrev information. This packaging method replaces the previous stop-gap solution of downloading from the c3lang/vendor repository, which lacked support for versioning and created unnecessary friction. The source-lib target simplifies the process of creating and distributing libraries by automating the packaging of source files into .c3l files with a generated manifest. This change supports better version control and reduces the complexity of managing library dependencies. [1]
Advertisement
The C3 0.8.6 release also includes a repository protocol that allows users to fetch libraries from custom repositories. This is done using the command `c3c fetch`, which supports fetching from repositories addressed as <namespace>/<name>[@<version>]. This feature enables users to search for libraries using `c3c fetch-list`, get detailed information about a library with `c3c fetch-info`, and download specific versions of a library. The repository protocol is deliberately basic, requiring only three paths that answer GET requests: index.json, info/<namespace>/<name>, and download/<namespace>/<name>@<version>. This simplicity allows any static file host to function as a repository. The default repository is served directly from a branch of the vendor repository on GitHub. Additionally, the repository supports checksum verification, ensuring that downloaded libraries match the expected sha256 checksum. This feature enhances security and reliability by preventing unauthorized changes to libraries. [1]
One of the significant improvements in C3 0.8.6 is the reduction in the binary size of safe-mode binaries by one third. This optimization was achieved by improving the code for checks in safe mode, where C3 performs array bounds checks, null dereferences, and other safety checks. In previous versions, each of these checks built its own message, leading to a large number of messages in large programs. In 0.8.6, the code for checks was optimized, and panic functions were created on demand and reused, leading to a substantial reduction in binary size. This optimization is particularly beneficial for applications that require high performance and minimal memory usage. The change also affects the panic function signature, which now includes a short summary, an optional format string, and arguments with details. This update ensures that custom panic handlers can be updated to use the new signature, providing more detailed error information. [1]
C3 0.8.6 also includes stricter rules for casts, which were reviewed systematically to uncover corner-case crashes and miscompilations. These changes have led to more precise conversions, preventing certain types of errors that were previously too permissive. For example, assigning a negative constant to a wider unsigned type, such as `ulong x = -1;`, is now correctly an error. Similarly, converting between signed and unsigned integers of the same size in arrays, slices, and vectors now requires an explicit cast. This change ensures that developers are aware of the potential issues with such conversions and can handle them explicitly. Additionally, casting a non-constant integer larger than a pointer, such as an int128 to a pointer, is now an error. Developers must first narrow the integer to a pointer type before casting. These stricter rules enhance the reliability and safety of C3 programs by reducing the likelihood of subtle bugs and unexpected behavior. [1]
The release also introduces changes to the project.json file, allowing targets to depend on other targets, which are built first in the listed order. This feature enhances the modularity and organization of projects by enabling dependencies to be explicitly defined and managed. Additionally, strings in project.json can now use environment variables written as `${NAME}`, and the `env` and `env-override` properties can set environment variables for the exec scripts. This change provides greater flexibility in configuring build environments and managing dependencies. The new `@asmname` attribute sets the exact symbol name without platform-specific name mangling, which is useful for linker-generated symbols. This improvement ensures that symbols are consistently named across different platforms, enhancing compatibility and reducing the risk of naming conflicts. [1]
Advertisement
The Cali Reporter newsletter
The stories worth your time.
California, the country, and what comes next. Join our free newsletter for reporting that keeps you informed.
More in Technology
- Modern Web Guidance 1.0 and Browser Compatibility
Modern Web Guidance 1.0, announced by Chrome for Developers on November 10, introduces browser compatibility data to assist coding agents in building web features. The initiative emphasizes the importance of fallback…
- Apache mod_http2 Vulnerability Detection with Nmap
A new Nmap scripting module has been developed to detect the Apache mod_http2 vulnerability (CVE-2026-119618), addressing the challenges of identifying affected systems accurately.
- Securing Remote Vendor Access in Industrial Networks
Best practices for managing remote vendor access in operational technology (OT) networks emphasize controlled access points, multifactor authentication, and time-bound sessions to reduce cybersecurity risks.
