Christoffer Lerno
908d705669
Removing use of $assignable and deprecate it.
2025-07-20 20:07:06 +02:00
Christian Buttner
2053f2767b
Add ConditionVariable.wait_until and ConditionVariable.wait_for ( #2302 )
...
* Add `ConditionVariable.wait_until` and `ConditionVariable.wait_for`
* Add "@structlike" for typedefs.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-07-19 13:12:14 +02:00
Airtz
b1a22b5002
Implement Ed25519 ( #2297 )
...
* Implement Ed25519
* Overloading addition with a pointer would not work.
* Added @addr macro.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-07-19 01:13:15 +02:00
Christoffer Lerno
ee35001732
Suppress codegen of panic printing with when panic messages are set to "off".
...
Implicit linking of libc math when libc math functions are used.
2025-07-17 14:45:02 +02:00
Christoffer Lerno
e755c36ea2
Removed the use of temp allocator in backtrace printing.
...
Added string::bformat.
2025-07-13 02:58:57 +02:00
Christoffer Lerno
60d96ca7b7
Initialize pool correctly in print_backtrace.
2025-07-04 02:43:49 +02:00
Christoffer Lerno
cf167c9446
Make unreachable() only panic in safe mode.
2025-06-14 18:37:49 +02:00
Christoffer Lerno
c9d9127da6
Deprecate foo.#bar.
2025-06-05 12:51:35 +02:00
Christoffer Lerno
b83e57b952
Added @rnd() compile time random function (using the $$rnd() builtin). #2078
2025-05-15 00:51:33 +02:00
DragonFriend
50b4d7aa35
Add replace and treplace to String ( #2127 )
...
* Add replace and treplace functions to String
2025-05-14 11:00:20 +02:00
Boris Barbulovski
b5d0739de0
Add env::ANDROID to std.*
2025-04-16 17:47:49 +02:00
Sander van den Bosch
561a683230
Added .hash() functions for vectors ( #2043 )
...
* Added .hash() functions for vectors
* Update test to a non-zero sized vector
* Changed vector hash functions to hash the underlying bytes in a char slice, the same approch is used for arrays
* Added test for hashed
* Updated formatting to be consistant with C3 code style
* Formatting, use "self"
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-03-31 16:33:48 +02:00
Christoffer Lerno
a03d821602
- Use @pool_init() to set up a temp pool on a thread. Only the main thread has implicit temp pool setup.
...
- `tmem` is now a variable.
2025-03-21 17:08:58 +01:00
Christoffer Lerno
72608ce01d
- Temp allocator now supports more than 2 in-flight stacks.
...
- Printing stacktrace uses its own temp allocator.
- `@pool` no longer takes an argument.
- `Allocator` interface removes `mark` and `reset`.
- DynamicArenaAllocator has changed init function.
- Added `BackedArenaAllocator` which is allocated to a fixed size, then allocates on the backing allocator and supports mark/reset.
2025-03-18 15:16:22 +01:00
Christoffer Lerno
5c77c9a754
- Change distinct -> typedef.
...
- Order of attribute declaration is changed for `alias`.
- Added `LANGUAGE_DEV_VERSION` env constant.
- Rename `anyfault` -> `fault`.
- Changed `fault` -> `faultdef`.
- Added `attrdef` instead of `alias` for attribute aliases.
2025-03-15 20:10:47 +01:00
Christoffer Lerno
8b49e6c14d
Rename def to alias.
2025-03-13 11:22:27 +01:00
Christoffer Lerno
b8ae2b06d6
Rename @return! to @return?
2025-03-12 21:40:30 +01:00
Christoffer Lerno
25bccf4883
New faults and syntax ( #2034 )
...
- Remove `[?]` syntax.
- Change `int!` to `int?` syntax.
- New `fault` declarations.
- Enum associated values can reference the calling enum.
2025-03-10 00:11:35 +01:00
Christoffer Lerno
c0b80eccad
Change @return! syntax to require ":" after faults. Update all contracts to consistently use ":" before the description.
2025-03-05 17:11:45 +01:00
Christoffer Lerno
2439405e70
- $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 `$switch` requires trailing ":" `$switch` -> `$switch:`
2025-03-04 16:13:47 +01:00
Christoffer Lerno
0a905d8458
Change all hash functions to have a common hash function.
2025-03-03 20:07:02 +01:00
Christoffer Lerno
2a895ec7be
First 0.7 update, removing all deprecated features.
2025-03-03 00:32:20 +01:00
Christoffer Lerno
33b05bcfeb
More deprecations in lib6, and updates to lib7
2025-02-27 11:10:41 +01:00
Christoffer Lerno
e77d1fb646
- Increase precedence of (Foo) { 1, 2 }
...
- Add `--enable-new-generics` to enable `Foo{int}` generic syntax.
2025-02-18 00:26:22 +01:00
Christoffer Lerno
e1d546225f
Update stdlib with new syntax for short function decl.
2025-02-08 23:04:59 +01:00
Christoffer Lerno
8e0d6d11b9
Deprecated '&' macro arguments.
2025-01-08 22:13:49 +01:00
Francesco Alemanno
a16316d7b4
enhance default hashing strategy for basic types ( #1758 )
...
* enhance default hashing strategy for basic types
* fix
* `$defined` in a global scope should accept testing normal macros.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-01-02 20:44:33 +01:00
Christoffer Lerno
99c350fc43
Fix error where panic would not properly stop the program when stacktrace couldn't be printed #1751 .
2025-01-01 13:00:04 +01:00
Book-reader
4f4476ba75
fix typo in @require statement in builtin.c3
2024-12-29 12:24:36 +01:00
Christoffer Lerno
d20d957881
Add @enum_from_value
2024-12-27 23:21:36 +01:00
Christoffer Lerno
e453e6f9ca
- Add enum.from_ordinal and fault.from_ordinal
...
- Deprecate cast-style conversion from integer to enum.
- Make deprecation an error in test mode.
2024-12-23 15:27:59 +01:00
Christoffer Lerno
9c22ab8925
Add "skip_empty" to split methods. Add split_to_buffer method.
2024-12-21 15:43:37 +01:00
Christoffer Lerno
08d1b29301
Add contracts on @catch / @ok. Taking the $typeof of a wildcard optional returns void!
2024-11-05 10:50:38 +01:00
Christoffer Lerno
31cd839063
Switch to <* *> docs. Fix issue with dynamically loaded C3 libs with other C3 code.
2024-10-14 02:14:34 +02:00
Christoffer Lerno
a665978b64
Fixing some whitespace issues.
2024-10-08 19:38:31 +02:00
Christoffer Lerno
ed5d338a39
Added new style named arguments.
2024-09-05 22:13:22 +02:00
Christoffer Lerno
d635cfb90f
printf will now show errors in the output when there are errors.
2024-08-31 19:36:18 +02:00
Christian Buttner
59ed118e66
Address/memory/thread sanitizer.
2024-08-23 16:06:22 +02:00
Christoffer Lerno
edfea639cf
- Introduce $vaarg[...] syntax and deprecate the old $vaarg(...).
...
- Similar change to `$vasplat`: `$vasplat` and `$vasplat[1..]`.
2024-08-16 09:28:28 +02:00
Christoffer Lerno
3ccb4b9ec3
$exec may now provide a stdin parameter. Deprecated path.append, path.tappend, getcwd, tgetcwd, path.absolute, ls. Deprecated env::get_config_dir, replaced by env::new_get_config_dir. Added path.has_extension, path.new_append, path.temp_append, new_cwd, temp_cwd, path.new_absolute, new_ls, temp_ls. Added dstring.replace Updated win escapes for exec.
2024-08-15 00:31:47 +02:00
Christoffer Lerno
bf8ca989d6
Add --show-backtrace option to disable backtrace for even smaller binary.
2024-07-28 01:10:59 +02:00
Christoffer Lerno
fba706f10b
Updated sorting code.
2024-07-09 01:04:11 +02:00
Christian Buttner
cc9ca35e04
Add $debugtrap builtin. ( #1220 )
...
Add `$breakpoint` builtin.
2024-07-04 00:50:29 +02:00
Christoffer Lerno
f2e5c5e9b9
- Fix bug with @jump miscompile
...
- Remove "panic" text from unreachable() when safe mode is turned off.
2024-06-22 23:20:23 +02:00
Christoffer Lerno
819049d596
@str_hash, @str_upper, @str_lower, @str_find compile time macros.
2024-06-16 21:16:03 +02:00
Christoffer Lerno
e293c435af
0.6.0: init_new/init_temp removed. LinkedList API rewritten. List "pop" and "remove" function now return Optionals. RingBuffer API rewritten. Allocator interface changed. Deprecated Allocator, DString and mem functions removed. "identity" functions are now constants for Matrix and Complex numbers. @default implementations for interfaces removed. any* => any, same for interfaces. Emit local/private globals as "private" in LLVM, following C "static". Updated enum syntax. Add support [rgba] properties in vectors. Improved checks of aliased "void". Subarray -> slice. Fix of llvm codegen enum check. Improved alignment handling. Add --output-dir #1155 . Removed List/Object append. GenericList renamed AnyList. Remove unused "unwrap". Fixes to cond. Optimize output in dead branches. Better checking of operator methods. Disallow any from implementing dynamic methods. Check for operator mismatch. Remove unnecessary bitfield. Remove numbering in --list* commands Old style enum declaration for params/type, but now the type is optional. Add note on #1086 . Allow making distinct types out of "void", "typeid", "anyfault" and faults. Remove system linker build options. "Try" expressions must be simple expressions. Add optimized build to Mac tests. Register int. assert(false) only allowed in unused branches or in tests. Compile time failed asserts is a compile time error. Remove current_block_is_target. Bug when assigning an optional from an optional. Remove unused emit_zstring. Simplify phi code. Remove unnecessary unreachable blocks and remove unnecessary current_block NULL assignments. Proper handling of '.' and Win32 '//server' paths. Add "no discard" to expression blocks with a return value. Detect "unsigned >= 0" as errors. Fix issue with distinct void as a member #1147 . Improve callstack debug information #1184 . Fix issue with absolute output-dir paths. Lambdas were not type checked thoroughly #1185 . Fix compilation warning #1187 . Request jump table using @jump for switches. Path normalization - fix possible null terminator out of bounds. Improved error messages on inlined macros.
...
Upgrade of mingw in CI. Fix problems using reflection on interface types #1203 . Improved debug information on defer. $foreach doesn't create an implicit syntactic scope.
Error if `@if` depends on `@if`. Updated Linux stacktrace. Fix of default argument stacktrace. Allow linking libraries directly by file path. Improve inlining warning messages. Added `index_of_char_from`. Compiler crash using enum nameof from different module #1205 . Removed unused fields in find_msvc. Use vswhere to find msvc. Update tests for LLVM 19
2024-06-12 10:14:26 +02:00
Christoffer Lerno
1a25746343
Regression: no stacktrace.
2024-03-12 17:31:06 +01:00
Christoffer Lerno
748c737e8f
0.5.4: Hash variables accept designated initializers. @safemacro overrides the need for @ in macro names. Fixes to macro context evaluation. Updated allocator api. Removed install_win_reqs.bat. Deterministic @init for MacOS. Fixed temp memory issue with formatter. Support LLVM 19. Add support to compare bitstructs using == and !=. Support Windows .def files. Removed invalid grammar from grammar.y. Support compile time folding of &|^~ for bitstructs. output project setting now respected. Fix issue where constants were not properly constant folded. Add temp_push/pop. Aliased declarations caused errors when used in initializers. Fix export output. Fix of const ternary #1118 . Fix of $$MODULE in nested macros #1117 . Fix debug info on globals. out now correctly detects subscript[] use #1116 . Lateral implicit imports removed. Default to '.' if no libdir is specified. Improved error messages for --lib. Fix raylib snake example. Overzealous local escape check corrected #1127 . Improved yacc grammar #1128 . --linker argument #1067 . Fixes to the matrix operations #1130 . Added GenericList.
2024-02-15 21:39:33 +01:00
Christoffer Lerno
deb4cc7c4b
0.5.3: Single-module not respected. Fix issue with compiler defined types. Fix optimization levels for projects. Use GEP i8 on offsets. Optimize foreach on len 1 arrays. Move panic blocks last. Fix generic module wildcard imports. Deprecate init_temp / init_new. Fix issue with macro vaarg and untyped lists. Fix extern const globals.
2024-01-14 15:34:54 +01:00
Christoffer Lerno
87fdb5956e
Improved backtrace on platforms without glibc. Added $$frameaddress and $$returnaddress properly.
2023-11-18 20:13:11 +01:00