mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
14 KiB
14 KiB
C3C Release Notes
0.5.0 Change List
Changes / improvements
- Strong optional handling requirements.
- Better dead code analysis, and added dead code errors.
- Exhaustive switches with enums has better analysis.
- Globals may now be initialized with optional values.
- New generic syntax.
- Slice initialization.
$featurefor feature flags.- Improved stack trace.
- Macro ref parameters are now of pointer type and ref parameters are not assignable.
- Added
nextcase default. - Added
$embedto embed binary data. - Ad hoc generics are now allowed.
- Allow inferred type on method first argument.
- Fix to void expression blocks
- Temporary objects may now invoke methods using ref parameters.
- Delete object files after successful linking.
@ifintroduced, other top level conditional compilation removed.@dynamicand@interfacefor dynamic dispatch.$ifnow uses$if <expr>:syntax.$assertnow uses$assert <expr> : <optional message>$erroris syntax sugar for$assert false : "Some message"$include,$echono longer has mandatory()around the arguments.$execfor including the output of files.assertno longer allows "try unwrap"- Updated cpu arguments for x86
- Removed support for ranged case statements that were floats or enums, or non-constant.
nextcasewith a constant expression that does not match any case is an error.- Dropped support for LLVM 13-14.
- Updated grammar and lexer definition.
- Removal of
$elif. @stdcalletc removed in favor of@callconv- Empty fault definitions is now an error.
- Better errors on incorrect bitstruct syntax.
- Internal use wildcard type rather than optional wildcard.
- Experimental scaled vector type removed.
- Disallow parameterize attributes without parameters eg
define @Foo() = { @inline }. - Handle
@optreturncontract, renamed@return!. - Restrict interface style functions.
- Optional propagation and assignment '!' and '?' are flipped.
- Add
lsuffix (alias for i64). - Allow getting the underlying type of anyfault.
- De-duplicate string constants.
- Change @extname => @extern.
defineandtypedefremoved.defineis replaced bydef.- LLVM "wrapper" library compilation is exception free.
privateis replaced by attribute@private.- Addition of
@localfor file local visibility. - Addition of
@publicfor overriding default visibility. - Default visibility can be overridden per module compile unit. Eg
module foo @private. - Optimized macro codegen for -O0.
- Addition of unary
+. - Remove the
:and;used in $if, $switch etc. - Faults have an ordinal.
- Generic module contracts.
- Type inference on enum comparisons, e.g
foo_enum == ABC. - Allow {} to initialize basic types.
- String literals default to
String. - More const modification detection.
- C3L zip support.
- Support printing object files.
- Downloading of libraries using vendor "fetch".
- Structural casts removed.
- Added "native" option for vector capability.
$$shufflevectorreplaced with$$swizzleand$$swizzle2.- Builtin swizzle accessors.
- Lambdas, e.g
a = int(x, y) => x + y. - $$FILEPATH builtin constant.
variantrenamedany.anyerrrenamedanyfault.- Added
$$wasm_memory_sizeand$$wasm_memory_growbuiltins. - Add "link-args" for project.
- Possible to suppress entry points using
--no-entry. - Added
memory-envoption. - Use the .wasm extension on WASM binaries.
- Update precedence clarification rules for ^|&.
- Support for casting any expression to
void. - Win 32-bit processor target removed.
- Insert null-check for contracts declaring & params.
- Support user defined attributes in generic modules.
--strip-unuseddirective for small binaries.$$atomic_storeand$$atomic_loadadded.usz/iszreplacesusizeandisize.@exportattribute to determine what is visible in precompiled libraries.- Disallow obviously wrong code returning a pointer to a stack variable.
- Add &^| operations for bitstructs.
@noinitreplaces= voidto opt-out of implicit zeroing.- Multiple declarations are now allowed in most places, eg
int a, b;. - Allow simplified (boolean) bitstruct definitions.
- Allow
@testto be placed on module declarations. - Updated name mangling for non-exports.
defer catchanddefer trystatements added.- Better errors from
$assert. @deprecatedattribute added.- Allow complex array length inference, eg
int[*][2][*] a = .... - Cleanup of cast code.
- Removal of
generickeyword. - Remove implicit cast enum <-> int.
- Allow enums to use a distinct type as the backing type.
- Update addition and subtraction on enums.
@ensurechecks only non-optional results.assertmay now take varargs for formatting.
Stdlib changes
- Socket handling.
csvpackage.- Updated posix/win32 stdlib namespacing
processstdlib- Stdlib updates to string.
- Many additions to
List:remove,array_view,add_all,compactetc - Added dstringwriter.
- Improved printf formatting.
- is_finite/is_nam/is_inf added.
- OnStack allocator to easily allocate a stack buffer.
- File enhancements: mkdir, rmdir, chdir.
- Path type for file path handling.
- Distinct
Stringtype. - VarString replaced by DString.
- Removal of std::core::str.
- JSON parser and general Object type.
- Addition of
EnumMap. - RC4 crypto.
- Matrix identity macros.
- compare_exchange added.
printflnandprintlnrenamedprintfnandprintn.- Support of roundeven.
- Added easings.
- Updated complex/matrix, added quaternion maths.
- Improved support for freestanding.
- Improved windows main support, with @winmain annotations.
SimpleHeapAllocatoradded.- Added win32 standard types.
- Added
saturatedmath. - Added
@expect,@unlikelyand@likelymacros. - Temp allocator uses memory-env to determine starting size.
- Temp allocator is now accessed using
mem::temp(), heap allocator usingmem::heap(). - Float parsing added.
- Additions to std::net, ipv4/ipv6 parsing.
- Stream api.
- Random api.
- Sha1 hash function.
- Extended enumset functionality.
- Updated malloc/calloc/realloc/free removing old helper functions.
- Added TrackingAllocator.
- Add checks to prevent incorrect alignment on malloc.
- Updated clamp.
- Added
ClockandDateTime. - Added posix socket functions.
Fixes
- Types of arrays and vectors are consistently checked to be valid.
- Anonymous bitstructs check of duplicate member names fixed.
- Assignment to anonymous bitstruct members in structs.
- Fix casts on empty initializers.
- Fix to DString reserve
- @local declarations in generic modules available by accident.
- Fixes missing checks to body arguments.
- Do not create debug declaration for value-only parameter.
- Bug in alignment for atomics.
- Fix to bug when comparing nested arrays.
- Fix to bug when a macro is using rethrow.
- Fixes bug initializing a const struct with a const struct value.
- Fixes bug when
voidis passed to an "any"-vararg. - Fixed defer/return value ordering in certain cases.
- Fixes to the x64 ABI.
- Updates to how variadics are implemented.
- Fixes to shift checks.
- Fixes to string parsing.
- Bug when rethrowing an optional from a macro which didn't return an optional.
- Fixed issues with ranged cases.
- Disallow trailing ',' in function parameter list.
- Fixed errors on flexible array slices.
- Fix of
readdirissues on macOS. - Fix to slice assignment of distinct types.
- Fix of issue casting subarrays to distinct types.
- Fixes to
split,rindex_of. - List no longer uses the temp allocator by default.
- Remove test global when not in test mode.
- Fix sum/product on floats.
- Fix error on void! return of macros.
- Removed too permissive casts on subarrays.
- Using C files correctly places objects in the build folder.
- Fix of overaligned deref.
- Fix negating a float vector.
- Fix where $typeof(x) { ... } would not be a valid compound literal.
- Fix so that using
varinif (var x = ...)works correctly. - Fix int[] -> void* casts.
- Fix in utf8to16 conversions.
- Updated builtin checking.
- Reduce formatter register memory usage.
- Fixes to the "any" type.
- Fix bug in associated values.
- More RISC-V tests and fixes to the ABI.
- Fix issue with hex floats assumed being double despite
fsuffix. - Fix of the
tanfunction. - Fixes to the aarch64 ABI when passing invalid vectors.
- Fix creating typed compile time variables.
- Fix bug in !floatval codegen.
- Fix of visibility issues for generic methods.
- Fixes to
$include. - Fix of LLVM codegen for optionals in certain cases.
- Fix of
$vasplatwhen invoked repeatedly. - Fix to
$$DATE. - Fix of attributes on nested bitstructs.
- Fix comparing const values > 64 bits.
- Defer now correctly invoked in expressions like
return a > 0 ? Foo.ABC! : 1. - Fix conversion in
if (int x = foo()). - Delay C ABI lowering until requested to prevent circular dependencies.
- Fix issue with decls accidentally invalidated during
$checkedeval. - Fold optional when casting slice to pointer.
- Fixed issue when using named arguments after varargs.
- Fix bug initializing nested struct/unions.
- Fix of bool -> vector cast.
- Correctly widen C style varargs for distinct types and optionals.
- Fix of too aggressive codegen in ternary codegen with array indexing.
0.4.0 Change List
- Compatibility with LLVM 16.
- Dropped LLVM 12 support.
- Updated vector comparisons.
- Built in unit testing with @test and compile-test
- Updated memory allocators. Added
@scopedand@poolmacros. - Various bug fixes.
- Generic modules may now be generic over integers and booleans.
- Constant pointers may be compile time evaluated.
- Added many new builtins.
- Emit asm using
--emit-asm. - Added
--nostdliband--nolibc. - Compiling for AVX can now select "native".
- Fixes to adding libraries at link time.
- Various improved error messages.
- Windows debug info fixes.
- Add of
foreach_rfor reverse list traversal. - Script downloading the MSVC SDK to cross compile to windows.
- Many standard library additions.
- Extension methods may be added for built-in types.
- Macros may take vector and array arguments generic over length.
- Macro varargs with $vaarg, $vacount etc.
- Many vector builtins added as dot methods.
- in / out / inout doc parameters checked.
- Initial inline asm support for aarch64 and x64.
- Single line short function declaration.
- Added
$checksbuiltin. - Added
$includebuiltin for including other text files. - Optional single module compilation.
- Static initialization / finalization to have code running at start/end.
- C3 custom printf function in the stdlib.
[]=overload now works correctly.- Static libraries may now be built.
- More compile time reflection added and general cleanup done.
- usize/isize/iptrdiff/uptrdiff replaced by usz/isz.
- Add
varto allow type inference on regular variables. - LLVM codegen optimizations.
??now allows chaining another optional.- int128 support on all platforms.
importis now allowed anywhere at the top level.project.c3prenamedproject.json- Update to project properties, e.g. "libs" -> "dependencies" etc.
- $$TIME, $$DATE and $$FUNCTION builtin defines added.
$echofunction to print messages at compile time.- Improvements to untyped lists.
- Various builtins added: $$prefetch, $$reverse, $$shufflevector etc.
0.3.0 Change List
Changes / improvements:
- Allow any expression as default expression.
- Allow using enums for indexing arrays.
- Added $convertable / $castable compile time functions.
- Removed ´func´ deprecated keyword
- Slicing a distinct type now returns the distinct type.
- Renamed @autoimport -> @builtin
- Zero length arrays not allowed
- Allow methods may use ref, pointer and value arguments as "self"
- Updated external name mangling
- More advanced introspection.
- @maydiscard and @nodiscard annotations
- New type promotion rules: The common type of int[x]* and int[y]* is int[]
- Added type.inner and type.len reflection.
- Support float mod operations.
- Add float.max/min.
- Allow [in] contract to be used on subarray types.
- Add linker and linked dir arguments to build files.
- Auto-import std::core.
- LLVM 15 support.
- Beter native file handling for MSVC
- New import rules – recursive imports
- Add lld linking for FreeBSD
- User defined attributes. @Foo = @inline
- Support enum associated values.
- @ is now part of the name of an attribute or a macro. Macros without '@' must be function-like.
- Ordinal based enums.
- Allow locals to shadow global variables.
- Prefer inferred constant over global in the case of MyEnum f = BAR;
- Enum and fault name reflection.
- Deref null error now panics in safe mode.
Changes to stdlib:
- Updated allocators.
- Added enum_by_name.
- Moved bitcast to builtin module.
- Native printf for files and strings.
- Updated String.
- Comparison macros
- Added Binary-Heap Based Priority Queue by David Kopec
- Matrix Math Library by PixelRifts
- UTF conversions in "conv" module.
Fixes:
- Attributes correctly checks for recursive definitions now.
- Added a max bitstruct size.
- Fix of expr location in args.
- Fixing distinct, typedef and bitstruct copying. Fix where global constants did not need to be constant.
- Better error on all upper parameter names.
- Fix constant typeid comparisons.
- Simplify and corrected if try/catch parsing.
- Fix bug with { [A] = 1 }
- Conversion unsigned int -> enum fixed.
- Fix bug preventing implicit & on optionals.
- More efficient int[] a = {}
- Fix bug in extension methods for generic types and typedefs
- Fix to extension methods in other modules.
- Disallow complist as a regular macro parameter.
- Fix in nested block handling
- Fix of error where {| |} with value return could have no final return
- Vararg abi fix
- Fix "libs" in project creation
- Fix bug with bit struct initialization and zeros
- Reduce size of memory pages used.
- Fix issues with union of const.
- Fix initialization of anonymous structs.
- Fix conversion between distinct void* and null
- Fix of default project creation target format.
- Fix of $sizeof(Type) => Type.sizeof
- Fix stack setting after error return.
- Fix module assignment of declarations
- Global @align fixed
- Fixes enum set with new ordinal based enums
- SysV ABI fix for passing certain things by struct.
- Fix implicitly converting to float in the case of myfloat *= -1