4 ms·
The people who are in for the fun won't use the typescript model for long either. If it's optional it will be omitted in the hard parts, for instance if your f
by croes 3y ago
The people who are in for the fun won't use the typescript model for long either.
If it's optional it will be omitted in the hard parts, for instance if your favorite library doesn't support it.
- DangitBobby 3y agoIt's still worthwhile even if you have to fudge module boundaries or skip the hard parts. Kind of like having "safe" Rust wrapping "unsafe" C boundaries doesn't make the rest of Rust not worth it. Lying about the type internals of your function is still preferable to the wild-wild west of JS.
- deleted 3y ago[deleted]
- solarkraft 3y agoThat's why incremental adoptability is so powerful. Slightly ironically that's exactly what (AFAIK) made C++ so popular: You can start using it without really giving up anything. And ideally once you see the benefits you'll be hooked and want to (incrementally) use it more and more throughout your code.
- pjmlp 3y agoAnd exactly what makes C++ codebases so hard to clean up from C idioms, as many developers to this day apparently never went beyond changing the file extension, regardless of how many security advocacy we keep telling them.
- Aeolos 3y agoC++ adds so many additional security footguns over C, that I find this line of reasoning hard to accept. The problem with C++ is not that people are using C constructs with it, the problem is that the language design itself is deficient. Are you aware of any systematic review that shows evidence that C++ is safer than C? The rate of safety defects between major C and C++ projects appears similar at first glance, and both way worse than managed languages or rust.
- cylemons 3y ago> The rate of safety defects between major C and C++ projects appears similar at first glance How come? Surely there would be fewer memory leaks in a code base with proper RAII than in C code with malloc and free all over the place.
- Aeolos 3y agoYes, this is a common theory, but I don’t see evidence for it in the hard numbers. Taking two of the most popular projects in each language, with a comparable LOC count, the numbers look surprisingly similar year over year: Linux kernel (C): https://www.cvedetails.com/product/47/Linux-Linux-Kernel.html?vendor_id=33 https://www.cvedetails.com/product/47/Linux-Linux-Kernel.htm... Chrome (C++): https://www.cvedetails.com/product/15031/Google-Chrome.html?vendor_id=1224 https://www.cvedetails.com/product/15031/Google-Chrome.html?... There’s some variability year over year, but if anything C appears to have a slight advantage over C++ in terms of memory corruption (840 vs 1004), with essentially the same number of overflow errors (322 vs 328). There is no comparable rust project, but initial evidence from the asahi gpu drivers hints that memory corruption errors are fundamentally eliminated. This is obviously not accounting for confounding factors, hence my request for any peer reviewed evidence for the security claim. Until then, the facts don’t seem to be supporting it.
- vanviegen 3y agoAre you seriously putting the Linux kernel forward as a typical C code base? Isn't that a bit like selecting the example of an F1 car to show that cars are usually at least as fast as motor cycles?
- Aeolos 3y agoNeither Chrome nor Linux are “typical” programs for their respective languages, but they are real examples used by hundreds of millions of people. Feel free to provide evidence for other cross-comparable c & c++ codebases if you have.
- cylemons 3y agoBut you can't deny that C++ is a straight upgrade to C. If CppFront becomes this straight upgrade to C++, isn't that a good thing?