Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by DubiousPusher on Sunday October 14, 2018 @07:14PM
(#18216136)
Case in point, any interface heavy C codebase. Function after function of laying out function pointer vtables.
[ Parent
| on HN ]
Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by the_clarence on Sunday October 14, 2018 @07:35PM
(#18216262)
Or not having a good std crypto library: a million of shitty libraries
Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by simias on Monday October 15, 2018 @04:12AM
(#18218174)
I don't think that's a very good example, there aren't that many "production grade" crypto libraries out there. I think the root of the problem is that C simply lacks the features necessary to write safe code, it sometimes feel like the language is actively trying to trip you up instead of having your back (implicit casts, weird aliasing rules, lack of generics and in particular "safe" containers like C++'s std::vector, completely implicit ownership semantics etc...). This makes is very difficult to interface crypto code nicely and safely using a pure C API.
That's not to say that C crypto libraries don't suck for other reasons (I've used OpenSSL, I can't really defend that) but the language itself limits what you can do, in the standard library or otherwise. I mean, look at the many flawed or error-prone interfaces in the C standard library itself, I don't think stdcrypto.h would be the panacea.
Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by jstimpfle on Sunday October 14, 2018 @10:21PM
(#18216988)
Out of curiosity, what would be an example programming domain with a lot of interfaces?
Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by xfer on Sunday October 14, 2018 @10:56PM
(#18217108)
gobject library? Gtk uses this, which tries to emulate OOP.
Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by DubiousPusher on Monday October 15, 2018 @02:35AM
(#18217825)
You mean programming domain in general or a codebase in C?
There's a ton in Java, C++ and C#. One example in C is the proton implementation of AMQP.