4 ms·
But `jv` is written in C. It requires that the programmer adhere to a convention, and that is probably what you mean by "too weak" -- and I would agree with th
by cryptonector 7y ago
But `jv` is written in C. It requires that the programmer adhere to a convention, and that is probably what you mean by "too weak" -- and I would agree with that if that is what you mean.
- kccqzy 7y agoConvention: every malloc() may result in NULL and programs should check for it Result: many programs forgot Convention: every non-NULL pointer returned by malloc() should be passed to free() at most once Result: programs free()'d these pointers twice Convention: programs should only write to memory addresses [p, p+s) if p is a non-NULL pointer returned by malloc(s), and before calling free(p) Result: many programs wrote beyond p+s, or wrote to the memory after calling free() Remind me again, what's a convention?
- cryptonector 7y agoAll APIs have conventions though, and jv's is quite simple. It's very difficult to get it wrong and not crash immediately, though it's easy enough to get it wrong and leak. Having (unfortunately) had to use C a lot, I must say that the jv API is among the nicest I've had the pleasure of using. Sure, it's not Rust, but neither is C++, and yet that's the topic of this thread. But I'd use a jv-like API in C++, and I think that would be peachy.