Comment by SleepyMyroslav
3 months ago
A low effort question on what's C3 take on pointer provenance. Does C3 have any own take on it? Are you with C or with your implementation detail (LLVM) ?
Also if you have 'tourist guide' for gamedev people please share links or short tips. I have no idea about C replacements myself because gamedev that I know is not using C.
ps somehow in my part of the internet your blog is not accessible with cloudflare saying access denied. Do you have any copy/backup of it elsewhere?
@lerno is a ganedev himself so should be able to answer your question there
Some links
https://c3-lang.org/getting-started/
https://c3-lang.org/getting-started/design-goals/
https://c3-lang.org/faq/compare-languages/
The blog is on the internet archive https://web.archive.org/web/20250330145704/https://c3.handma...
I don't have any particularly strong stance on provenance. But I've yet to see a strong argument for it in C.
There is not much of a guide I'm afraid. I translated some of the raylib examples to C3: https://github.com/c3lang/c3c/tree/master/resources/examples...
But those are straight up conversions of the original C code.
I think any C tutorial on gamedev would work fine to follow in C3, and then one can leverage features of C3 as desired.
Judging from 'comparing pointers of different provenance' can produce 'any result' ( here https://c3-lang.org/language-rules/undefined-behaviour/#list... ) everyone has to deal with it.
More low effort questions. Question about optional debug traps: are they available in optimized builds? Are any LLVM sanitizers available? It usually means language needs to have APIs to mark up your own allocators/containers/etc.
Does language help parallel/concurrent programs to be more readable?
I think that one is a bit wrong, I must have written it many years ago. There are machines where pointers do have different address spaces, like the Arduino obviously, but that support isn't in the language yet, and maybe there might be issues there but comparing something like `int` and `float` pointers, that shouldn't be UB. I'll look at that text.
Debug traps can be kept in optimized builds, you can always do something like "-O3 --safe=yes". Right now it's not possible to set it per function or module, but that might be added if there is demand for it.
Because C3 also has contracts, the plan is to step by step increase static analysis to catch more of the contract violations at compile time.
For example:
Will error at compile time for `test(5, 2)` (first @require), or `test(5, 10)` (second @require). These will also be checked at runtime, but catching low hanging fruits a compile time will be very helpful I think.
LLVM address and thread sanitizers work. The memory sanitizer still has some issues but will be fixed.
Currently there are just cross platform threads available and some rudimentary thread pools. This needs to be expanded and we'll see if there are things the language could help with but there will not be any async built in.
2 replies →
> Question about optional debug traps
Contracts are available in safe mode, which can optionally be enabled for optimised builds as-well, yes.
> Does language help parallel/concurrent programs to be more readable?
There's active interest in working in this area, if you're interested to help you're welcome to suggest or contribute.