Releases: c3lang/c3c
Releases Β· c3lang/c3c
latest-prerelease-20251025-2053
latest-prerelease-tag Allow `(Foo)0` bitstruct casts even if type sizes do not match.
Version 0.7.6
0.7.6 Change list
Changes / improvements
- Add lengthof() compile time function #2439
- Allow doc comments on individual struct members, faultdefs and enum values #2427.
$alignof,$offsetofand$nameofcan now be used in$defined.- Infer generic parameters lhs -> rhs:
List{int} x = list::NOHEAP. - Unify generic and regular module namespace.
env::PROJECT_VERSIONnow returns the version in project.json.- Comparing slices and arrays of user-defined types that implement == operator now works #2486.
- Add 'loop-vectorize', 'slp-vectorize', 'unroll-loops' and 'merge-functions' optimization flags #2491.
- Add exec timings to -vv output #2490.
- Support #! as a comment on the first line only.
- Add
+++=operator.
Fixes
- Compiler assert with var x @noinit = 0 #2452
- Confusing error message when type has [] overloaded but not []= #2453
- $defined(x[0] = val) causes an error instead of returning false when a type does not have []= defined #2454
- Returning pointer to index of slice stored in a struct from method taking self incorrectly detected as returning pointer to local variable #2455.
- Inlining location when accessing #foo symbols.
- Improve inlined-at when checking generic code.
- Fix codegen bug in expressions like
foo(x()) ?? io::EOF?causing irregular crashes. - Correctly silence "unsupported architecture" warning with
--quiet#2465 - Overloading &[] should be enough for foreach. #2466
- Any register allowed in X86_64 inline asm address. #2463
- int val = some_int + some_distinct_inline_int errors that int cannot be cast to DistinctInt #2468
- Compiler hang with unaligned load-store pair. #2470
??with void results on both sides cause a compiler crash #2472.- Stack object size limit error on a static object. #2476
- Compiler segfault when modifying variable using an inline assembly block inside defer #2450.
- Compile time switch over type would not correctly compare function pointer types.
- Regression: Compiler segfault when assigning struct literal with too few members #2483
- Fix compile time format check when the formatting string is a constant slice.
- Compiler segfault for invalid e-mails in project.json. #2488
- Taking
.ordinalfrom an enum passed by pointer and then taking the address of this result would return the enum, not int. - Alias and distinct types didn't check the underlying type wasn't compile time or optional.
- Incorrect nameof on nested struct names. #2492
- Issue not correctly aborting compilation on recursive generics.
- Crash during codegen when taking the typeid of an empty enum with associated values.
- Assert when the binary doesn't get created and --run-once is used. #2502
- Prevent
foo.bar = {}whenbaris a flexible array member. #2497 - Fix several issues relating to multi-level inference like
int[*][*]#2505 $for int $a = 1; $a < 2; $a++would not parse.- Fix lambda-in-macro visibility, where lambdas would sometimes not correctly link if used through a macro.
- Dead code analysis with labelled
ifdid not work properly. - Compiler segfault when splatting variable that does not exist in untyped vaarg macro #2509
Stdlib changes
- Added Advanced Encryption Standard (AES) algorithm (ECB, CTR, CBC modes) in
std::crypto::aes. - Added generic
InterfaceListto store a list of values that implement a specific interface - Added
path::home_directory,path::documents_directory,path::videos_directory,path::pictures_directory,path::desktop_directory,path::screenshots_directory,
path::public_share_directory,path::templates_directory,path::saved_games_directory,path::music_directory,path::downloads_directory. - Add
LinkedListarray_view to support[]andforeach/foreach_r. #2438 - Make
LinkedListprintable and add==operator. #2438 - CVaList support on MacOS aarch64, SysV ABI x64.
- Add
io::skipandio::read_leandio::write_lefamily of functions.
Version 0.7.5
Changes / improvements
- Support
alias foo = module std::iomodule aliasing. - Add compile-time
@intlog2macro to math. - Add compile-time
@clzbuiltin. #2367 - Add
bitsizeofmacro builtins. #2376 - Add compile-time
@minand@maxbuiltins. #2378 - Deprecate
@compactuse for comparison. Old behaviour is enabled using--use-old-compact-eq. - Switch available for types implementing
@operator(==). Type.is_eqis now true for types with==overload.- Methods ignore visibility settings.
- Allow inout etc on untyped macro parameters even if they are not pointers.
- Deprecate
add_arrayin favour ofpush_allon lists. - Fix max module name to 31 chars and the entire module path to 63 characters.
- Improve error message for missing
$endif. foo[x][y] = bnow interpreted as(*&foo[x])[y] = bwhich allows overloads to do chained [] accesses.- Error if a stack allocated variable is too big (configurable with
--max-stack-object-size). - Add
@safeinferto allowvarto be used locally. - Types converts to typeid implicitly.
- Allow
$definedtake declarations:$defined(int x = y) - Struct and typedef subtypes inherit dynamic functions.
- Improved directory creation error messages in project and library creation commands.
@assignable_tois deprecated in favour of$define- Add
linklib-dirto c3l-libraries to place their linked libraries in. Defaults tolinked-libs - If the
os-archlinked library doesn't exist, try withosfor c3l libs. - A file with an inferred module may not contain additional other modules.
- Update error message for missing body after if/for/etc #2289.
@is_constis deprecated in favour of directly using$defined.@is_lvalue(#value)is deprecated in favour of directly using$defined.- Added
$kindofcompile time function. - Deprecated
@typekindmacro in favour of$kindof. - Deprecated
@typeismacro in favour of$typeof(#foo) == int. $defined(#hash)will not check the internal expression, just that#hashexists. Use$defined((void)#hash)for the old behaviour.- Added optional macro arguments using
macro foo(int x = ...)which can be checked using$defined(x). - Add compile time ternary
$val ??? <expr> : <expr>.
Fixes
- List.remove_at would incorrectly trigger ASAN.
- With avx512, passing a 512 bit vector in a union would be lowered incorrectly, causing an assert. #2362
- Codegen error in
if (try x = (true ? io::EOF? : 1)), i.e. using if-try with a known Empty. - Codegen error in
if (try x = (false ? io::EOF? : 1)), i.e. using if-try with a CT known value. - Reduce allocated Vmem for the compiler on 32 bit machines.
- Bug causing a compiler error when parsing a broken lambda inside of an expression.
- Fixed: regression in comments for
@deprecatedand@pure. - Detect recursive creation of generics #2366.
- Compiler assertion when defining a function with return type untyped_list #2368.
- Compiler assert when using generic parameters list without any parameters. #2369
- Parsing difference between "0x00." and "0X00." literals #2371
- Fixed bug generating
$c += 1when$cwas derived from a pointer but behind a cast. - Compiler segfault when using bitwise not on number literal cast to bitstruct #2373.
- Formatter did not properly handle "null" for any, and null for empty faults. #2375
- Bitstructs no longer overloadable with bitops. #2374
- types::has_equals fails with assert for bitstructs #2377
- Fix
native_cpusfunctionality for OpenBSD systems. #2387 - Assert triggered when trying to slice a struct.
- Improve codegen for stack allocated large non-zero arrays.
- Implement
a5hashin the compiler for compile-time$$str_hashto matchString.hash(). - Functions being tested for overload are now always checked before test.
- Compile time indexing at compile time in a $typeof was no considered compile time.
- Slicing a constant array with designated initialization would not update the indexes.
- Fix for bug when
@formatencountered*in some cases. - Compiler segfault on global slice initialization with null[:0] #2404.
- Use correct allocator in
replace. - Regression: 1 character module names would create an error.
- Compiler segfault with struct containing list of structs with an inline member #2416
- Occasionally when using macro method extensions on built-in types, the liveness checker would try to process them. #2398
- Miscompilation of do-while when the while starts with a branch #2394.
- Compiler assert when calling unassigned CT functions #2418.
- Fixed crash in header generation when exporting functions with const enums (#2384).
- Fix incorrect panic message when slicing with negative size.
- Incorrect type checking when &[] and [] return optional values.
- Failed to find subscript overloading on optional values.
Socket.get_optiondidn't properly callgetsockopt, andgetsockopthad an invalid signature.- Taking the address of a label would cause a crash. #2430
@tagwas not allowed to repeat.- Lambdas on the top level were not exported by default. #2428
has_tagofon tagged lambdas returns false #2432- Properly add "inlined at" for generic instantiation errors #2382.
- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.
- Grabbing (missing) methods on function pointers would cause crash #2434.
- Fix alignment on jump table.
- Fix correct
?after optional function name when reporting type errors. - Make
logandexpno-strip. @test/@benchmarkon module would attach to interface and regular methods.- Deprecated
@selectin favor of???. - Enum inference, like
Foo x = $eval("A"), now works correctly for$eval. - Fix regression where files were added more than once. #2442
- Disambiguate types when they have the same name and need cast between each other.
- Compiler module-scope pointer to slice with offset, causes assert. #2446
- Compiler hangs on == overload if other is generic #2443
- Fix missing end of line when encountering errors in project creation.
- Const enum methods are not being recognized. #2445
- $defined returns an error when assigning a struct initializer with an incorrect type #2449
Stdlib changes
- Add
==toPair,Tripleand TzDateTime. Add print toPairandTriple. - Add OpenBSD to
env::INET_DEVICESand add required socket constants. - Added
FileMmapto manage memory mapped files. - Add
vm::mmap_fileto memory map a file. - Updated hash functions in default hash methods.
- Added
FixedBlockPoolwhich is a memory pool for fixed size blocks. - Added the experimental
std::core::logfor logging. - Added array
@zipand@zip_intomacros. #2370 - Updated termios bindings to use bitstructs and fixed some constants with incorrect values #2372
- Add Freestanding OS types to runtime
env::booleans. - Added libloaderapi to
std::os::win32. - Added
HashSet.valuesandString.contains_char#2386 - Added
&[]overload to HashMap. - Deprecated
PollSubscribesandPollEventsin favour ofPollSubscribeandPollEventand made them const enums. - Added
AsciiCharsetfor matching ascii characters quickly. - Added
String.trim_charset. - Added array
@reduce,@filter,@any,@all,@sum,@product, and@indices_ofmacros. String.bformathas reduced overhead.- Supplemental
roundevenhas a normal implementation.
Version 0.7.4
Changes / improvements
- Added const enums:
enum Foo : const. Behaves like C enums but may be any type. - Casting to / from an enum is now possible again. No need to use
.ordinaland.from_ordinal. - Inline associated enum values are deprecated, use
--use-old-enumsto re-enable them. $typeofmay return a compile time type.- Improved error messages on missing qualifier on enum value. #2260
- Add
--echo-prefixto edit the prefix with$echostatements. Supports {FILE} and {LINE} - Catch accidental
foo == BAR;wherefoo = BAR;was most likely intended. #2274 - Improve error message when doing a rethrow in a function that doesn't return an optional.
- Add
--list-asmto view all supportedasminstructions. - Formatting option "%h" now supports pointers.
- Improve error on unsigned implicit conversion to signed.
- Update error message for struct initialization #2286
- Add SipHash family of keyed PRFs. #2287
$is_constis deprecated in favour of@is_constbased on$defined.- Multiline contract comments #2113
- Removed the use of temp allocator in backtrace printing.
env::AUTHORSandenv::AUTHOR_EMAILSadded.- Suppress codegen of panic printing with when panic messages are set to "off".
- Implicit linking of libc math when libc math functions are used.
- Allow even smaller memory limits.
- Check unaligned array access.
- Add "@structlike" for typedefs.
- "poison" the current function early when a declaration can't be correctly resolved.
- Add komihash, a5hash, metrohash64, metrohash128, and wyhash2 variants with tests/benchmark. #2293
- '$assignable' is deprecated.
- Deprecate allocator::heap() and allocator::temp()
- Add
thread::fenceproviding a thread fence. - Place output in
outby default for projects. Use temp folder for building at the command line. - Allow absolute paths for
$embed. - Add
@tryand@try_catch. - Assignment evaluation order now right->left, following C++17 and possibly C23.
Fixes
- mkdir/rmdir would not work properly with substring paths on non-windows platforms.
- Hex string formatter check incorrectly rejected slices.
- Correctly reject interface methods
typeandptr. - Comparing a null ZString with a non-null ZString would crash.
- Switch case with const non-int / enum would be treated as ints and crash. #2263
- Missing bounds check on upper bound with const ranges
foo[1:3]. - Check up the hierarchy when considering if an interface cast is valid #2267.
- Fix issue with labelled break inside of a $switch.
- Non-const macros may not return untyped lists.
$forct-state not properly popped.- Inline
r / complexfor complex numbers fixed. - Const slice lengths were not always detected as constant.
- Const slice indexing was not bounds checked.
- Initialize pool correctly in print_backtrace.
--max-memnow works correctly again.- Casting a fault to a pointer would trigger an assert.
- Make
to_floatmore tolerant to spaces. - Fixes to thread local pointer handling.
- Fixes to JSON parsing and Object.
- Array indices are now using int64 internally.
- Bit shift operation fails with inline uint enum despite matching underlying type #2279.
- Fix to codegen when using a bitstruct constant defined using a cast with an operator #2248.
- Function pointers are now compile time constants.
- Splat 8 arguments can sometimes cause incorrect behaviour in the compiler. #2283
- Correctly poison the analysis after a failed $assert or $error. #2284
$foovariables could be assigned non-compile time values.$foo[0] = ...was incorrectly requiring that the assigned values were compile time constants.- "Inlined at" would sometimes show the current location.
- Fixed bug splatting constants into constants.
- Resize bug when resizing memory down in ArenaAllocator, DynamicArenaAllocator, BackedArenaAllocator.
- Error message for missing arg incorrect for methods with zero args #2296.
- Fix stringify of $vaexpr #2301.
- Segfault when failing to cast subexpression to 'isz' in pointer subtraction #2305.
- Fix unexpected display of macro definition when passing a poisoned expression #2305.
@linkson macros would not be added to calling functions.- Fix
Formatter.printreturning incorrect size. - A distinct type based on an array would yield .len == 0
- Overloading addition with a pointer would not work.
- Copying const enums and regular enums incorrect #2313.
- Regression: Chaining an optional together with contracts could in some cases lose the optional.
char[*] b = *(char[*]*)&a;would crash the compiler ifawas a slice. #2320- Implicitly cast const int expressions would sometimes not be detected as compile time const.
- Using @NoReturn in a short body macro would not work properly #2326.
- Bug when reporting error in a macro return would crash the compiler #2326.
- Short body return expression would not have the correct span.
- Fix issue where recursively creating a dir would be incorrectly marked as a failure the first time.
@formatdid not work correctly with macros #2341.- Crash when parsing recursive type declaration #2345.
- Remove unnecessary "ret" in naked functions #2344.
- Lambdas now properly follow its attributes #2346.
- Not setting android-ndk resulted in a "set ndk-path" error.
- Lambda deduplication would be incorrect when generated at the global scope.
- Disallow accessing parameters in a naked function, as well as
return, this fixes #1955. - Assigning string literal to char[<*>] stores pointer rather than characters. #2357
Stdlib changes
- Improve contract for readline. #2280
- Added Whirlpool hash.
- Added Ed25519.
- Added string::bformat.
- Virtual memory library.
- New virtual emory arena allocator.
- Added
WString.len. - Added
@addrmacro. - Add
ConditionVariable.wait_untilandConditionVariable.wait_for - Added readline_to_stream that takes a stream.
- Added
RefandRefCountedexperimental functionality. - Added
Volatilegeneric type. - Added
UnalignedRefgeneric type. - Add String conversion functions snake_case -> PascalCase and vice versa.
Version 0.7.3
Changes since 0.7.2
Changes / improvements
$typefromnow also accepts a constant string, and so works like$evaltype.$evaltypeis deprecated in favour of$typefrom.- Literal rules have changed, this makes
-0xFFnow a signed integer. - Implicitly convert from constant typeid to Type in
$Typeassignment, and$assignable. - Make $Type parameters accept constant typeid values.
- Deprecate
foo.#bar. - Allow inference across
&ࡼ. - Added support for custom file extensions in project.json targets.
$evalnow also works with@foo,#foo,$Fooand$fooparameters #2114.@sprintfmacro (based on the$$sprintfbuiltin) allows compile time format strings #1874.- Improve error reports when encountering a broken "if-catch".
- Add printf format to
$assertand$error#2183. - Make accepting arguments for
maina bit more liberal, acceptingmain(int argc, ZString* argv) - Make
$echoand@sprintfcorrectly stringify compile time initializers and slices. - Add
--sourcesbuild option to add additional files to compile. #2097 - Support untyped second argument for operator overloading.
- The form-feed character '\f' is no longer valid white space.
- Show code that caused unreachable code #2207
- Allow generics over distinct types #2216.
- Support distrinct types as the base type of bitstructs. #2218
- Add hash::sha512 module to stdlib. #2227
- Compile time type assignment (eg
$Foo = int) is no longer an expression. - Add
@allow_deprecatedattribute to functions to selectively allow deprecated declarations #2223. - Improve error message on pointer diff #2239.
- Compile-time comparison of constant vectors. #1575.
- $member.get supports bitstructs.
- $member.set for setting members without the *& trick.
- Initial support for #1925, does not affect C compilation yet, and doesn't try to link etc. Using "--emit-only"
Fixes
-2147483648, MIN literals work correctly.- Splatting const slices would not be const. #2185
- Fixes to
$definehandling of binary ops. - Fixes methodsof to pick up all sorts of extension methods. #2192
--lspsometimes does not emit end tag #2194.- Improve Android termux detection.
- Update Android ABI.
- Fixes to
@formatchecking #2199. - Distinct versions of builtin types ignore @operator overloads #2204.
- @operator macro using untyped parameter causes compiler segfault #2200.
- Make
unreachable()only panic in safe mode. cflagsadditions for targets was not handed properly. #2209$echowould suppress warning about unreachable code. #2205- Correctly format '%c' when given a width. #2199
- Fix to
is_array_or_slice_of_char#2214. - Method on array slice caused segfault #2211.
- In some cases, the compiler would dereference a compile time null. #2215
- Incorrect codegen if a macro ends with unreachable and is assigned to something. #2210
- Fix error for named arguments-order with compile-time arguments #2212
- Bug in AST copying would make operator overloading like
+=compile incorrectly #2217. $defined(#expr)broken with binary. #2219- Method ambiguity when importing parent module publicly in private submodule. #2208
- Linker errors when shadowing @Local with public function #2198
- Bug when offsetting pointers of large structs using ++ and --.
x++andx--works on pointer vectors #2222.x += 1andx -= 1works propertly on pointer vectors #2222.- Fixes to
x += { 1, 1 }for enum and pointer vectors #2222. - Linking fails on operator method imported as
@public#2224. - Lambda C-style vaargs were not properly rejected, leading to crash #2229.
- Incorrect handling of constant null fault causing compiler crash #2232.
- Overload resolution fixes to inline typedef #2226.
math::overflow_*wrappers incorrectly don't allow distinct integers #2221.- Compiler segfault when using distinct type in attribute imported from other module #2234.
- Assert casting bitstruct to short/char #2237.
- @tag didn't work with members #2236.
- Assert comparing untyped lists #2240.
- Fix bugs relating to optional interface addr-of #2244.
- Compiler null pointer when building a static-lib with -o somedir/... #2246
- Segfault in the compiler when using a bitstruct constant defined using a cast with an operator #2248.
- Default assert() message drops parens #2249.
Stdlib changes
- Deprecate
String.is_zstrandString.quick_zstr#2188. - Add comparison with
==for ZString types. is_array_or_slice_of_charandis_arrayptr_or_slice_of_charare replaced by constant@variants.@poolnow has an optionalreserveparameter, some minor changes to the temp_allocator API- io::struct_to_format now supports bitstructs.
- Add
String.escape,String.unescapefor escaping and unescaping a string.
Version 0.7.2
Changelist
Changes / improvements
- Better default assert messages when no message is specified #2122
- Add
--run-dir, to specify directory for running executable usingcompile-runandrun#2121. - Add
run-dirto project.json. - Add
quietto project.json. - Deprecate uXX and iXX bit suffixes.
- Add experimental LL / ULL suffixes for int128 and uint128 literals.
- Allow the right hand side of
|||and&&&be runtime values. - Added
@rnd()compile time random function (using the$$rnd()builtin). #2078 - Add
math::@ceil()compile time ceil function. #2134 - Improve error message when using keywords as functions/macros/variables #2133.
- Deprecate
MyEnum.elements. - Deprecate
SomeFn.params. - Improve error message when encountering recursively defined structs. #2146
- Limit vector max size, default is 4096 bits, but may be increased using --max-vector-size.
- Allow the use of
has_tagofon builtin types. @jumpnow included in--list-attributes#2155.- Add
$$matrix_muland$$matrix_transposebuiltins. - Add
das floating point suffix fordoubletypes. - Deprecate
f32,f64andf128suffixes. - Allow recursive generic modules.
- Add deprecation for
@param foo "abc". - Add
--header-outputandheader-outputoptions for controlling header output folder. - Generic faults is disallowed.
Fixes
- Assert triggered when casting from
int[2]touint[2]#2115 - Assert when a macro with compile time value is discarded, e.g.
foo();wherefoo()returns an untyped list. #2117 - Fix stringify for compound initializers #2120.
- Fix No index OOB check for
[:^n]#2123. - Fix regression in Time diff due to operator overloading #2124.
- attrdef with any invalid name causes compiler assert #2128.
- Correctly error on
@attrdef Foo = ;. - Contract on trying to use Object without initializing it.
- Variable aliases of aliases would not resolve correctly. #2131
- Variable aliases could not be assigned to.
- Some folding was missing in binary op compile time resolution #2135.
- Defining an enum like
ABC = { 1 2 }was accidentally allowed. - Using a non-const as the end range for a bitstruct would trigger an assert.
- Incorrect parsing of ad hoc generic types, like
Foo{int}****#2140. - $define did not correctly handle generic types #2140.
- Incorrect parsing of call attributes #2144.
- Error when using named argument on trailing macro body expansion #2139.
- Designated const initializers with
{}would overwrite the parent field. - Empty default case in @jump switch does not fallthrough #2147.
&&&was accidentally available as a valid prefix operator.- Missing error on default values for body with default arguments #2148.
--pathdoes not interact correctly with relative path arguments #2149.- Add missing
@noreturntoos::exit. - Implicit casting from struct to interface failure for inheriting interfaces #2151.
- Distinct types could not be used with tagof #2152.
$$sat_mulwas missing.forwith incorrectvardeclaration caused crash #2154.- Check pointer/slice/etc on
[out]and¶ms. #2156. - Compiler didn't check foreach over flexible array member, and folding a flexible array member was allowed #2164.
- Too strict project view #2163.
- Bug using
#fooarguments with$defined#2173 - Incorrect ensure on String.split.
- Removed the naive check for compile time modification, which fixes #1997 but regresses in detection.
Stdlib changes
- Added
String.quick_ztrandString.is_zstr - std::ascii moved into std::core::ascii. Old _m variants are deprecated, as is uint methods.
- Add
String.tokenize_allto replace the now deprecatedString.splitter - Add
String.countto count the number of instances of a string. - Add
String.replaceandString.treplaceto replace substrings within a string. - Add
Duration * IntandClock - Clockoverload. - Add
DateTime + Durationoverloads. - Add
Maybe.equalsand respective==operator when the inner type is equatable. - Add
inherit_stdiooption toSubProcessOptionsto inherit parent's stdin, stdout, and stderr instead of creating pipes. #2012 - Remove superfluous
cleanupparameter inos::exitandos::fastexit. - Add
extern fn ioctl(CInt fd, ulong request, ...)binding to libc;
Version 0.7.1
0.7.1 Change list
Changes / improvements
- Better errors on some common casting mistakes (pointer->slice, String->ZString, deref pointer->array) #2064.
- Better errors trying to convert an enum to an int and vice versa.
- Function
@requirechecks are added to the caller in safe mode. #186 - Improved error message when narrowing isn't allowed.
- Operator overloading for
+ - * / % & | ^ << >> ~ == != += -= *= /= %= &= |= ^= <<= >>= - Add
@operator_rand@operator_sattributes. - More stdlib tests:
sincos,ArenaAllocator,Slice2d. - Make aliases able to use
@deprecated. - Refactored stdlib file organization.
- Allow
@ifon locals. - String str = "" is now guaranteed to be null terminated. #2083
- Improved error messages on
Foo { 3, abc }#2099. Foo[1..2] = { .baz = 123 }inference now works. #2095- Deprecated old inference with slice copy. Copying must now ensure a slicing operator at the end of the right hand side:
foo[1..2] = bar[..]rather than the oldfoo[1..2] = bar. The old behaviour can be mostly retained with--use-old-slice-copy). - Added
Enum.lookupandEnum.lookup_field. c3c buildpicks first target rather than the first executable #2105.- New Win32 Mutex, ConditionVariable and OnceFlag implementation
Fixes
- Trying to cast an enum to int and back caused the compiler to crash.
- Incorrect rounding at compile time going from double to int.
- Regression with invalid setup of the WASM temp allocator.
- Correctly detect multiple overloads of the same type.
- ABI bug on x64 Linux / MacOS when passing a union containing a struct of 3 floats. #2087
- Bug with slice acces as inline struct member #2088.
@ifnow does implicit conversion to bool like$if. #2086- Fix broken enum inline -> bool conversions #2094.
@ifwas ignored on attrdef, regression 0.7 #2093.@ensurewas not included when the function doesn't return a value #2098.- Added missing
@clone_alignedand add checks to@tclone - Comparing a distinct type with an enum with an inline distinct type failed unexpectedly.
- The
%swould not properly print function pointers. - Compiler crash when passing an untyped list as an argument to
assert#2108. @ensureshould be allowed to read "out" variables. #2107- Error message for casting generic to incompatible type does not work properly with nested generics #1953
- Fixed enum regression after 0.7.0 enum change.
- ConditionVariable now properly works on Win32
Stdlib changes
- Hash functions for integer vectors and arrays.
- Prefer
math::Iandmath::I_Fformath::IMAGINARYandmath::IMAGINARYFthe latter is deprecated. - Add
array::containsto check for a value in an array or slice.
Version 0.7.0
Changes / improvements
- Removed
Foo { 1, 2 }initializer. - Changed
Foo(<int>)toFoo {int}. - Removed
{| |}expression blocks. - Removed macro
&refand$varefparameters. - Removed
$vaexpr(0)syntax in favour of$vaexpr[0] - Enum does not cast to/from an integer (its ordinal).
- Removed use of
void!for main, test and benchmark functions. - Removed
$or,$and,$concatcompile time functions. - Removed
@adhocattribute. - Disallow inline use of nested generics (e.g.
List{List{int}}. - Remove
.allocator = allocatorsyntax for functions. - Remove
@operator(construct). - Removal of "any-switch".
- Allow swizzling assign, eg.
abc.xz += { 5, 10 }; - Added
$$wstr16and$$wstr32builtins. $foreach"()" replaced by trailing ":"$foreach ($x, $y : $foo)->$foreach $x, $y : $foo:$for"()" replaced by trailing ":"$for (var $x = 0; $x < FOO; $x++)->$for var $x = 0; $x < FOO; $x++:$switch"()" replaced by trailing ":"$switch ($Type)->$switch $Type:- Empty
$switchrequires trailing ":"$switch->$switch: - Rename
@return!to@return?and change syntax to require ":" after faults. - Remove
if (catch foo) { case ... }syntax. - Remove
[?]syntax. - Change
int!toint?syntax. - New
faultdeclaration usingfaultdef. - Enum associated values can reference the calling enum.
- Improve error message on
foo ?? io::EOFwith missing '?' #2036 - Make
@publicimport recursive. #2018 - Fault nameof prefixes the first last module path, for instance
std::io::EOFis rendered asio::EOF. - Rename
deftoalias. - Change
distinct->typedef. - Order of attribute declaration is changed for
alias. - Added
LANGUAGE_DEV_VERSIONenv constant. - Rename
anyfault->fault. !!foonow works same as as! ! foo.- Temp allocator now supports more than 2 in-flight stacks.
- Printing stacktrace uses its own temp allocator.
- Allow inferred type on body parameters. E.g.
@stack_mem(1024; alloc) { ... }; - Use
@pool_init()to set up a temp pool on a thread. Only the main thread has implicit temp pool setup. tmemis now a variable.- Compile test and benchmark functions when invoking
--lsp#2058. - Added
@formatattribute for compile time printf validation #2057. - Formatter no longer implicitly converts enums to ordinals.
Fixes
- Fix address sanitizer to work on MachO targets (e.g. MacOS).
- Post and pre-decrement operators switched places for vector elements #2010.
- Aliases were incorrectly considered compile time constants.
- FreeBSD libc stat definitions were incorrect.
- Atomic max was incorrect.
"+".to_float()would panic.importcan now both be @public and @norecurse.- Crash when trying to convert a struct slice to a vector #2039.
- Crash resolving a method on
Foo[2]whenFoois distinct #2042. - Bug due to missing cast when doing
$i[$x] = $z. - Incorrectly allowed getting pointer to a macro #2049.
- &self not runtime null-checked in macro #1827.
- Bug when printing a boolean value as an integer using printf.
- Show error when a generic module contains a self-generic type.
- "Single module" was not enforced when creating a static library using as a project target.
Stdlib changes
new_*functions in general moved to version withoutnew_prefix.string::new_from_*changed tostring::from_*.String.to_utf16_copyand related changed toString.to_utf16.String.to_utf16_tcopyand related changed toString.to_temp_utf16mem::temp_newchanged tomem::tnew.mem::temp_allocand related changed tomem::talloc.mem::temp_new_arraychanged tomem::temp_array.- Add
ONHEAPvariants for List/HashMap for initializing global maps on the heap. - Remove Vec2 and other aliases from std::math. Replace
.length_sq()withsq_magnitude() - Change all hash functions to have a common
hashfunction. @wstring,@wstring32,@char32and@char16compile time macros added.- Updates to
Atomicto handle distinct types and booleans. - Added
math::iota. @poolno longer takes an argument.Allocatorinterface removesmarkandreset.- DynamicArenaAllocator has changed init function.
- Added
BackedArenaAllocatorwhich is allocated to a fixed size, then allocates on the backing allocator and supports mark/reset. AnyListnow also defaults to the temp allocator.os::getcwdandos::get_home_dirrequires an explicit allocator.file::load_newandfile::load_path_newremoved.os::exitandos::fastexitadded.