I've been implementing some of the programming language shootout tasks... here is mandelbrot:
C3 got string (actually slice) matching. This outputs
This works This works too Winning!
So this experimental stuff works now with this output:
Hex array: Open the pod bay doors Base64 array: Open the pod bay doors Multi line: Say hello, to my little friend... Raw string: C:\foo\raw.dll
The whole new
try stuff is added to C3 now, and I enhanced it a little:
A contributor made raylib bindings for C3: 🥳
First version of user defined foreach works, this prints
1 3 10
Mixing C and C3 code, running vkQuake: https://github.com/c3lang/vkQuake
Thanks to the hard work by the contributor kvk1920 C3C is now up and running on Windows under Mingw and MSYS2 with CI! 🥳
I had to do ad hoc lexing for feature, but I'll end up reusing it for a lot of other compile time functions later on:
test_param(11, 10); gives:
Assert violation 'Invalid input' on line 159, in file 'debugstuff.c3'.
156: 157: /** 158: * @param x - one parameter 159: * @param y - other parameter ^ (debugstuff.c3:159) Error: There is no parameter 'y', did you misspell it?
Getting more environment info available from inside of programs now.
So this now works, with an output of:
Repeat 1 Repeat 2 Repeat 3 Repeat 4 Repeat 5 Repeat 6 Repeat 7 Repeat 8 Repeat 9 Repeat 10 111 121 4 77
I added this for enums, it's sometimes useful (printing
Min -5 Max 14 Elements: 3)
C3 got a new style for casts:
Finally some generic module code up and running. Defining some parameterized functions and types.
Those cursed gradients are working again for text rendering:
Sum integers using recursion, slices and typed varargs... 😅 (call using
sum_us(1, 3, 5, 11))
Ok so this works now, but it's using alloca to copy the slice. I don't know how I feel about that. In safe mode you'll get a panic if you exceed MAX_PARAMS, but currently not in non-safe. I might mask this though.
Typed varargs in C3:
A goddarn miracle, C3 is using built in linking on Linux
Piecemeal adding some welcome library functionality while checking how the macros/function namespacing looks in the wild (not perfect yet):
Took a little while but constant aggregates are now spliced in a fairly efficient format from what I can see. This one would take gigabytes of memory to describe for Clang:
More and more debug info getting done in the C3 backend: