Christoffer Lerno
7ea3d230bb
0.5.5 features ( #1151 )
...
0.5.5 Disallow multiple `_` in a row in digits, e.g. `1__000`. #1138 . Fixed toposort example. Struct/union members now correctly rejects members without storage size #1147 . `math::pow` will now correctly promote integer arguments. `math::pow` will now correctly promote integer arguments. Added `new_aligned` and `alloc_aligned` functions to prevent accidental under-alignment when allocating simd. Pointer difference would fail where alignment != size (structs etc) #1150 . Add test that overalignment actually works for lists. Fixed array calculation for npot2 vectors. Use native aligned alloc on Windows and POSIX. Deprecates "offset". Simplification of the Allocator interface.
2024-02-22 17:13:51 +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
e91f6e268e
0.5.2: Allow trailing comma in calls and parameter declarations #1092 . Fixes issue where single character filenames like 'a.c3' would be rejected. Improve error messages for incorrect user defined foreach. Fix bug with generics in generics. Fix to error with modified vector parameters. Crash with lhs vector inference. Fixes to priority queue.
2023-12-23 23:15:51 +01:00
Christoffer Lerno
1d61ace302
Do not link with debug libc on win32 when using cross compile libs. Add delete methods to dstring. Fixes to macOS aarch64 codegen. Use glibc backtrace when available. Add load_* methods to file. The cast (int[8])int_slice[:8] now works.
2023-12-08 18:59:57 +01:00
Christoffer Lerno
1e38ccdd2b
Fix missing free on GrowableBitSet. init_new/init_temp for GrowableBitSet, LinkedList, List, HashMap, DString, ByteBuffer. Interface to_string renamed to_new_string. Change in allocator usage, malloc is now heap. Added new_array, new_zero_array, new, new_clear, clone. Concat => concat_new. string::printf => string::new_format, string::tprintf => string::tformat. "to_*" are now "to_new_*" and "to_temp_*". "from_*" is "new_from*"
2023-11-09 01:59:49 +01:00
Christoffer Lerno
1aa038c92f
Interface based streams. Fix for initializing with a force unwrap inside. Allow $define to take a list. Allow $define to return error on argument type mismatch in call. Fixed broken bit operations on boolean vectors.
2023-10-31 01:06:59 +01:00
Christoffer Lerno
9af37fe427
$and, $or, $is_const, $assignable, .is_eq, .is_ordered, $defined($vatype(2)) works looking if we can create a type, $defined(foo[0]) $defined(foo()). Remove $checks and @checked. Improvide casting checks to always work without destructive changes.
2023-10-24 22:06:04 +02:00
Christoffer Lerno
d01d8d3663
"protocol" => "interface"
2023-10-20 14:12:08 +02:00
Pierre Curto
3aa85cf641
misc ( #1033 )
...
* make conv::char32_to_utf8_unsafe() return the number of bytes it wrote
add tests for DString
fix pointer arithmetic in DString.insert_at
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* add support to printf for %d and enums
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-10-08 02:12:20 +02:00
Christoffer Lerno
312a39ee24
Handle protocol inheritance. Allow overlapping protocol methods. Remove the need for &self in protocol declarations. Fix cast rules for protocol. Fix cast rules for bitstruct #1034 .
2023-10-08 02:10:28 +02:00
Christoffer Lerno
99cfaa1583
Refactor protocols.
2023-10-06 22:31:41 +02:00
Christoffer Lerno
a1bce81ed0
Fix growable bitset ( #1032 )
2023-10-06 01:27:32 +02:00
Christoffer Lerno
dad21bfc6f
See if we can get better errors.
2023-10-05 20:35:40 +02:00
Pierre Curto
9643a7c2b2
add DString.insert_at ( #1026 )
...
* add DString.insert
* make conv::utf32to8 more C3-like
2023-10-05 19:12:47 +02:00
Christoffer Lerno
49c4595457
Dynamic protocols.
2023-10-05 15:20:41 +02:00
Christoffer Lerno
4cc30c0d33
Replace static initializer with @init / @finalizer
2023-10-03 12:45:43 +02:00
Christoffer Lerno
c5404c6573
get_env for Win32, @pierrec's get_config_dir and get_home_dir
2023-09-25 16:29:49 +02:00
Christoffer Lerno
a1ecf2211f
as_str() replaced by str_view()
2023-09-24 23:50:16 +02:00
Pierre Curto
d6edd80f3b
lib::std::encoding: add varint::{read,write}
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-22 15:16:44 +02:00
Dmitry Atamanov
d6e9985a26
Add log(x, base) function to std::math module.
2023-09-15 09:22:34 +02:00
Christoffer Lerno
2eddda9061
Add gather/scatter for vectors.
2023-09-14 10:19:15 +02:00
Christoffer Lerno
b2ac4b4253
Allow use of pointers in vectors.
2023-09-13 13:45:33 +02:00
Pierre Curto
d61482dffc
fix Object.free ( #982 )
...
* lib/std/collections: add HashMap.@each_entry()
* lib/std/json: fix Object.free() when object is a map
* lib/std/collections: fix allocator use in Object.{set,set_at,append}
* lib/std: add char.from_hex
* lib/std/collections: print arrays and objects compactly
* lib/std/io: fix Formatter.vprintf result
* lib/std/io/stream: rename module for ByteBuffer
* lib/std/io/stream: make Scanner a Stream reader
* lib/std/io: make std{in,err,out} return File* if no libc
2023-09-12 13:49:52 +02:00
Christoffer Lerno
d67e846712
Remove cast from void! to anyfault. Rename @catchof to @catch
2023-09-09 22:49:32 +02:00
Christoffer Lerno
dfe097931c
Add masked_load / masked_store
2023-09-09 01:05:51 +02:00
Christoffer Lerno
4ef74a1205
Add $$select. "--fp-math" options. Fixed issue with accidentally silent error on failed vector conversions.
2023-09-08 09:20:27 +02:00
Pierre Curto
51f76c69c4
lib/std/collections: add Bitset
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-06 23:09:37 +02:00
Christoffer Lerno
b87e27d8a3
Update tests and CI ( #979 )
...
Update CI. Explicit native mutex "initialized" bool.
2023-09-06 22:43:07 +02:00
Pierre Curto
f8fa9a057e
lib/std/io: support . string format speficier ( #970 )
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-05 14:39:51 +02:00
Christoffer Lerno
4c081f59ff
Refactoring, adding printf / printfn to all streams.
2023-09-03 10:14:04 +02:00
Christoffer Lerno
9a6d83f526
Updated stream API.
2023-09-03 01:14:15 +02:00
Pierre Curto
e56313a204
use slice assign and add List.*using_test functions ( #967 )
...
* std/collections: use slice assignment
* std/collections: add List.remove_using_test and List.retain_using_test
2023-09-01 12:16:15 +02:00
Pierre Curto
cd950a0359
lib/std/collections: fix comments, List.remove_if() and List.retain_if() methods
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-31 23:20:50 +02:00
Christoffer Lerno
82ba02a904
Allow indexing of constant strings. Fixed reverse indexing of constant initializers.
2023-08-30 16:36:29 +02:00
Christoffer Lerno
dd0dc1a936
Allow anyfault and any aliasing. Fix any comparison.
2023-08-30 13:56:16 +02:00
Christoffer Lerno
eac19814e1
Make typeid switches always use subtype matching. Update seeder mixing.
2023-08-29 22:48:26 +02:00
OdnetninI (Eduardo José Gómez Hernández)
7aca8a02cb
Architecture generic Atomics (C11 + extras) ( #958 )
...
* Initial implementation for c11 atomics
* Fix cmpxchg usage
* Support for floating point atomics
* Added atomic min and max
* Updated copyright notice
* Removed Floats from and or xor. Added mul, div, bitshift
* Changed get_atomic_compatible_type to lower_to_atomic_compatible_type
* Require non-null pointers
* Fix spacing
* Added Atomic type
* Added macro to reduce code
* Small reorder and cleanup
* Added cmpxchg constrains
* Apply all the restrictions for atomic loads/stores and cmpxchg
2023-08-29 14:25:43 +02:00
Dmitry Atamanov
efb492eace
Add simple benchmark runner.
2023-08-29 12:28:06 +02:00
Pierre Curto
c09b6154f4
std/lib/collections: add Object.get_len(); add some tests for encoding/json
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Pierre Curto
eedb2c3c52
std/collections: add RingBuffer.popc()
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Pierre Curto
c0b109fbc1
#934 followup
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-24 18:10:18 +02:00
Dmitry Atamanov
b77f254ab1
Tune @expect, @likely, @unlikely and @prefetch macros.
2023-08-24 16:09:56 +02:00
Christoffer Lerno
16e71c14b9
New resolution of $define only check on the last element. Fix issue with pointer and array element types not considered live.
2023-08-22 18:16:26 +02:00
Christoffer Lerno
ed70f39da8
Update the json API
2023-08-19 00:53:28 +02:00
Christoffer Lerno
d5aebb434c
Eliding length for ":"-ranges is no longer allowed.
2023-08-18 22:25:51 +02:00
Christoffer Lerno
17f69d8da8
Update slice assign so that it looks at the arguments and does slice copying or splat assign as needed.
2023-08-18 18:46:38 +02:00
Pierre Curto
7a39933c97
add NanoDuration.to_format() ( #935 )
...
* lib/std/time: avoid switch in DateTime.compare_to()
* lib/std/time: add NanoDuration.to_format()
* std/lib: fix #934
2023-08-17 10:30:20 +02:00
Christoffer Lerno
9b0da89a03
Added compare_to as a standard macro.
2023-08-17 10:13:00 +02:00
Christoffer Lerno
0448038c68
Added test.
2023-08-16 15:58:33 +02:00