Hi,
I stumbled on the Microsoft opensource (MIT) "Checked C" project, has anyone tried using this safer c compiler (based on clang/llvm) as NIM compiler? I guess being able to use "Checked C" with NIM would build an even stronger case for NIM as a safe programming language.
You must understand what it's about and how it works. If you just use it like a normal C compiler, it will behave like that (specifically like clang) which isn't particularly useful and adds nothing in terms of safety/correctness.
For that you must "annotate" the C code, in particular arrays and pointers by using checkedc's own types. Only then your code gets checked.
My opinion, based on quite a bit of using it: I like it a lot for what it does, BUT
In summary I would not push its use for Nim, but it's useful as a (semi-automizeable) way to "quickly" (well, kind of) do some specific pointer related checking of some C code body.
Here is a real world example excerpt taken from some of my C code (with anonymized function and var names) so you can see how it looks like:
#include <stdchecked.h>
//...
typedef struct {
uint32_t P checked[128];
uint32_t Q checked[128];
} FOO_State;
//...
uint32_t * FooOneRound(const _Ptr <FOO_State> state) : itype(_Array_ptr<uint32_t>) count(16)
(Hint: Note the functions expressly checked return pointer)