Skip to content

Releases: c3lang/c3c

Version 0.8.1

10 Jun 08:49

Choose a tag to compare

Changes / improvements

  • Add $$PROJECT_PATH, accessible through env::PROJECT_PATH.
  • Deprecate $field.get(a) and $field.set(a, b). Replaced by a.$field and a.$field = b.
  • Add a.$eval($field) as a variant of a.$field.
  • Add json pretty print.
  • $$atomic_store and $$atomic_load takes an alignment parameter.
  • $vaarg[^1] is supported. #3276
  • Improve error message when a keyword is used a block parameter. #3275
  • Correct tag method error messages from tagof/has_tagof to get_tag and has_tag
  • Don't resume parsing when implicit module names yield invalid names.

Stdlib changes

  • Add math::TAU / math::TWO_PI
  • Add values::expand to turn strings containing expressions into values.
  • Enhanced path::ls functionality, like searching for wildcard.
  • LinkedHashMap renamed OrderedMap, LinkedHashSet renamed OrderedSet. Old names are deprecated.
  • Added initial cpudetect on Linux / MacOS Aarch64.
  • Enable libc::errno for FreeBSD.
  • Checking filesize on Win32 now correctly reports errors. Getting the filesize now rejects directories.
  • ini::parse and related takes an error_line argument to identify the line with error.
  • JSON marshaling will return INVALID_NUMBER when encountering a inf or NaN for a float.
  • JSON decoding will reject 1. literals.
  • spawn now allows binding I/O and using different settings per pipe.
  • @loop_over_ai would leak fds, deprecated and replaced by @loop_over_addresses.
  • Correctly return error on native_fwrite and native_fread.
  • Prevent infinite spin on io::read_fully, File.load_buffer, File.load and File.save.
  • io::write_all now retries on incomplete writes.
  • GrowableBitSet.max_bit_set added.
  • Added UnboundedChannel.
  • BufferedChannel and UnbufferedChannel gets non-blocking push/pop.
  • FixedThreadPool and ThreadPool deprecated.

Fixes

  • @volatile_store on arrays were sometimes incorrectly lowered.
  • NPOT vectors as associated variables were incorrectly lowered on load. #3228
  • .get_tag and .has_tag did not work properly for globals and locals.
  • Vectors stored in unions lowered incorrectly causing an assert #3234
  • Segmentation fault during library fetch when the "dependencies" key is missing in project.json. #3233
  • .tags would crash if no attribute with arguments were present.
  • Rect.merge_point would sometimes result in a point outside of the rect.
  • Possible array overflow in SortedMap.
  • Possible memory overwrite in BackingArenaAllocator on realloc.
  • Realloc could cause data corruption in DynamicArenaAllocator.
  • OnStackAllocator would not correctly clear memory on calloc.
  • Vmem temp allocator would not correctly free all vmem on destroy.
  • Wasm memory allocation could overallocate unnecessarily.
  • VirtualMemory contract off by one error.
  • CPU detect of leaf7 on x86 incorrect.
  • Fixed project benchmark target parsing. #3237
  • Incorrect type on UIntLE and UIntBE.
  • CVaList would behave different incorrectly for types larger than 8 bytes on some platforms.
  • UTF32 BOM detection was broken.
  • Sort from DString.less was inconsistent.
  • Fix io::skip using 'read' vs 'read_byte', causing an error.
  • Slice2d.slice incorrectly handled slices with x/y offset and 0/negative length together.
  • String.to_integer incorrectly accepted some invalid characters for hex.
  • Removed broken StringIterator.get.
  • Fix to refcount behaviour, preventing issue on release.
  • File.close should always invalidate the pointer on close, even on failures.
  • Overlong conversions to unicode for %c at boundaries.
  • Do not rely on implicit allocation for getcwd.
  • Skipping symlinks wasn't properly implemented for Win32.
  • Reverse indexing a value that overloads indexing would index an anonymous copy of the value.
  • Fix case where member.set would hit an assert.
  • Same type casts would not become rvalues.
  • Hex decoding would leak memory on failure.
  • Codepage.by_name would not use normalized name.
  • @return? bar! didn't work if the identifier matched a macro.
  • Copying compile time strings during compile time folding with strings containing 0 would sometimes get truncated. #3267
  • Pem parsing did not correctly handle empty body, nor when the first line was too short.
  • Additional pem parsing bugs on malformed data handled.
  • Compiler would crash when getting the kind, qname, or alignment of an untypedlist.
  • untypedlist incorrectly had size property.
  • JSON handling of UTF16 surrogate pairs fixed.
  • base32, base64 and codepage would leak memory on encode/decode errors.
  • Indexing into a type with a $reflect value would sometimes cause a crash.
  • Using a faultdef hidden behind @if would cause a crash.
  • Taking the type of a macro method would cause a crash.
  • Cap array size to avoid overflow when making multidimensional arrays that are too large.
  • DynamicArenaAllocator would incorrectly handle some reuse cases.
  • __atomic_compare_exchange had an incorrect implementation.
  • channel::create_unbuffered would not correctly zero out memory, potentially yielding unpredictable result.
  • lock_timeout on Posix would sleep the entire sleep before retrying, and it would fail if it managed to sleep.
  • stack_size setting for threads was ignored on Posix.
  • Setting thread priority on Win32 was off by one.
  • Non-power-of-two-sized member of @bigendian bitstruct backed by char array wasn't working #3283.
  • Binary bitwise operations were not considered simple.
  • $expand was incorrectly made generic in generic modules. #3274
  • Mangle lambdas in macros without @ to ensure they work correctly on elf #3217.
  • DString.replace("", "X"); would crash.
  • DString.read_from_stream would not return the correct length when available was not supported by the stream.
  • @str_camelcase would yield same result as @str_pascalcase. #3287
  • conv::utf8to32 would not zero terminate in when the zero would be at the end of the buffer.
  • char16_to_utf8_unsafe would not load low byte unaligned when required.
  • Not all invalid UTF8 was detected.
  • UTF16 length detection was incorrect for utf16 with surrogate pairs.
  • Initializing a variable which has the type of an optional struct using a const value would fail codegen. #3288
  • Parsing a malformed hex float would not correctly get reported.
  • Parsing an integer with trailing space would incorrectly be reported as an error.
  • String.escape used the incorrect default for stripping quotes.
  • mem::equals would not correctly compare slices of with element size > 1.
  • AsciiCharset.contains incorrectly handled char > 127.
  • Reuse of recently freed DynamicArenaAllocator allocations failed.
  • Crash in codegen in some cases when RHS of a && or || was unreachable at lowering.
  • Visibility modifiers were incorrectly allowed on enum/constdef members.
  • Datetime format could not handle negative offsets with non-zero minutes.
  • NormalDist.random could occasionally return inf.
  • Url parser would fail on foo@bar.com.
  • Url parser would drop the port on http://[::1]:8080.
  • Ipv6 classification - is_link_local etc, was incorrect
  • env::get/set_var for Win32 would appear to fail when succeeding.
  • env::get_var had a race condition on Win32.
  • process::run_capture_stdout would remove the last character, even when it wasn't \n.
  • Add missing __powisf2 to compiler_rt.
  • // would count newlines twice when parsing JSONC.
  • Path::for_posix(".a/..") was not parsed correctly.
  • SortedMap.clear and SortedMap.free would work incorrectly on map initialized with ONHEAP.
  • GrowableBitSet would yield the wrong length.
  • GrowableBitSet would not work correctly on backing types bigger than uint.
  • DString.replace would not work correctly in some cases.
  • ByteWriter.ensure_capacity did realloc unnecessarily when the data exactly matched capacity.
  • DString.equals used int rather than sz for len comparison.
  • DString.replace_char would crash on empty DString.
  • io::read_varint and io::write_varint: handling for signed integers were broken.
  • io::write_tiny_bytearray and io::write_short_bytearray could have incomplete writes.
  • Splatting a partially raw array into a macro would miscompile. #3302
  • Getting the tag for an enum parameter caused a crash. #3307
  • Json marshalling of floats would lose precision.
  • Crash when initializing a bitstruct from an untyped list.
  • Shifting a vector by a non-numeric type would cause a crash rather than a compiler error.
  • Recursive macros were not detected when going by way of a lambda.
  • Compile time concatenation with an empty slice was lacking checks, causing a compiler crash.
  • Fix zip slip vulnerability.
  • Fixed issues with Object.to_value.
  • DString.len was incorrectly marked @dynamic.
  • Qoi decoder wasn't correctly signaling all invalid data.
  • Casting a constant string to a float vector was buggy, causing a compiler crash.
  • Codepage detection could fail values after the last element.
  • Xml parsing could leak memory if root was preceeded by Pi nodes.
  • DateTime.diff_years would not handle leap years properly.
  • Deque.free would not reset the capacity, making it break if later reused.
  • Formatter would overflow in cases like %2147483648d.
  • Distributions would drop convergence control setting on recursion.
  • In some rare cases available() could leave the stream in an unexpected state.

latest-prerelease-20260610-1810

10 Jun 18:10

Choose a tag to compare

Pre-release
latest-prerelease-tag

- `FixedThreadPool` and `ThreadPool` deprecated. Bump version.

Version 0.8.0_3

14 May 22:02

Choose a tag to compare

Changes / improvements

  • Removed "old-enums, old-slice-copy and old-compact-eq" feature flags.
  • Removed deprecated $evaltype.
  • Removed all deprecated (as of 0.7.11) types and functions from the stdlib.
  • Removed deprecated iXX and uXX suffixes.
  • Removed deprecated Enum.lookup.
  • Removed deprecated ? as suffix operator in the expression io::EOF?.
  • Removed deprecated module foo {Type} generic syntax.
  • Distinct types now defaults to be "structlike"
  • Removed @structlike attribute.
  • Removed deprecated @extern attribute.
  • : in contracts before description is now mandatory.
  • Removed deprecated Enum.associated (use Enum::members).
  • Removed deprecated Enum.elements (use Enum::len).
  • Removed deprecated foo_function.params (use $reflect(foo_function).params).
  • Removed deprecated $is_const.
  • Removed deprecated $assignable.
  • Enums now no longer directly support + and - – use ordinals instead.
  • For enums, using ++ and -- will step through enums with implicit wrap-around.
  • Rename isz -> sz.
  • Make $sizeof, $alignof and all similar functions return sz instead of usz.
  • Align literal types with C semantics.
  • Use value promotion instead of signedness promotion to int. So that small unsigned types promote to int, not uint.
  • Add a @mustinit attribute to enforce zero-initialization of a type. #3094
  • Improve error message when keyword is used instead of an expression. #3088
  • Add --warn-recursivecontracts.
  • Mutex.destroy and friends no longer return optionals.
  • Remove @operator(!=) overload.
  • Add @operator(<) overload, enabling type comparison overloads.
  • Generic inference can now look through pointer.
  • Enums now implicitly convert to their ordinal when used as indices.
  • Enums can no longer declare themselves inline.
  • Nested generics allowed inside generic functions/methods.
  • a = ... parameters may be shadowed if not defined.
  • $eval can now be used with named parameters, e.g. foo($eval("arg"): 2) #3090
  • Type properties are now accessed using :: and the "of" suffix, removed: int.sizeof -> int::size
  • Added $reflect with properties name, cname, qname, offset, alignment, size.
  • Added @kindof, @alignof and @sizeof macros.
  • Removed $nameof, $extnameof, $qnameof, $offsetof, $alignof, $kindof, $sizeof.
  • .nameof is changed to .description on fault and enum types.
  • Type property is_eq is renamed has_equals.
  • Type function tagof is renamed get_tag.
  • Add untypedlist as a usable type #2647.
  • ?? and ?: has new precedence and binds tighter than + and -
  • Added the tags property for types and $reflect.
  • Allow taking the type of an interface method.
  • Add $expand compile time function to convert strings to code.
  • Constdef now infers through unary negations.
  • Only used libraries are scanned for dependencies. #3144
  • $vaconst, $vaexpr and $vatype removed.
  • Improve error message on unsupported typeid runtime access at runtime. #3170
  • Added support for Emscripten.
  • Replace $vacount by $vaarg.len, replace $vasplat by ...$vaarg.
  • $vaarg behaves as $vaexpr.
  • Added docgen command to generate documentation.
  • Added jmpabs x86 CPU feature.
  • Implicit unsigned <-> signed integer conversions removed.
  • Added C3 Compiler setup installer for Windows
  • alias Foo = int::typeid now works.
  • $typeof => $Typeof, $typefrom => $Typefrom.

Stdlib changes

  • Add List.remove_unordered_at.
  • PanicFn now takes an int for row.
  • Add std::collections::Deque.
  • Add compare_to and compare_to_ignore_case to String. #3096
  • Add SortedMap based on skip lists.
  • Add OneShotChannel to std::thread::channel for single-send/single-receive thread synchronization.
  • BufferedChannel and UnbufferedChannel are now pointers, create using create_unbuffered and create_buffered
  • RingBuffer now conforms to foreach and adds additional functions.
  • Ini parser and encoder.
  • Updated ref::new argument order.
  • Support setting thread stack size.
  • Support setting thread priority.
  • Support syscall on RISCV.
  • Make DString.append_repeat polymorphic adding append_string_repeat and append_char_repeat.
  • Add DString.append_inline for optimized uses.
  • Ordering of object::new_* arguments are now "allocator first".
  • Add remove_unordered_at to FixedList.
  • Changed json to support two flavors of JSON: JSON and JSONC.
  • Changed json API: parse -> load, parse_string -> parse.
  • conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.
  • Mergesort added.
  • set_cursor is renamed seek, and the old seek is removed.
  • std::math name changes: HALF_PI => PI_2, PI_4 => QUARTER_PI, DIV_PI => INV_PI etc, cosec => csc, cotan => cot, muladd => mad
  • std::time name changes: diff_hour => diff_hours. DateTime.set_date => DateTime.set, datetime::from_date_* => datetime::at_*
  • std::hash method name convention changes: updatec / update_char => update_byte.
  • std::string name changes: strip => strip_prefix, strip_end => strip_suffix.
  • std::collections::object added Object.to_value to convert from an object to a value.
  • std::encoding::xml added for XML parsing and serialization.
  • Fix Path.append separator not honoring the specified environment.
  • Add multi part and extension support to Path.append.
  • The Path API now is split into PathPosix and PathWin, Path is implicitly castable to String and loses the str_view() method. Use path::tnew instead of path::temp for a temporary path.

Fixes

  • Slice comparison lowering would not work correctly in macros in some cases. #3095
  • Attributes @allow_deprecated, @constinit, @noalias, @nostrip, and @optional would erroneously accept parameters. #3098
  • Fix pipe handle leaks across concurrent process spawns #10067.
  • $$trap was incorrectly marked noreturn.
  • Recursive inclusion of contracts was not detected.
  • \r was not filtered when piping a source file from stdin.
  • SHA-3 and Keccak contexts are now explicitly @mustinit structures. #3110
  • UnbufferedChannel would deadlock on multiple producers.
  • Don't override sigaltstack when running with --sanitize=address. #3115
  • Binary search broken for some supported functions.
  • Fix bug casting (void*[<3>])x.
  • Compiler crash compiling a switch with a constant case range overlapping a constant case value. #3127
  • Incorrect handling of overaligned struct fields #3136
  • EnumSet with more than 128 entries was broken.
  • Handle underflow in zip.
  • Bugs in check for name suggestions on name mismatch.
  • Fix bug where only one ensure would not be inlined correctly. #3162
  • Incorrect error message when casting to non-existent enum.
  • Macro $Type = ... would not work correctly with $defined
  • Fix enum value handling in Object (std::collections::object) to conform with changes in enums.
  • Compiler assert in certain cases with ?? and void returns. #3168
  • Bug in compiler-rt for i128 shift.
  • LinkedBlockingQueue.push_timeout did not work correctly.
  • Splat into vaarg macro, where vaarg is not used #2782.
  • Comparison with floats had incorrect codegen, leading to incorrect results for NaN #3175.
  • Zeroing out simd vectors in a struct could in some cases lead to incorrect lowering #3179.
  • Incorrect lowering when returning a struct to an optional value on Win64 in some cases #3180.
  • Fix bug where a method is considered doubly generic if declared in a generic module for a generic type. #3176
  • Fix exp10 on platforms without exp10 as an LLVM builtin.
  • LLVM 23 compatibility: map Os/Oz to O2 pass pipeline, fix returnaddress intrinsic signature, add optsize/minsize function attributes.
  • Warning for ignored visibility modifiers was not emitted for macro methods #3071
  • while (String? x = foo()!) was accidentally allowed causing a lowering error.
  • Crash casting uint to bitstruct inside struct field assignment #3187
  • Vec2/Vec3 transform missed matrix translation.
  • Matrix rotation ignored matrix itself.
  • Fix BigInt shr, to_format, and others.
  • Fix ends in TDist.quantile, FDist.pdf, ChiSquaredDist.pdf
  • Fix to easing expo_in and bounce_inout.
  • deque with shrinking a zero sized list caused infinite loop.
  • Printing an enummap yielded the wrong character count.
  • Incorrect contract in FixedList allowed insert out of range.
  • Fix double-free in InterfaceList.
  • Object.set_at was incorrect.
  • Bitstruct with backing char[n] would occasionally be incorrectly stored.
  • fmuladd lowering crashes on a + -(b * c) with fastmath.
  • Constant folding -30 % -7 would incorrectly yield "2".
  • Parsing << in asm would not be correctly handled.
  • Incorrect lowering for float[<3>] when placed aligned in a struct.

Version 0.8.0_2

13 May 22:32

Choose a tag to compare

Version 0.8.0_2 Pre-release
Pre-release

Changes / improvements

  • Removed "old-enums, old-slice-copy and old-compact-eq" feature flags.
  • Removed deprecated $evaltype.
  • Removed all deprecated (as of 0.7.11) types and functions from the stdlib.
  • Removed deprecated iXX and uXX suffixes.
  • Removed deprecated Enum.lookup.
  • Removed deprecated ? as suffix operator in the expression io::EOF?.
  • Removed deprecated module foo {Type} generic syntax.
  • Distinct types now defaults to be "structlike"
  • Removed @structlike attribute.
  • Removed deprecated @extern attribute.
  • : in contracts before description is now mandatory.
  • Removed deprecated Enum.associated (use Enum::members).
  • Removed deprecated Enum.elements (use Enum::len).
  • Removed deprecated foo_function.params (use $reflect(foo_function).params).
  • Removed deprecated $is_const.
  • Removed deprecated $assignable.
  • Enums now no longer directly support + and - – use ordinals instead.
  • For enums, using ++ and -- will step through enums with implicit wrap-around.
  • Rename isz -> sz.
  • Make $sizeof, $alignof and all similar functions return sz instead of usz.
  • Align literal types with C semantics.
  • Use value promotion instead of signedness promotion to int. So that small unsigned types promote to int, not uint.
  • Add a @mustinit attribute to enforce zero-initialization of a type. #3094
  • Improve error message when keyword is used instead of an expression. #3088
  • Add --warn-recursivecontracts.
  • Mutex.destroy and friends no longer return optionals.
  • Remove @operator(!=) overload.
  • Add @operator(<) overload, enabling type comparison overloads.
  • Generic inference can now look through pointer.
  • Enums now implicitly convert to their ordinal when used as indices.
  • Enums can no longer declare themselves inline.
  • Nested generics allowed inside generic functions/methods.
  • a = ... parameters may be shadowed if not defined.
  • $eval can now be used with named parameters, e.g. foo($eval("arg"): 2) #3090
  • Type properties are now accessed using :: and the "of" suffix, removed: int.sizeof -> int::size
  • Added $reflect with properties name, cname, qname, offset, alignment, size.
  • Added @kindof, @alignof and @sizeof macros.
  • Removed $nameof, $extnameof, $qnameof, $offsetof, $alignof, $kindof, $sizeof.
  • .nameof is changed to .description on fault and enum types.
  • Type property is_eq is renamed has_equals.
  • Type function tagof is renamed get_tag.
  • Add untypedlist as a usable type #2647.
  • ?? and ?: has new precedence and binds tighter than + and -
  • Added the tags property for types and $reflect.
  • Allow taking the type of an interface method.
  • Add $expand compile time function to convert strings to code.
  • Constdef now infers through unary negations.
  • Only used libraries are scanned for dependencies. #3144
  • $vaconst, $vaexpr and $vatype removed.
  • Improve error message on unsupported typeid runtime access at runtime. #3170
  • Added support for Emscripten.
  • Replace $vacount by $vaarg.len, replace $vasplat by ...$vaarg.
  • $vaarg behaves as $vaexpr.
  • Added docgen command to generate documentation.
  • Added jmpabs x86 CPU feature.
  • Implicit unsigned <-> signed integer conversions removed.
  • Added C3 Compiler setup installer for Windows
  • alias Foo = int::typeid now works.
  • $typeof => $Typeof, $typefrom => $Typefrom.

Stdlib changes

  • Add List.remove_unordered_at.
  • PanicFn now takes an int for row.
  • Add std::collections::Deque.
  • Add compare_to and compare_to_ignore_case to String. #3096
  • Add SortedMap based on skip lists.
  • Add OneShotChannel to std::thread::channel for single-send/single-receive thread synchronization.
  • BufferedChannel and UnbufferedChannel are now pointers, create using create_unbuffered and create_buffered
  • RingBuffer now conforms to foreach and adds additional functions.
  • Ini parser and encoder.
  • Updated ref::new argument order.
  • Support setting thread stack size.
  • Support setting thread priority.
  • Support syscall on RISCV.
  • Make DString.append_repeat polymorphic adding append_string_repeat and append_char_repeat.
  • Add DString.append_inline for optimized uses.
  • Ordering of object::new_* arguments are now "allocator first".
  • Add remove_unordered_at to FixedList.
  • Changed json to support two flavors of JSON: JSON and JSONC.
  • Changed json API: parse -> load, parse_string -> parse.
  • conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.
  • Mergesort added.
  • set_cursor is renamed seek, and the old seek is removed.
  • std::math name changes: HALF_PI => PI_2, PI_4 => QUARTER_PI, DIV_PI => INV_PI etc, cosec => csc, cotan => cot, muladd => mad
  • std::time name changes: diff_hour => diff_hours. DateTime.set_date => DateTime.set, datetime::from_date_* => datetime::at_*
  • std::hash method name convention changes: updatec / update_char => update_byte.
  • std::string name changes: strip => strip_prefix, strip_end => strip_suffix.
  • std::collections::object added Object.to_value to convert from an object to a value.
  • std::encoding::xml added for XML parsing and serialization.
  • Fix Path.append separator not honoring the specified environment.
  • Add multi part and extension support to Path.append.
  • The Path API now is split into PathPosix and PathWin, Path is implicitly castable to String and loses the str_view() method. Use path::tnew instead of path::temp for a temporary path.

Fixes

  • Slice comparison lowering would not work correctly in macros in some cases. #3095
  • Attributes @allow_deprecated, @constinit, @noalias, @nostrip, and @optional would erroneously accept parameters. #3098
  • Fix pipe handle leaks across concurrent process spawns #10067.
  • $$trap was incorrectly marked noreturn.
  • Recursive inclusion of contracts was not detected.
  • \r was not filtered when piping a source file from stdin.
  • SHA-3 and Keccak contexts are now explicitly @mustinit structures. #3110
  • UnbufferedChannel would deadlock on multiple producers.
  • Don't override sigaltstack when running with --sanitize=address. #3115
  • Binary search broken for some supported functions.
  • Fix bug casting (void*[<3>])x.
  • Compiler crash compiling a switch with a constant case range overlapping a constant case value. #3127
  • Incorrect handling of overaligned struct fields #3136
  • EnumSet with more than 128 entries was broken.
  • Handle underflow in zip.
  • Bugs in check for name suggestions on name mismatch.
  • Fix bug where only one ensure would not be inlined correctly. #3162
  • Incorrect error message when casting to non-existent enum.
  • Macro $Type = ... would not work correctly with $defined
  • Fix enum value handling in Object (std::collections::object) to conform with changes in enums.
  • Compiler assert in certain cases with ?? and void returns. #3168
  • Bug in compiler-rt for i128 shift.
  • LinkedBlockingQueue.push_timeout did not work correctly.
  • Splat into vaarg macro, where vaarg is not used #2782.
  • Comparison with floats had incorrect codegen, leading to incorrect results for NaN #3175.
  • Zeroing out simd vectors in a struct could in some cases lead to incorrect lowering #3179.
  • Incorrect lowering when returning a struct to an optional value on Win64 in some cases #3180.
  • Fix bug where a method is considered doubly generic if declared in a generic module for a generic type. #3176
  • Fix exp10 on platforms without exp10 as an LLVM builtin.
  • LLVM 23 compatibility: map Os/Oz to O2 pass pipeline, fix returnaddress intrinsic signature, add optsize/minsize function attributes.
  • Warning for ignored visibility modifiers was not emitted for macro methods #3071
  • while (String? x = foo()!) was accidentally allowed causing a lowering error.
  • Crash casting uint to bitstruct inside struct field assignment #3187
  • Vec2/Vec3 transform missed matrix translation.
  • Matrix rotation ignored matrix itself.
  • Fix BigInt shr, to_format, and others.
  • Fix ends in TDist.quantile, FDist.pdf, ChiSquaredDist.pdf
  • Fix to easing expo_in and bounce_inout.
  • deque with shrinking a zero sized list caused infinite loop.
  • Printing an enummap yielded the wrong character count.
  • Incorrect contract in FixedList allowed insert out of range.
  • Fix double-free in InterfaceList.
  • Object.set_at was incorrect.
  • Bitstruct with backing char[n] would occasionally be incorrectly stored.
  • fmuladd lowering crashes on a + -(b * c) with fastmath.
  • Constant folding -30 % -7 would incorrectly yield "2".
  • Parsing << in asm would not be correctly handled.
  • Incorrect lowering for float[<3>] when placed aligned in a struct.

Version 0.8.0_1

13 May 14:14

Choose a tag to compare

Version 0.8.0_1 Pre-release
Pre-release

Changes / improvements

  • Removed "old-enums, old-slice-copy and old-compact-eq" feature flags.
  • Removed deprecated $evaltype.
  • Removed all deprecated (as of 0.7.11) types and functions from the stdlib.
  • Removed deprecated iXX and uXX suffixes.
  • Removed deprecated Enum.lookup.
  • Removed deprecated ? as suffix operator in the expression io::EOF?.
  • Removed deprecated module foo {Type} generic syntax.
  • Distinct types now defaults to be "structlike"
  • Removed @structlike attribute.
  • Removed deprecated @extern attribute.
  • : in contracts before description is now mandatory.
  • Removed deprecated Enum.associated (use Enum::members).
  • Removed deprecated Enum.elements (use Enum::len).
  • Removed deprecated foo_function.params (use $reflect(foo_function).params).
  • Removed deprecated $is_const.
  • Removed deprecated $assignable.
  • Enums now no longer directly support + and - – use ordinals instead.
  • For enums, using ++ and -- will step through enums with implicit wrap-around.
  • Rename isz -> sz.
  • Make $sizeof, $alignof and all similar functions return sz instead of usz.
  • Align literal types with C semantics.
  • Use value promotion instead of signedness promotion to int. So that small unsigned types promote to int, not uint.
  • Add a @mustinit attribute to enforce zero-initialization of a type. #3094
  • Improve error message when keyword is used instead of an expression. #3088
  • Add --warn-recursivecontracts.
  • Mutex.destroy and friends no longer return optionals.
  • Remove @operator(!=) overload.
  • Add @operator(<) overload, enabling type comparison overloads.
  • Generic inference can now look through pointer.
  • Enums now implicitly convert to their ordinal when used as indices.
  • Enums can no longer declare themselves inline.
  • Nested generics allowed inside generic functions/methods.
  • a = ... parameters may be shadowed if not defined.
  • $eval can now be used with named parameters, e.g. foo($eval("arg"): 2) #3090
  • Type properties are now accessed using :: and the "of" suffix, removed: int.sizeof -> int::size
  • Added $reflect with properties name, cname, qname, offset, alignment, size.
  • Added @kindof, @alignof and @sizeof macros.
  • Removed $nameof, $extnameof, $qnameof, $offsetof, $alignof, $kindof, $sizeof.
  • .nameof is changed to .description on fault and enum types.
  • Type property is_eq is renamed has_equals.
  • Type function tagof is renamed get_tag.
  • Add untypedlist as a usable type #2647.
  • ?? and ?: has new precedence and binds tighter than + and -
  • Added the tags property for types and $reflect.
  • Allow taking the type of an interface method.
  • Add $expand compile time function to convert strings to code.
  • Constdef now infers through unary negations.
  • Only used libraries are scanned for dependencies. #3144
  • $vaconst, $vaexpr and $vatype removed.
  • Improve error message on unsupported typeid runtime access at runtime. #3170
  • Added support for Emscripten.
  • Replace $vacount by $vaarg.len, replace $vasplat by ...$vaarg.
  • $vaarg behaves as $vaexpr.
  • Added docgen command to generate documentation.
  • Added jmpabs x86 CPU feature.
  • Implicit unsigned <-> signed integer conversions removed.
  • Added C3 Compiler setup installer for Windows
  • alias Foo = int::typeid now works.
  • $typeof => $Typeof, $typefrom => $Typefrom.

Stdlib changes

  • Add List.remove_unordered_at.
  • PanicFn now takes an int for row.
  • Add std::collections::Deque.
  • Add compare_to and compare_to_ignore_case to String. #3096
  • Add SortedMap based on skip lists.
  • Add OneShotChannel to std::thread::channel for single-send/single-receive thread synchronization.
  • BufferedChannel and UnbufferedChannel are now pointers, create using create_unbuffered and create_buffered
  • RingBuffer now conforms to foreach and adds additional functions.
  • Ini parser and encoder.
  • Updated ref::new argument order.
  • Support setting thread stack size.
  • Support setting thread priority.
  • Support syscall on RISCV.
  • Make DString.append_repeat polymorphic adding append_string_repeat and append_char_repeat.
  • Add DString.append_inline for optimized uses.
  • Ordering of object::new_* arguments are now "allocator first".
  • Add remove_unordered_at to FixedList.
  • Changed json to support two flavors of JSON: JSON and JSONC.
  • Changed json API: parse -> load, parse_string -> parse.
  • conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.
  • Mergesort added.
  • set_cursor is renamed seek, and the old seek is removed.
  • std::math name changes: HALF_PI => PI_2, PI_4 => QUARTER_PI, DIV_PI => INV_PI etc, cosec => csc, cotan => cot, muladd => mad
  • std::time name changes: diff_hour => diff_hours. DateTime.set_date => DateTime.set, datetime::from_date_* => datetime::at_*
  • std::hash method name convention changes: updatec / update_char => update_byte.
  • std::string name changes: strip => strip_prefix, strip_end => strip_suffix.
  • std::collections::object added Object.to_value to convert from an object to a value.
  • std::encoding::xml added for XML parsing and serialization.
  • Fix Path.append separator not honoring the specified environment.
  • Add multi part and extension support to Path.append.
  • The Path API now is split into PathPosix and PathWin, Path is implicitly castable to String and loses the str_view() method. Use path::tnew instead of path::temp for a temporary path.

Fixes

  • Slice comparison lowering would not work correctly in macros in some cases. #3095
  • Attributes @allow_deprecated, @constinit, @noalias, @nostrip, and @optional would erroneously accept parameters. #3098
  • Fix pipe handle leaks across concurrent process spawns #10067.
  • $$trap was incorrectly marked noreturn.
  • Recursive inclusion of contracts was not detected.
  • \r was not filtered when piping a source file from stdin.
  • SHA-3 and Keccak contexts are now explicitly @mustinit structures. #3110
  • UnbufferedChannel would deadlock on multiple producers.
  • Don't override sigaltstack when running with --sanitize=address. #3115
  • Binary search broken for some supported functions.
  • Fix bug casting (void*[<3>])x.
  • Compiler crash compiling a switch with a constant case range overlapping a constant case value. #3127
  • Incorrect handling of overaligned struct fields #3136
  • EnumSet with more than 128 entries was broken.
  • Handle underflow in zip.
  • Bugs in check for name suggestions on name mismatch.
  • Fix bug where only one ensure would not be inlined correctly. #3162
  • Incorrect error message when casting to non-existent enum.
  • Macro $Type = ... would not work correctly with $defined
  • Fix enum value handling in Object (std::collections::object) to conform with changes in enums.
  • Compiler assert in certain cases with ?? and void returns. #3168
  • Bug in compiler-rt for i128 shift.
  • LinkedBlockingQueue.push_timeout did not work correctly.
  • Splat into vaarg macro, where vaarg is not used #2782.
  • Comparison with floats had incorrect codegen, leading to incorrect results for NaN #3175.
  • Zeroing out simd vectors in a struct could in some cases lead to incorrect lowering #3179.
  • Incorrect lowering when returning a struct to an optional value on Win64 in some cases #3180.
  • Fix bug where a method is considered doubly generic if declared in a generic module for a generic type. #3176
  • Fix exp10 on platforms without exp10 as an LLVM builtin.
  • LLVM 23 compatibility: map Os/Oz to O2 pass pipeline, fix returnaddress intrinsic signature, add optsize/minsize function attributes.
  • Warning for ignored visibility modifiers was not emitted for macro methods #3071
  • while (String? x = foo()!) was accidentally allowed causing a lowering error.
  • Crash casting uint to bitstruct inside struct field assignment #3187
  • Vec2/Vec3 transform missed matrix translation.
  • Matrix rotation ignored matrix itself.
  • Fix BigInt shr, to_format, and others.
  • Fix ends in TDist.quantile, FDist.pdf, ChiSquaredDist.pdf
  • Fix to easing expo_in and bounce_inout.
  • deque with shrinking a zero sized list caused infinite loop.
  • Printing an enummap yielded the wrong character count.
  • Incorrect contract in FixedList allowed insert out of range.
  • Fix double-free in InterfaceList.
  • Object.set_at was incorrect.
  • Bitstruct with backing char[n] would occasionally be incorrectly stored.
  • fmuladd lowering crashes on a + -(b * c) with fastmath.
  • Constant folding -30 % -7 would incorrectly yield "2".
  • Parsing << in asm would not be correctly handled.
  • Incorrect lowering for float[<3>] when placed aligned in a struct.

Version 0.8.0

12 May 13:59

Choose a tag to compare

Version 0.8.0 Pre-release
Pre-release

Changes / improvements

  • Removed "old-enums, old-slice-copy and old-compact-eq" feature flags.
  • Removed deprecated $evaltype.
  • Removed all deprecated (as of 0.7.11) types and functions from the stdlib.
  • Removed deprecated iXX and uXX suffixes.
  • Removed deprecated Enum.lookup.
  • Removed deprecated ? as suffix operator in the expression io::EOF?.
  • Removed deprecated module foo {Type} generic syntax.
  • Distinct types now defaults to be "structlike"
  • Removed @structlike attribute.
  • Removed deprecated @extern attribute.
  • : in contracts before description is now mandatory.
  • Removed deprecated Enum.associated (use Enum.membersof).
  • Removed deprecated Enum.elements (use Enum.len).
  • Removed deprecated foo_function.params (use foo_function.paramsof).
  • Removed deprecated $is_const.
  • Removed deprecated $assignable.
  • Enums now no longer directly support + and - – use ordinals instead.
  • For enums, using ++ and -- will step through enums with implicit wrap-around.
  • Rename isz -> sz.
  • Make $sizeof, $alignof and all similar functions return sz instead of usz.
  • Align literal types with C semantics.
  • Use value promotion instead of signedness promotion to int. So that small unsigned types promote to int, not uint.
  • Add a @mustinit attribute to enforce zero-initialization of a type. #3094
  • Improve error message when keyword is used instead of an expression. #3088
  • Add --warn-recursivecontracts.
  • Mutex.destroy and friends no longer return optionals.
  • Remove @operator(!=) overload.
  • Add @operator(<) overload, enabling type comparison overloads.
  • Generic inference can now look through pointer.
  • Enums now implicitly convert to their ordinal when used as indices.
  • Enums can no longer declare themselves inline.
  • Nested generics allowed inside generic functions/methods.
  • a = ... parameters may be shadowed if not defined.
  • $eval can now be used with named parameters, e.g. foo($eval("arg"): 2) #3090
  • Type properties are now accessed using :: and the "of" suffix, removed: int.sizeof -> int::size
  • Added $reflect with properties name, cname, qname, offset, alignment, size.
  • Added @kindof, @alignof and @sizeof macros.
  • Removed $nameof, $extnameof, $qnameof, $offsetof, $alignof, $kindof, $sizeof.
  • .nameof is changed to .description on fault and enum types.
  • Type property is_eq is renamed has_equals.
  • Type function tagof is renamed get_tag.
  • Add untypedlist as a usable type #2647.
  • ?? and ?: has new precedence and binds tighter than + and -
  • Added the tags property for types and $reflect.
  • Allow taking the type of an interface method.
  • Add $expand compile time function to convert strings to code.
  • Constdef now infers through unary negations.
  • Only used libraries are scanned for dependencies. #3144
  • $vaconst, $vaexpr and $vatype removed.
  • Improve error message on unsupported typeid runtime access at runtime. #3170
  • Added support for Emscripten.
  • Replace $vacount by $vaarg.len, replace $vasplat by ...$vaarg.
  • $vaarg behaves as $vaexpr.
  • Added docgen command to generate documentation.
  • Added jmpabs x86 CPU feature.
  • Implicit unsigned <-> signed integer conversions removed.
  • Added C3 Compiler setup installer for Windows
  • alias Foo = int::typeid now works.
  • $typeof => $Typeof, $typefrom => $Typefrom.

Stdlib changes

  • Add List.remove_unordered_at.
  • PanicFn now takes an int for row.
  • Add std::collections::Deque.
  • Add compare_to and compare_to_ignore_case to String. #3096
  • Add SortedMap based on skip lists.
  • Add OneShotChannel to std::thread::channel for single-send/single-receive thread synchronization.
  • BufferedChannel and UnbufferedChannel are now pointers, create using create_unbuffered and create_buffered
  • RingBuffer now conforms to foreach and adds additional functions.
  • Ini parser and encoder.
  • Updated ref::new argument order.
  • Support setting thread stack size.
  • Support setting thread priority.
  • Support syscall on RISCV.
  • Make DString.append_repeat polymorphic adding append_string_repeat and append_char_repeat.
  • Add DString.append_inline for optimized uses.
  • Ordering of object::new_* arguments are now "allocator first".
  • Add remove_unordered_at to FixedList.
  • Changed json to support two flavors of JSON: JSON and JSONC.
  • Changed json API: parse -> load, parse_string -> parse.
  • conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.
  • Mergesort added.
  • set_cursor is renamed seek, and the old seek is removed.
  • std::math name changes: PI_2 => HALF_PI, PI_4 => QUARTER_PI, DIV_PI => INV_PI etc, cosec => csc, cotan => cot, muladd => mad
  • std::time name changes: diff_hour => diff_hours. DateTime.set_date => DateTime.set, datetime::from_date_* => datetime::at_*
  • std::hash method name convention changes: updatec / update_char => update_byte.
  • std::string name changes: strip => strip_prefix, strip_end => strip_suffix.
  • std::collections::object added Object.to_value to convert from an object to a value.
  • std::encoding::xml added for XML parsing and serialization.
  • Fix Path.append separator not honoring the specified environment.
  • Add multi part and extension support to Path.append.
  • The Path API now is split into PathPosix and PathWin, Path is implicitly castable to String and loses the str_view() method. Use path::tnew instead of path::temp for a temporary path.

Fixes

  • Slice comparison lowering would not work correctly in macros in some cases. #3095
  • Attributes @allow_deprecated, @constinit, @noalias, @nostrip, and @optional would erroneously accept parameters. #3098
  • Fix pipe handle leaks across concurrent process spawns #10067.
  • $$trap was incorrectly marked noreturn.
  • Recursive inclusion of contracts was not detected.
  • \r was not filtered when piping a source file from stdin.
  • SHA-3 and Keccak contexts are now explicitly @mustinit structures. #3110
  • UnbufferedChannel would deadlock on multiple producers.
  • Don't override sigaltstack when running with --sanitize=address. #3115
  • Binary search broken for some supported functions.
  • Fix bug casting (void*[<3>])x.
  • Compiler crash compiling a switch with a constant case range overlapping a constant case value. #3127
  • Incorrect handling of overaligned struct fields #3136
  • EnumSet with more than 128 entries was broken.
  • Handle underflow in zip.
  • Bugs in check for name suggestions on name mismatch.
  • Fix bug where only one ensure would not be inlined correctly. #3162
  • Incorrect error message when casting to non-existent enum.
  • Macro $Type = ... would not work correctly with $defined
  • Fix enum value handling in Object (std::collections::object) to conform with changes in enums.
  • Compiler assert in certain cases with ?? and void returns. #3168
  • Bug in compiler-rt for i128 shift.
  • LinkedBlockingQueue.push_timeout did not work correctly.
  • Splat into vaarg macro, where vaarg is not used #2782.
  • Comparison with floats had incorrect codegen, leading to incorrect results for NaN #3175.
  • Zeroing out simd vectors in a struct could in some cases lead to incorrect lowering #3179.
  • Incorrect lowering when returning a struct to an optional value on Win64 in some cases #3180.
  • Fix bug where a method is considered doubly generic if declared in a generic module for a generic type. #3176
  • Fix exp10 on platforms without exp10 as an LLVM builtin.
  • LLVM 23 compatibility: map Os/Oz to O2 pass pipeline, fix returnaddress intrinsic signature, add optsize/minsize function attributes.
  • Warning for ignored visibility modifiers was not emitted for macro methods #3071
  • while (String? x = foo()!) was accidentally allowed causing a lowering error.
  • Crash casting uint to bitstruct inside struct field assignment #3187
  • Vec2/Vec3 transform missed matrix translation.
  • Matrix rotation ignored matrix itself.
  • Fix BigInt shr, to_format, and others.
  • Fix ends in TDist.quantile, FDist.pdf, ChiSquaredDist.pdf
  • Fix to easing expo_in and bounce_inout.
  • deque with shrinking a zero sized list caused infinite loop.
  • Printing an enummap yielded the wrong character count.
  • Incorrect contract in FixedList allowed insert out of range.
  • Fix double-free in InterfaceList.
  • Object.set_at was incorrect.
  • Bitstruct with backing char[n] would occasionally be incorrectly stored.
  • fmuladd lowering crashes on a + -(b * c) with fastmath.
  • Constant folding -30 % -7 would incorrectly yield "2".
  • Parsing << in asm would not be correctly handled.

Version 0.7.11

31 Mar 11:56

Choose a tag to compare

Changes / improvements

  • Removed support for LLVM 17, 18.
  • Detect large temporaries when creating slices on the stack #2665
  • Search for the linker in PATH; use the builtin linker if CC missing. #2906
  • constdef inference through binary expressions: Foo f = Foo.AUDIO | Foo.VIDEO can be written Foo f = AUDIO | VIDEO;
  • Fix for LLVM 22+ compatibility #2987
  • @weaklink for just affecting linkage.
  • Add a fully static build of c3c for Linux. #2949
  • @weak now allows direct overriding of @weak definitions with a real definition.
  • Unified SDK fetching under c3c fetch-sdk <target> (windows, android) and added support for automatic Android NDK (r29) download. Better progress bar. #3019
  • Improved Linux backtrace readability by stripping internal panic and runtime startup frames. #3008
  • Added repetition compression for deep recursive stacks in backtraces. #3008
  • Added new builtins: $$acos, $$asin, $$atan, $$cosh, $$exp10, $$sinh, $$tan and $$tanh.
  • Added the rest of the xoshiro and xoroshiro PRNG variants. #3027
  • Improve error when using keyword as identifier #3066
  • Warn when using $$builtin functions outside of the stdlib #3065
  • Zero element enums now disallowed.

Stdlib changes

  • Add contract on any_to_enum_ordinal and any_to_int to improve error when passed an empty any. #2977
  • Add hash method for ZStrings. #2982
  • Added json serialization from structs.
  • Add keccak and Keccak-based hash functions: sha3, shake, cshake, kmac, turboshake, tuplehash, and parallelhash. #2728
  • Added fault.short_name and fault.@short_name to get just the fault name for both run and compile time. #3002
  • Compiler runtime functions extracted outside of std.
  • Add the GZIP file format (RFC 1952).
  • Add file::last_modified.
  • Make DateTime and DateTimeTz Printable.
  • Add to_format functionality for DateTime.
  • SubProcess/process::create/process::execute_stdout_to_buffer deprecated, replaced by Process/process:spawn/process::run_capture_stdout.
  • Add support for AES-encrypted Zip files (AE-1 and AE-2 formats).
  • Add Argon2 memory-hard hashing with associated tests. #2773
  • Matrix type is now column major.
  • Fix matrix perspective and ortho, project and unproject to be RH [0,1]
  • Add vec3 methods: rejection, project, implement unproject.
  • Add vector function cubic_hermite
  • Deprecated sq_magnitude, barycenter, towards, ortho_normalize, clamp_mag, use length_sq, barycentric, move_towards, orthonormalize, clamp_length instead.
  • Add Quaternion conversion functions to from Euler angles and axis+angle.
  • math::deg_to_rad and math::rad_to_deg respects the underlying type, returning float on a float argument.
  • Added float.to_radians and float.to_degrees and the same for double.
  • Added Quat, Mat2, Mat3 and Mat4, Vec2, Vec3, Vec4 aliases.
  • Added is_normalized to Quaternion and floating point vectors.
  • Added quaternion::from_rotation and quaternion::from_normalized_rotation
  • Added Rect type.
  • Added matrix::frustum.
  • Added math::@abs for compile time abs.
  • Make Errno a constdef containing all definitions. Deprecated libc::errno constants.
  • random::seeder no longer uses temp memory.
  • Add simple member-wise struct comparison with member_eq. #2801
  • std::core::mem::allocator deprecated and split into std::core::mem::allocators containing allocators and std::core::mem::alloc for various allocation methods.
  • Add always_assert builtin macro.
  • Add an entropy module to generate cryptographically-secure random bytes. #3022
  • Add a builtin TIMEOUT fault definition. #3022
  • Base32, Base64, Hex and Codepage encoding deprecates encode_buffer and decode_buffer. Those are replaced by encode_into and decode_into with dst being the first argument. #3055
  • hex::encode_bytes and hex::decode_bytes are deprecated in favour of hex::encode_bytes_into and hex::decode_bytes_into which has dst the first argument. #3055
  • Deprecation of @unaligned_load and @unaligned_store. Use mem::load and mem::store instead.

Version 0.7.10

26 Feb 02:47

Choose a tag to compare

0.7.10 Change list

Changes / improvements

  • C3 is now using its own LLVM libraries when building releases.
  • Method resolution and $defined now works together well unless definitions are out of order for real.
  • Improve error message when using functions as values #2856
  • Improve support for Android with Termux.
  • Integrated download of the MSVC SDK when compiling for Windows.
  • For c3c init with library templates, provide example exported functions. #2898
  • unsigned % signed and unsigned / signed is no longer allowed without explicit casts, except for const denominators. #2928
  • New enum associated value syntax.
  • Individual warning settings added.
  • Change typedef and const enums to not convert from literals by default.
  • Add @constinit to allow old typedef behaviour.
  • Include actual element count in the error message when the array initializer size does not match the expected size.
  • Add --print-large-functions for checking which functions likely dominate the compile time.
  • Improve error message when providing alias with a typeid expression where a type was expected. #2944
  • Const enums removed.
  • Constdef declarations introduced.
  • Properly support @deprecated as contract.
  • Support deprecating enum values.
  • Improve error when trying to use an extern const as a compile time constant. #2969
  • vendor-fetch command now lists all available packages by default. #2976
  • Typekind enums are changed CONST_ENUM -> CONSTDEF, DISTINCT -> TYPEDEF.

Stdlib changes

  • Summarize sort macros as generic function wrappers to reduce the amount of generated code. #2831
  • Remove dependency on temp allocator in String.join.
  • Remove dependency on temp allocator in File.open.
  • Added PEM encoding/decoding. #2858
  • Add Murmur3 hash.
  • Add optional line-length limitations to io::readline and io::readline_to_stream. #2879
  • Add Xorshiro128++.
  • Add single-byte code page support (DOS/OEM, Windows/ANSI, and ISO/IEC 8859).
  • Add array::even, array::odd, and array::unlace macros. #2892
  • Add discrete and continuous distributions in std::math::distributions.
  • Add bitorder functions store_le, load_le, store_be, store_le.
  • Stream functions now use long/ulong rather than isz/usz for seek/available.
  • instream.seek is replaced by set_cursor and cursor.
  • instream.available, cursor etc are long/ulong rather than isz/usz to be correct on 32-bit.
  • Enable asynchronous, non-blocking reads of subprocess STDOUT/STDERR pipes on POSIX systems.

Fixes

  • Add error message if directory with output file name already exists
  • Regression where nested lambdas would be evaluated twice.
  • Compiler crash when using arrays of vectors in lists. #2889
  • Fix list[0].i = 5 when list[0] returns a pointer. #2888
  • Shadowing not detected for generic declarations #2876
  • Const inline enums would not always implicitly get converted to the underlying type.
  • Update to dstring.append_string to take any type converting to String.
  • Flag --cpu-flags doesn't work if the first item is an exclusion. #2905
  • Reallocating overaligned memory with the LibcAllocator was unsafe.
  • Using [] or .foo on $$ functions would not raise error but instead crash
  • Improved underlining errors/warnings when unicode is used. #2887
  • Fix std::io::Formatter integer issue for large uint128 decimal values.
  • --safe=no disabled compile-time errors on compile-time known runtime @require checks #2936
  • On assert known false, the message was not shown for no-args.
  • Adding the incorrect sized vector to a pointer vector would cause a crash.
  • Member access on a struct returned by the assignment expression, cause crash #2947
  • Trying to slice an indexable type leads to misleading error message #2958
  • Warn on use of visibility modifiers on methods. #2962
  • Compiler crash using ?? with a void? macro #2973
  • Fix issue when extending a generic type with a method in another module.

Version 0.7.9

30 Jan 15:06

Choose a tag to compare

0.7.9 Change list

Changes / improvements

  • Add --custom-libc option for custom libc implementations.
  • Support for NetBSD.
  • Testing for the presence of methods at the top level is prohibited previous to method registration.
  • $$mask_to_int and $$int_to_mask to create bool masks from integers and back.
  • Better error messages when slicing a pointer to a slice or vector. #2681
  • Generics using ad-hoc <...> rather than module based.
  • Reduced memory usage for backtraces on Linux.
  • On win32 utf-8 console output is now enabled by default in compiled programs
  • Add $$VERSION and $$PRERELEASE compile time constants.
  • Require () around assignment in conditionals. #2716
  • $$unaligned_load and $$unaligned_store now also takes a "is_volatile" parameter.
  • Module-based generics using {} is deprecated.
  • Create optional with ~ instead of ?. return io::EOF?; becomes return io::EOF~.
  • Deprecated use of ? to create optional.
  • Make foo.$abc implicitly mean foo.eval("$abc").
  • Deprecating multi-level array length inference. int[*][*] is deprecated and will be removed 0.8.0.
  • Combining argument-less initialization with argument init for bitstructs is now allowed e.g. { .b, .c = 123 }.

Fixes

  • Remove use of LLVMGetGlobalContext for single module compilation.
  • Fixed bug where constants would get modified when slicing them. #2660
  • Regression with npot vector in struct triggering an assert #2219.
  • Casting bitstruct to wider base type should be single step #2616.
  • Optional does not play well with bit ops #2618.
  • Bytebuffer.grow was broken #2622.
  • Hex escapes like "\x80" would be incorrectly lowered. #2623
  • Ignore const null check on deref in $defined and $sizeof #2633.
  • Subscripting of constant slices would sometimes be considered non-constant #2635.
  • Compiler crash when concatenating structs and arrays to an untyped list.
  • Strings assigned to longer arrays would crash codegen, e.g. char[10] x = "abcd.
  • Typedefs and structs with inline types supporting lengthof would not work with lengthof #2641.
  • $defined(foo()) now correctly errors if foo() would require a path.
  • @if($defined((char*){}.foo())) does not error if foo is missing.
  • Hard limit of 127 characters for identifiers.
  • $$LINE would sometimes yield the incorrect format.
  • Fix error message when a method has the wrong type for the first argument.
  • Unit tests allocating too much tmem without @pool would cause errors in unrelated tests. #2654
  • Incorrect rounding for decimals in formatter in some cases. #2657
  • Incorrectly using LLVMStructType when emitting dynamic functions on MachO #2666
  • FixedThreadPool join did not work correctly.
  • Fix bug when creating bool vectors in certain cases.
  • Compiler assert when passing returning CT failure immediately rethrown #2689.
  • Converting between simd/non-simd bool vector would hit a compiler assert. #2691
  • i<n> suffixes were not caught when n < 8, causing an assert.
  • Parse error in $defined was not handled correctly, leading to an assertion.
  • Assert when struct/array size would exceed 4 GB.
  • Assert when encountering a malformed module alias.
  • Assert when encountering a test function with raw vaarg parameters.
  • foo.x was not always handled correctly when foo was optional.
  • x'1234' +++ (ichar[1]) { 'A' } would fail due to missing const folding.
  • Miscompilation: global struct with vector could generate an incorrect initializer.
  • String.tokenize_all would yield one too many empty tokens at the end.
  • String.replace no longer depends on String.split.
  • Fix the case where \u<unicode char> could crash the compiler on some platforms.
  • Designated initialization with ranges would not error on overflow by 1.
  • io::read_fully now handles unbounded streams properly.
  • Crash when doing a type property lookup for const inline enums in some cases #2717.
  • Incorrect alignment on typedef and local variable debug info.
  • Assert on optional-returning-function in a comma expression. #2722
  • Creating recursive debug info for functions could cause assertions.
  • bitorder::read and bitorder::write may fail because of unaligned access #2734.
  • Fix LinkedList.to_format to properly iterate linked list for printing.
  • Hashing a vector would not use the entire vector in some cases.
  • Fix to temp_directory on Windows #2762.
  • Too little memory reserved when printing backtrace on Darwin #2698.
  • In some cases, a type would not get implicitly converted to a typeid #2764.
  • Assert on defining a const fault enum with enumerator and fault of the same name. #2732
  • Passing a non-conststring to module attributes like @cname would trigger an assert rather than printing an error. #2771
  • Passing different types to arg 1 and 2 for $$matrix_transpose would trigger an assert. #2771
  • Zero init of optional compile time variable would crash the compiler. #2771
  • Using multiple declaration for generics in generic module would fail. #2771
  • Defining an extern const without a type would crash rather than print an error. #2771
  • Typedef followed by brace would trigger an assert. #2771
  • Union with too big member would trigger an assert. #2771
  • Bitstruct with unevaluated user-defined type would cause a crash. #2771
  • Using named parameters with builtins would cause a crash. #2771
  • In some cases, using missing identifiers with builtins would cause a crash. #2771
  • Using $defined with function call missing arguments would cause a crash. #2771
  • Adding @nostrip to a test function would crash. #2771
  • Mixing struct splat, non-named params and named params would crash rather than to print an error. #2771
  • Creating a char vector from bytes would crash. #2771
  • Using $$wstr16 with an illegal argument would crash instead of printing an error. #2771
  • Empty struct after @if processing was not detected, causing a crash instead of an error. #2771
  • Comparing an uint and int[<4>] was incorrectly assumed to be uint compared to int, causing a crash instead of an error. #2771
  • When an int[*][6] was given too few values, the compiler would assert instead of giving an error. #2771
  • Inferring length from a slice was accidentally not an error.
  • Eager evaluation of macro arguments would break inferred arrays on some platforms. #2771.
  • Vectors not converted to arrays when passed as raw vaargs. #2776
  • Second value in switch range not checked properly, causing an error on non-const values. #2777
  • Broken cast from fault to array pointer #2778.
  • $typeof untyped list crashes when trying to create typeid from it. #2779
  • Recursive constant definition not properly detected, leading to assert #2780
  • Failed to reject void compile time variables, leading to crash. #2781
  • Inferring the size of a slice with an inner inferred array using {} isn't detected as error #2783
  • Bug in sysv abi when passing union in with floats #2784
  • When a global const has invalid attributes, handling is incorrect, leading to a crash #2785.
  • int? ? was not correctly handled. #2786
  • Casting const bytes to vector with different element size was broken #2787
  • Unable to access fields of a const inline enum with an aggregate underlying type. #2802
  • Using an optional type as generic parameter was not properly caught #2799
  • Instantiating an alias of a user-defined type was not properly caught #2798
  • Too deeply nested scopes was a fatal crash and not a regular semantic error. #2796
  • Recursive definition of tag not detected with nested tag/tagof #2790
  • Attrdef eval environment lacked rtype, causing error on invalid args #2797
  • $typeof() returns typeinfo, causing errors #2795.
  • Empty ichar slice + byte concatenation hit an assert. #2789
  • Remove dependency on test tmp library for stdlib compiler tests. #2800
  • Comparing a flexible array member to another type would hit an assert. #2830
  • Underlying slice type not checked correctly in $defined #2829
  • Checking for exhaustive cases is done even in if-chain switch if all is enum #2828
  • Constant shifting incorrectly doesn't flatten the underlying vector base #2825
  • String not set as attributes resolved breaking has_tagof #2824
  • Self referencing forward resolved const enum fails to be properly detected #2823
  • Incorrectly try compile time int check on vector #2815
  • Generating typeid from function gives incorrect typeid #2816
  • Recursive definitions not discovered when initializer is access on other const #2817
  • Slice overrun detected late hit codegen assert #2822
  • Compile time dereference of a constant slice was too generous #2821
  • Constant deref of subscript had inserted checks #2818
  • Raw vaargs with optional return not lowered correctly #2819
  • Early exit in macro call crashes codegen #2820
  • Empty enums would return the values as zero sized arrays #2838
  • Store of zero in lowering did not properly handle optionals in some cases #2837
  • Bitstruct accidentally allowed other arrays than char arrays #2836
  • Bitstruct as substruct fails to properly work with designated initializers. #2827
  • Bug when initializing an inferred array with deep structure using designated init #2826
  • Packed .c3l files without compressions weren't unpacked correctly.
  • Lowering of optional in && was incorrect #2843
  • Resolving &X.b when X is a const incorrectly checked for runtime constness #2842
  • Alignment param on $$unaligned_* not checked for zero #2844
  • Fix alignment for uint128 to 16 with WASM targets.
  • Incorrect assert in struct alignment checking #2841
  • Packed structs sometimes not lowered as such.
  • Crash when creating $Type* where $Type is an optional type #2848
  • Crashes when using io::EOF~! in various unhandled places. #2848
  • Crash when trying to create a const zero untyped list #2847
  • Incorrect handling when reporting fn with optional compile time type #2862
  • Optional in initializer cause a crash #28...
Read more

Version 0.7.8

06 Dec 15:32

Choose a tag to compare

0.7.8 Change list

Changes / improvements

  • Improve multiline string parser inside compiler #2552.
  • Missing imports allowed if module @if evaluates to false #2251.
  • Add default exception handler to Win32 #2557.
  • Accept "$schema" as key in project.json #2554.
  • Function referencing in @return? for simplified fault declarations. Check @return? eagerly #2340.
  • Enums now work with membersof to return the associated values. #2571
  • Deprecated SomeEnum.associated in favour of SomeEnum.membersof
  • Refactored @simd implementation.
  • Improve error message for Foo{} when Foo is not a generic type #2574.
  • Support @param directives for ... parameters. #2578
  • Allow splatting of structs. #2555
  • Deprecate --test-nocapture in favour of --test-show-output #2588.
  • Xtensa target no longer enabled by default on LLVM 22, Compile with -DXTENSA_ENABLE to enable it instead
  • Add float[<3>] x = { .xy = 1.2, .z = 3.3 } swizzle initialization for vectors. #2599
  • Support int $foo... arguments. #2601
  • Add musl support with --linux-libc=musl.

Fixes

  • Foo.is_eq would return false if the type was a typedef and had an overload, but the underlying type was not comparable.
  • Remove division-by-zero checks for floating point in safe mode #2556.
  • Fix division-by-zero checks on a /= 0 and b /= 0f #2558.
  • Fix fmod a %= 0f.
  • Regression vector ABI: initializing a struct containing a NPOT vector with a constant value would crash LLVM. #2559
  • Error message with hashmap shows "mangled" name instead of original #2562.
  • Passing a compile time type implicitly converted to a typeid would crash instead of producing an error. #2568
  • Compiler assert with const enum based on vector #2566
  • Fix to Path handling c:\foo and \home parent. #2569
  • Fix appending to c:\ or \ #2569.
  • When encountering a foreach over a ZString* it would not properly emit a compilation error, but hit an assert #2573.
  • Casting a distinct type based on a pointer to an any would accidentally be permitted. #2575
  • overflow_* vector ops now correctly return a bool vector.
  • Regression vector ABI: npot vectors would load incorrectly from pointers and other things. #2576
  • Using defer catch with a (void), would cause an assertion. #2580
  • Fix decl attribute in the wrong place causing an assertion. #2581
  • Passing a single value to @wasm would ignore the renaming.
  • *(int*)1 incorrectly yielded an assert in LLVM IR lowering #2584.
  • Fix issue when tests encounter a segmentation fault or similar.
  • With project.json, when overriding with an empty list the base settings would still be used. #2583
  • Add sigsegv stacktrace in test and regular errors for Darwin Arm64. #1105
  • Incorrect error message when using generic type that isn't imported #2589
  • String.to_integer does not correctly return in some cases where it should #2590.
  • Resolving a missing property on a const enum with inline, reached an assert #2597.
  • Unexpected maybe-deref subscript error with out parameter #2600.
  • Bug on rethrow in return with defer #2603.
  • Fix bug when converting from vector to distinct type of wider vector. #2604
  • $defined(hashmap.init(mem)) causes compiler segfault #2611.
  • Reference macro parameters syntax does not error in certain cases. #2612
  • @param name parsing too lenient #2614.

Stdlib changes

  • Add CGFloat CGPoint CGSize CGRect types to core_foundation (macOS).
  • Add NSStatusItem const enum to ns module (macOS).
  • Add NSWindowCollectionBehavior NSWindowLevel NSWindowTabbingMode to ns module (macOS).
  • Add ns::eventmask_from_type function to objc (macOS).
  • Deprecate objc enums in favour of const inline enums backed by NS numerical types, and with the NS prefix, to better align with the objc api (macOS).
  • Deprecate event_type_from function in favour of using NSEvent directly, to better align with the objc api (macOS).
  • Add unit tests for objc and core_foundation (macOS).
  • Make printing typeids give some helpful typeid data.
  • Add NSApplicationTerminateReply to ns module (macOS).
  • Add registerClassPair function to objc module (macOS).
  • Somewhat faster BigInt output.
  • Cache printf output.