Releases: c3lang/c3c
Releases Β· c3lang/c3c
Version 0.8.1
Changes / improvements
- Add
$$PROJECT_PATH, accessible throughenv::PROJECT_PATH. - Deprecate
$field.get(a)and$field.set(a, b). Replaced bya.$fieldanda.$field = b. - Add
a.$eval($field)as a variant ofa.$field. - Add json pretty print.
$$atomic_storeand$$atomic_loadtakes 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_tagoftoget_tagandhas_tag - Don't resume parsing when implicit module names yield invalid names.
Stdlib changes
- Add math::TAU / math::TWO_PI
- Add
values::expandto turn strings containing expressions into values. - Enhanced
path::lsfunctionality, like searching for wildcard. LinkedHashMaprenamedOrderedMap,LinkedHashSetrenamedOrderedSet. 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::parseand related takes anerror_lineargument 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. spawnnow allows binding I/O and using different settings per pipe.@loop_over_aiwould 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.loadandFile.save. io::write_allnow retries on incomplete writes.GrowableBitSet.max_bit_setadded.- Added
UnboundedChannel. BufferedChannelandUnbufferedChannelgets non-blocking push/pop.FixedThreadPoolandThreadPooldeprecated.
Fixes
@volatile_storeon arrays were sometimes incorrectly lowered.- NPOT vectors as associated variables were incorrectly lowered on load. #3228
.get_tagand.has_tagdid 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
.tagswould crash if no attribute with arguments were present.Rect.merge_pointwould 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
UIntLEandUIntBE. - 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.sliceincorrectly handled slices with x/y offset and 0/negative length together.String.to_integerincorrectly accepted some invalid characters for hex.- Removed broken
StringIterator.get. - Fix to refcount behaviour, preventing issue on release.
File.closeshould always invalidate the pointer on close, even on failures.- Overlong conversions to unicode for
%cat 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_namewould 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, oralignmentof anuntypedlist. untypedlistincorrectly hadsizeproperty.- JSON handling of UTF16 surrogate pairs fixed.
base32,base64andcodepagewould leak memory on encode/decode errors.- Indexing into a type with a
$reflectvalue would sometimes cause a crash. - Using a faultdef hidden behind
@ifwould 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_exchangehad an incorrect implementation.channel::create_unbufferedwould not correctly zero out memory, potentially yielding unpredictable result.lock_timeouton Posix would sleep the entire sleep before retrying, and it would fail if it managed to sleep.stack_sizesetting for threads was ignored on Posix.- Setting thread priority on Win32 was off by one.
- Non-power-of-two-sized member of
@bigendianbitstruct backed by char array wasn't working #3283. - Binary bitwise operations were not considered simple.
$expandwas 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_streamwould not return the correct length whenavailablewas not supported by the stream.@str_camelcasewould yield same result as@str_pascalcase. #3287conv::utf8to32would not zero terminate in when the zero would be at the end of the buffer.char16_to_utf8_unsafewould 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.escapeused the incorrect default for stripping quotes.- mem::equals would not correctly compare slices of with element size > 1.
AsciiCharset.containsincorrectly 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
__powisf2to compiler_rt. //would count newlines twice when parsing JSONC.Path::for_posix(".a/..")was not parsed correctly.SortedMap.clearandSortedMap.freewould work incorrectly on map initialized with ONHEAP.GrowableBitSetwould yield the wrong length.GrowableBitSetwould not work correctly on backing types bigger than uint.DString.replacewould not work correctly in some cases.ByteWriter.ensure_capacitydid realloc unnecessarily when the data exactly matched capacity.DString.equalsusedintrather thanszfor len comparison.DString.replace_charwould crash on empty DString.io::read_varintandio::write_varint: handling for signed integers were broken.io::write_tiny_bytearrayandio::write_short_bytearraycould 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.lenwas 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_yearswould not handle leap years properly.Deque.freewould not reset the capacity, making it break if later reused.Formatterwould 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
latest-prerelease-tag - `FixedThreadPool` and `ThreadPool` deprecated. Bump version.
Version 0.8.0_3
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
iXXanduXXsuffixes. - Removed deprecated
Enum.lookup. - Removed deprecated
?as suffix operator in the expressionio::EOF?. - Removed deprecated
module foo {Type}generic syntax. - Distinct types now defaults to be "structlike"
- Removed
@structlikeattribute. - Removed deprecated
@externattribute. :in contracts before description is now mandatory.- Removed deprecated
Enum.associated(useEnum::members). - Removed deprecated
Enum.elements(useEnum::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
szinstead ofusz. - 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
@mustinitattribute 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.$evalcan 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
$reflectwith propertiesname,cname,qname,offset,alignment,size. - Added
@kindof,@alignofand@sizeofmacros. - Removed
$nameof,$extnameof,$qnameof,$offsetof,$alignof,$kindof,$sizeof. .nameofis changed to.descriptiononfaultand enum types.- Type property
is_eqis renamedhas_equals. - Type function
tagofis renamedget_tag. - Add
untypedlistas a usable type #2647. ??and?:has new precedence and binds tighter than+and-- Added the
tagsproperty for types and$reflect. - Allow taking the type of an interface method.
- Add
$expandcompile time function to convert strings to code. - Constdef now infers through unary negations.
- Only used libraries are scanned for dependencies. #3144
$vaconst,$vaexprand$vatyperemoved.- Improve error message on unsupported typeid runtime access at runtime. #3170
- Added support for Emscripten.
- Replace
$vacountby$vaarg.len, replace$vasplatby...$vaarg. $vaargbehaves as$vaexpr.- Added
docgencommand to generate documentation. - Added
jmpabsx86 CPU feature. - Implicit unsigned <-> signed integer conversions removed.
- Added C3 Compiler setup installer for Windows
alias Foo = int::typeidnow works.$typeof=>$Typeof,$typefrom=>$Typefrom.
Stdlib changes
- Add
List.remove_unordered_at. - PanicFn now takes an
intfor row. - Add
std::collections::Deque. - Add
compare_toandcompare_to_ignore_casetoString. #3096 - Add
SortedMapbased on skip lists. - Add
OneShotChanneltostd::thread::channelfor single-send/single-receive thread synchronization. BufferedChannelandUnbufferedChannelare now pointers, create usingcreate_unbufferedandcreate_bufferedRingBuffernow conforms toforeachand adds additional functions.- Ini parser and encoder.
- Updated
ref::newargument order. - Support setting thread stack size.
- Support setting thread priority.
- Support syscall on RISCV.
- Make
DString.append_repeatpolymorphic addingappend_string_repeatandappend_char_repeat. - Add
DString.append_inlinefor optimized uses. - Ordering of
object::new_*arguments are now "allocator first". - Add
remove_unordered_atto FixedList. - Changed
jsonto support two flavors of JSON: JSON and JSONC. - Changed
jsonAPI:parse->load,parse_string->parse. conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.- Mergesort added.
set_cursoris renamedseek, and the oldseekis removed.std::mathname changes:HALF_PI=>PI_2,PI_4=>QUARTER_PI,DIV_PI=>INV_PIetc,cosec=>csc,cotan=>cot,muladd=>madstd::timename changes:diff_hour=>diff_hours.DateTime.set_date=>DateTime.set,datetime::from_date_*=>datetime::at_*std::hashmethod name convention changes:updatec/update_char=>update_byte.std::stringname changes:strip=>strip_prefix,strip_end=>strip_suffix.std::collections::objectaddedObject.to_valueto convert from an object to a value.std::encoding::xmladded for XML parsing and serialization.- Fix
Path.appendseparator not honoring the specified environment. - Add multi part and extension support to
Path.append. - The
PathAPI now is split intoPathPosixandPathWin,Pathis implicitly castable toStringand loses thestr_view()method. Usepath::tnewinstead ofpath::tempfor a temporary path.
Fixes
- Slice comparison lowering would not work correctly in macros in some cases. #3095
- Attributes
@allow_deprecated,@constinit,@noalias,@nostrip, and@optionalwould erroneously accept parameters. #3098 - Fix pipe handle leaks across concurrent process spawns #10067.
$$trapwas incorrectly marked noreturn.- Recursive inclusion of contracts was not detected.
\rwas not filtered when piping a source file from stdin.- SHA-3 and Keccak contexts are now explicitly
@mustinitstructures. #3110 UnbufferedChannelwould deadlock on multiple producers.- Don't override
sigaltstackwhen 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/OztoO2pass pipeline, fixreturnaddressintrinsic signature, addoptsize/minsizefunction 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.
dequewith shrinking a zero sized list caused infinite loop.- Printing an enummap yielded the wrong character count.
- Incorrect contract in
FixedListallowed 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 % -7would 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
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
iXXanduXXsuffixes. - Removed deprecated
Enum.lookup. - Removed deprecated
?as suffix operator in the expressionio::EOF?. - Removed deprecated
module foo {Type}generic syntax. - Distinct types now defaults to be "structlike"
- Removed
@structlikeattribute. - Removed deprecated
@externattribute. :in contracts before description is now mandatory.- Removed deprecated
Enum.associated(useEnum::members). - Removed deprecated
Enum.elements(useEnum::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
szinstead ofusz. - 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
@mustinitattribute 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.$evalcan 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
$reflectwith propertiesname,cname,qname,offset,alignment,size. - Added
@kindof,@alignofand@sizeofmacros. - Removed
$nameof,$extnameof,$qnameof,$offsetof,$alignof,$kindof,$sizeof. .nameofis changed to.descriptiononfaultand enum types.- Type property
is_eqis renamedhas_equals. - Type function
tagofis renamedget_tag. - Add
untypedlistas a usable type #2647. ??and?:has new precedence and binds tighter than+and-- Added the
tagsproperty for types and$reflect. - Allow taking the type of an interface method.
- Add
$expandcompile time function to convert strings to code. - Constdef now infers through unary negations.
- Only used libraries are scanned for dependencies. #3144
$vaconst,$vaexprand$vatyperemoved.- Improve error message on unsupported typeid runtime access at runtime. #3170
- Added support for Emscripten.
- Replace
$vacountby$vaarg.len, replace$vasplatby...$vaarg. $vaargbehaves as$vaexpr.- Added
docgencommand to generate documentation. - Added
jmpabsx86 CPU feature. - Implicit unsigned <-> signed integer conversions removed.
- Added C3 Compiler setup installer for Windows
alias Foo = int::typeidnow works.$typeof=>$Typeof,$typefrom=>$Typefrom.
Stdlib changes
- Add
List.remove_unordered_at. - PanicFn now takes an
intfor row. - Add
std::collections::Deque. - Add
compare_toandcompare_to_ignore_casetoString. #3096 - Add
SortedMapbased on skip lists. - Add
OneShotChanneltostd::thread::channelfor single-send/single-receive thread synchronization. BufferedChannelandUnbufferedChannelare now pointers, create usingcreate_unbufferedandcreate_bufferedRingBuffernow conforms toforeachand adds additional functions.- Ini parser and encoder.
- Updated
ref::newargument order. - Support setting thread stack size.
- Support setting thread priority.
- Support syscall on RISCV.
- Make
DString.append_repeatpolymorphic addingappend_string_repeatandappend_char_repeat. - Add
DString.append_inlinefor optimized uses. - Ordering of
object::new_*arguments are now "allocator first". - Add
remove_unordered_atto FixedList. - Changed
jsonto support two flavors of JSON: JSON and JSONC. - Changed
jsonAPI:parse->load,parse_string->parse. conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.- Mergesort added.
set_cursoris renamedseek, and the oldseekis removed.std::mathname changes:HALF_PI=>PI_2,PI_4=>QUARTER_PI,DIV_PI=>INV_PIetc,cosec=>csc,cotan=>cot,muladd=>madstd::timename changes:diff_hour=>diff_hours.DateTime.set_date=>DateTime.set,datetime::from_date_*=>datetime::at_*std::hashmethod name convention changes:updatec/update_char=>update_byte.std::stringname changes:strip=>strip_prefix,strip_end=>strip_suffix.std::collections::objectaddedObject.to_valueto convert from an object to a value.std::encoding::xmladded for XML parsing and serialization.- Fix
Path.appendseparator not honoring the specified environment. - Add multi part and extension support to
Path.append. - The
PathAPI now is split intoPathPosixandPathWin,Pathis implicitly castable toStringand loses thestr_view()method. Usepath::tnewinstead ofpath::tempfor a temporary path.
Fixes
- Slice comparison lowering would not work correctly in macros in some cases. #3095
- Attributes
@allow_deprecated,@constinit,@noalias,@nostrip, and@optionalwould erroneously accept parameters. #3098 - Fix pipe handle leaks across concurrent process spawns #10067.
$$trapwas incorrectly marked noreturn.- Recursive inclusion of contracts was not detected.
\rwas not filtered when piping a source file from stdin.- SHA-3 and Keccak contexts are now explicitly
@mustinitstructures. #3110 UnbufferedChannelwould deadlock on multiple producers.- Don't override
sigaltstackwhen 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/OztoO2pass pipeline, fixreturnaddressintrinsic signature, addoptsize/minsizefunction 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.
dequewith shrinking a zero sized list caused infinite loop.- Printing an enummap yielded the wrong character count.
- Incorrect contract in
FixedListallowed 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 % -7would 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
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
iXXanduXXsuffixes. - Removed deprecated
Enum.lookup. - Removed deprecated
?as suffix operator in the expressionio::EOF?. - Removed deprecated
module foo {Type}generic syntax. - Distinct types now defaults to be "structlike"
- Removed
@structlikeattribute. - Removed deprecated
@externattribute. :in contracts before description is now mandatory.- Removed deprecated
Enum.associated(useEnum::members). - Removed deprecated
Enum.elements(useEnum::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
szinstead ofusz. - 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
@mustinitattribute 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.$evalcan 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
$reflectwith propertiesname,cname,qname,offset,alignment,size. - Added
@kindof,@alignofand@sizeofmacros. - Removed
$nameof,$extnameof,$qnameof,$offsetof,$alignof,$kindof,$sizeof. .nameofis changed to.descriptiononfaultand enum types.- Type property
is_eqis renamedhas_equals. - Type function
tagofis renamedget_tag. - Add
untypedlistas a usable type #2647. ??and?:has new precedence and binds tighter than+and-- Added the
tagsproperty for types and$reflect. - Allow taking the type of an interface method.
- Add
$expandcompile time function to convert strings to code. - Constdef now infers through unary negations.
- Only used libraries are scanned for dependencies. #3144
$vaconst,$vaexprand$vatyperemoved.- Improve error message on unsupported typeid runtime access at runtime. #3170
- Added support for Emscripten.
- Replace
$vacountby$vaarg.len, replace$vasplatby...$vaarg. $vaargbehaves as$vaexpr.- Added
docgencommand to generate documentation. - Added
jmpabsx86 CPU feature. - Implicit unsigned <-> signed integer conversions removed.
- Added C3 Compiler setup installer for Windows
alias Foo = int::typeidnow works.$typeof=>$Typeof,$typefrom=>$Typefrom.
Stdlib changes
- Add
List.remove_unordered_at. - PanicFn now takes an
intfor row. - Add
std::collections::Deque. - Add
compare_toandcompare_to_ignore_casetoString. #3096 - Add
SortedMapbased on skip lists. - Add
OneShotChanneltostd::thread::channelfor single-send/single-receive thread synchronization. BufferedChannelandUnbufferedChannelare now pointers, create usingcreate_unbufferedandcreate_bufferedRingBuffernow conforms toforeachand adds additional functions.- Ini parser and encoder.
- Updated
ref::newargument order. - Support setting thread stack size.
- Support setting thread priority.
- Support syscall on RISCV.
- Make
DString.append_repeatpolymorphic addingappend_string_repeatandappend_char_repeat. - Add
DString.append_inlinefor optimized uses. - Ordering of
object::new_*arguments are now "allocator first". - Add
remove_unordered_atto FixedList. - Changed
jsonto support two flavors of JSON: JSON and JSONC. - Changed
jsonAPI:parse->load,parse_string->parse. conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.- Mergesort added.
set_cursoris renamedseek, and the oldseekis removed.std::mathname changes:HALF_PI=>PI_2,PI_4=>QUARTER_PI,DIV_PI=>INV_PIetc,cosec=>csc,cotan=>cot,muladd=>madstd::timename changes:diff_hour=>diff_hours.DateTime.set_date=>DateTime.set,datetime::from_date_*=>datetime::at_*std::hashmethod name convention changes:updatec/update_char=>update_byte.std::stringname changes:strip=>strip_prefix,strip_end=>strip_suffix.std::collections::objectaddedObject.to_valueto convert from an object to a value.std::encoding::xmladded for XML parsing and serialization.- Fix
Path.appendseparator not honoring the specified environment. - Add multi part and extension support to
Path.append. - The
PathAPI now is split intoPathPosixandPathWin,Pathis implicitly castable toStringand loses thestr_view()method. Usepath::tnewinstead ofpath::tempfor a temporary path.
Fixes
- Slice comparison lowering would not work correctly in macros in some cases. #3095
- Attributes
@allow_deprecated,@constinit,@noalias,@nostrip, and@optionalwould erroneously accept parameters. #3098 - Fix pipe handle leaks across concurrent process spawns #10067.
$$trapwas incorrectly marked noreturn.- Recursive inclusion of contracts was not detected.
\rwas not filtered when piping a source file from stdin.- SHA-3 and Keccak contexts are now explicitly
@mustinitstructures. #3110 UnbufferedChannelwould deadlock on multiple producers.- Don't override
sigaltstackwhen 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/OztoO2pass pipeline, fixreturnaddressintrinsic signature, addoptsize/minsizefunction 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.
dequewith shrinking a zero sized list caused infinite loop.- Printing an enummap yielded the wrong character count.
- Incorrect contract in
FixedListallowed 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 % -7would 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
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
iXXanduXXsuffixes. - Removed deprecated
Enum.lookup. - Removed deprecated
?as suffix operator in the expressionio::EOF?. - Removed deprecated
module foo {Type}generic syntax. - Distinct types now defaults to be "structlike"
- Removed
@structlikeattribute. - Removed deprecated
@externattribute. :in contracts before description is now mandatory.- Removed deprecated
Enum.associated(useEnum.membersof). - Removed deprecated
Enum.elements(useEnum.len). - Removed deprecated
foo_function.params(usefoo_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
szinstead ofusz. - 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
@mustinitattribute 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.$evalcan 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
$reflectwith propertiesname,cname,qname,offset,alignment,size. - Added
@kindof,@alignofand@sizeofmacros. - Removed
$nameof,$extnameof,$qnameof,$offsetof,$alignof,$kindof,$sizeof. .nameofis changed to.descriptiononfaultand enum types.- Type property
is_eqis renamedhas_equals. - Type function
tagofis renamedget_tag. - Add
untypedlistas a usable type #2647. ??and?:has new precedence and binds tighter than+and-- Added the
tagsproperty for types and$reflect. - Allow taking the type of an interface method.
- Add
$expandcompile time function to convert strings to code. - Constdef now infers through unary negations.
- Only used libraries are scanned for dependencies. #3144
$vaconst,$vaexprand$vatyperemoved.- Improve error message on unsupported typeid runtime access at runtime. #3170
- Added support for Emscripten.
- Replace
$vacountby$vaarg.len, replace$vasplatby...$vaarg. $vaargbehaves as$vaexpr.- Added
docgencommand to generate documentation. - Added
jmpabsx86 CPU feature. - Implicit unsigned <-> signed integer conversions removed.
- Added C3 Compiler setup installer for Windows
alias Foo = int::typeidnow works.$typeof=>$Typeof,$typefrom=>$Typefrom.
Stdlib changes
- Add
List.remove_unordered_at. - PanicFn now takes an
intfor row. - Add
std::collections::Deque. - Add
compare_toandcompare_to_ignore_casetoString. #3096 - Add
SortedMapbased on skip lists. - Add
OneShotChanneltostd::thread::channelfor single-send/single-receive thread synchronization. BufferedChannelandUnbufferedChannelare now pointers, create usingcreate_unbufferedandcreate_bufferedRingBuffernow conforms toforeachand adds additional functions.- Ini parser and encoder.
- Updated
ref::newargument order. - Support setting thread stack size.
- Support setting thread priority.
- Support syscall on RISCV.
- Make
DString.append_repeatpolymorphic addingappend_string_repeatandappend_char_repeat. - Add
DString.append_inlinefor optimized uses. - Ordering of
object::new_*arguments are now "allocator first". - Add
remove_unordered_atto FixedList. - Changed
jsonto support two flavors of JSON: JSON and JSONC. - Changed
jsonAPI:parse->load,parse_string->parse. conv::detect_bom, convert utf16/utf32 from bytes with byteswap / unaligned data.- Mergesort added.
set_cursoris renamedseek, and the oldseekis removed.std::mathname changes:PI_2=>HALF_PI,PI_4=>QUARTER_PI,DIV_PI=>INV_PIetc,cosec=>csc,cotan=>cot,muladd=>madstd::timename changes:diff_hour=>diff_hours.DateTime.set_date=>DateTime.set,datetime::from_date_*=>datetime::at_*std::hashmethod name convention changes:updatec/update_char=>update_byte.std::stringname changes:strip=>strip_prefix,strip_end=>strip_suffix.std::collections::objectaddedObject.to_valueto convert from an object to a value.std::encoding::xmladded for XML parsing and serialization.- Fix
Path.appendseparator not honoring the specified environment. - Add multi part and extension support to
Path.append. - The
PathAPI now is split intoPathPosixandPathWin,Pathis implicitly castable toStringand loses thestr_view()method. Usepath::tnewinstead ofpath::tempfor a temporary path.
Fixes
- Slice comparison lowering would not work correctly in macros in some cases. #3095
- Attributes
@allow_deprecated,@constinit,@noalias,@nostrip, and@optionalwould erroneously accept parameters. #3098 - Fix pipe handle leaks across concurrent process spawns #10067.
$$trapwas incorrectly marked noreturn.- Recursive inclusion of contracts was not detected.
\rwas not filtered when piping a source file from stdin.- SHA-3 and Keccak contexts are now explicitly
@mustinitstructures. #3110 UnbufferedChannelwould deadlock on multiple producers.- Don't override
sigaltstackwhen 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/OztoO2pass pipeline, fixreturnaddressintrinsic signature, addoptsize/minsizefunction 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.
dequewith shrinking a zero sized list caused infinite loop.- Printing an enummap yielded the wrong character count.
- Incorrect contract in
FixedListallowed 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 % -7would incorrectly yield "2". - Parsing << in asm would not be correctly handled.
Version 0.7.11
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
constdefinference through binary expressions:Foo f = Foo.AUDIO | Foo.VIDEOcan be writtenFoo f = AUDIO | VIDEO;- Fix for LLVM 22+ compatibility #2987
@weaklinkfor just affecting linkage.- Add a fully static build of
c3cfor Linux. #2949 @weaknow allows direct overriding of@weakdefinitions 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,$$tanand$$tanh. - Added the rest of the
xoshiroandxoroshiroPRNG 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_ordinalandany_to_intto improve error when passed an empty any. #2977 - Add hash method for ZStrings. #2982
- Added json serialization from structs.
- Add
keccakand Keccak-based hash functions:sha3,shake,cshake,kmac,turboshake,tuplehash, andparallelhash. #2728 - Added
fault.short_nameandfault.@short_nameto 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_formatfunctionality for DateTime. SubProcess/process::create/process::execute_stdout_to_bufferdeprecated, replaced byProcess/process:spawn/process::run_capture_stdout.- Add support for AES-encrypted Zip files (AE-1 and AE-2 formats).
- Add
Argon2memory-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, implementunproject. - Add vector function
cubic_hermite - Deprecated
sq_magnitude,barycenter,towards,ortho_normalize,clamp_mag, uselength_sq,barycentric,move_towards,orthonormalize,clamp_lengthinstead. - Add Quaternion conversion functions to from Euler angles and axis+angle.
math::deg_to_radandmath::rad_to_degrespects the underlying type, returningfloaton afloatargument.- Added
float.to_radiansandfloat.to_degreesand the same fordouble. - Added
Quat,Mat2,Mat3andMat4,Vec2,Vec3,Vec4aliases. - Added
is_normalizedto Quaternion and floating point vectors. - Added
quaternion::from_rotationandquaternion::from_normalized_rotation - Added
Recttype. - Added
matrix::frustum. - Added
math::@absfor compile timeabs. - Make
Errnoa constdef containing all definitions. Deprecatedlibc::errnoconstants. random::seederno longer uses temp memory.- Add simple member-wise struct comparison with
member_eq. #2801 std::core::mem::allocatordeprecated and split intostd::core::mem::allocatorscontaining allocators andstd::core::mem::allocfor various allocation methods.- Add
always_assertbuiltin macro. - Add an
entropymodule to generate cryptographically-secure random bytes. #3022 - Add a builtin
TIMEOUTfault definition. #3022 - Base32, Base64, Hex and Codepage encoding deprecates
encode_bufferanddecode_buffer. Those are replaced byencode_intoanddecode_intowithdstbeing the first argument. #3055 hex::encode_bytesandhex::decode_bytesare deprecated in favour ofhex::encode_bytes_intoandhex::decode_bytes_intowhich hasdstthe first argument. #3055- Deprecation of
@unaligned_loadand@unaligned_store. Usemem::loadandmem::storeinstead.
Version 0.7.10
0.7.10 Change list
Changes / improvements
- C3 is now using its own LLVM libraries when building releases.
- Method resolution and
$definednow 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 initwith library templates, provide example exported functions. #2898 unsigned % signedandunsigned / signedis 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
@constinitto 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-functionsfor checking which functions likely dominate the compile time. - Improve error message when providing
aliaswith a typeid expression where a type was expected. #2944 - Const enums removed.
- Constdef declarations introduced.
- Properly support
@deprecatedas contract. - Support deprecating enum values.
- Improve error when trying to use an extern const as a compile time constant. #2969
vendor-fetchcommand 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::readlineandio::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, andarray::unlacemacros. #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.seekis replaced byset_cursorandcursor.instream.available,cursoretc 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 = 5whenlist[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-flagsdoesn'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=nodisabled 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 avoid?macro #2973 - Fix issue when extending a generic type with a method in another module.
Version 0.7.9
0.7.9 Change list
Changes / improvements
- Add
--custom-libcoption 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_intand$$int_to_maskto 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
$$VERSIONand$$PRERELEASEcompile 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?;becomesreturn io::EOF~. - Deprecated use of
?to create optional. - Make
foo.$abcimplicitly meanfoo.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.growwas broken #2622.- Hex escapes like
"\x80"would be incorrectly lowered. #2623 - Ignore const null check on deref in
$definedand$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 iffoo()would require a path.@if($defined((char*){}.foo()))does not error iffoois missing.- Hard limit of 127 characters for identifiers.
$$LINEwould sometimes yield the incorrect format.- Fix error message when a method has the wrong type for the first argument.
- Unit tests allocating too much
tmemwithout@poolwould 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
$definedwas 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.xwas not always handled correctly whenfoowas 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_allwould yield one too many empty tokens at the end.String.replaceno longer depends onString.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_fullynow 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_formatto properly iterate linked list for printing. - Hashing a vector would not use the entire vector in some cases.
- Fix to
temp_directoryon 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
$definedwith 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
@ifprocessing 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$Typeis 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...
Version 0.7.8
0.7.8 Change list
Changes / improvements
- Improve multiline string parser inside compiler #2552.
- Missing imports allowed if module
@ifevaluates to false #2251. - Add default exception handler to Win32 #2557.
- Accept
"$schema"as key inproject.json#2554. - Function referencing in
@return?for simplified fault declarations. Check@return?eagerly #2340. - Enums now work with
membersofto return the associated values. #2571 - Deprecated
SomeEnum.associatedin favour ofSomeEnum.membersof - Refactored
@simdimplementation. - Improve error message for
Foo{}whenFoois not a generic type #2574. - Support
@paramdirectives for...parameters. #2578 - Allow splatting of structs. #2555
- Deprecate
--test-nocapturein favour of--test-show-output#2588. - Xtensa target no longer enabled by default on LLVM 22, Compile with
-DXTENSA_ENABLEto 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_eqwould return false if the type was atypedefand 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 /= 0andb /= 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
Pathhandlingc:\fooand\homeparent. #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
anywould 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 catchwith a (void), would cause an assertion. #2580 - Fix decl attribute in the wrong place causing an assertion. #2581
- Passing a single value to
@wasmwould ignore the renaming. *(int*)1incorrectly 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_integerdoes 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
CGFloatCGPointCGSizeCGRecttypes to core_foundation (macOS). - Add
NSStatusItemconst enum to ns module (macOS). - Add
NSWindowCollectionBehaviorNSWindowLevelNSWindowTabbingModeto ns module (macOS). - Add
ns::eventmask_from_typefunction 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_fromfunction 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
NSApplicationTerminateReplyto ns module (macOS). - Add
registerClassPairfunction to objc module (macOS). - Somewhat faster BigInt output.
- Cache printf output.