Re: POSIX.1 vs POSIX.2
You can provide C header files without implementing the functionality in C.
12 publicly visible posts • joined 18 Feb 2021
There doesn’t need to be. C2Rust already does translation of actual .c files to Rust, and rust-bindgen translates header files to Rust (i.e. for calling the functions declared in that header file from Rust).
I have no idea why people would want to use an LLM for this when people have been doing it fine without one. Neither language is all that simple when you get into the details and I would be very surprised if an LLM could reliably turn one into the other.
To some extent that already exists - the fsanitize options in Clang and GCC can add a significant amount of runtime error detection. The problem is a) the performance cost is not trivial and b) having code crash under the sanitizer is substantially less appealing than detecting problems at compile time.
You can estimate probabilities for almost any future event - it's not nonsense to provide that probability, regardless of the resolution. 67% is a mid-range probability, i.e. a fairly vague statement that it's more likely to be raining than not at 14:00 next week. I would be more concerned if they predicted a more extreme probability or gave a definite start time for the rain, both of which do imply more certainty than the models provide.
It’s not actually mandatory - if you would prefer to do a particular bit of array indexing without the bounds check in Rust (presumably because you already know you are within bounds and are in a performance-critical bit of the code), you can. Also, if you iterate over the array, the bounds check only happens once at the top of the loop, same as the “i < n” check in a C for loop. It’s really not an unreasonable approach.
Parsing things is often less trivial than you would hope. If you wrote your ten-line parser off the top of your head, would it parse “192.168.510” correctly? Is it a good use of your time, and thousands of other developers’ time, to find, read, and implement the same specification correctly? What are the consequences if there are hundreds of differently half-baked implementations in the wild? I’m not suggesting that parsing IP addresses is hard but there is a reason libraries exist.