4 ms·
I don't expect it to get traction. • C is valued for being super portable and compatible with every platform, including legacy ones, but this applies to specif
by pornel 6y ago
I don't expect it to get traction.
• C is valued for being super portable and compatible with every platform, including legacy ones, but this applies to specifically C89 or C90, and nothing else. As soon as you embrace new features, it's not your universal C any more. You're going to need newer compilers, new tooling, and that's almost like starting with a new language.
• C users have mostly self-selected themselves to like C the way it is: a small, flexible, zero-overhead language that isn't C++. Addition of checked containers, generics, and restrictions on pointer arithmetic, etc. make checked C not feel like C any more.
• Checked C still needs refactoring of the code. For large established codebases this is still a lot of work, and still a risk of introducing new bugs. It's very tempting to settle on just running one more analyzer, sanitizer or fuzzer instead.
And in the end with all this effort, back-compat break, whole-codebase refactoring you're still left with the old C, with headers and include paths, sloppy macros, ancient stdlib, painful dependency management, etc.
If you're going to rewrite C incrementally to a more complex dialect, and require a newer non-standard compiler for it, you may as well run c2rust on it first.
- Blikkentrekker 6y ago> [...] a small, flexible [...] I do not see what would make C more flexible than any other language. The other points are correct and C's niche is indeed that it is small, ubiquitous, simple, and yet low level.
- cwfowler 6y agoNon-standard is one of the biggest drawbacks of Rust. If there were a standard and independent Rust equivalents of gcc, clang, icc and Visual C, then the decision to try out Rust would be easier. One reference implementation is a lock-in, not only technologically, but also socially in terms of a community that is too monolithic for its own good.
- bitexploder 6y agoWhat an interesting take. Go, Python, Ruby and countless other languages only have one implementation and real community. I don’t think this is a real concern for most developers. As long as the language solves their problems and is well maintained with a community that trusts the language maintainers.
- aleksi 6y ago> Go, Python, Ruby and countless other languages only have one implementation That's not true for all those examples: both Ruby and Python have several great implementations and Go started with specification and two implementations.
- bitexploder 6y agoThis is splitting hairs a bit, but, those languages only really have one implementation that dictates where things are going as far as the language is concerned. C is special because of when it started and what it was trying to solve in its day. My point was just that the communities and languages are every bit as monolithic as Rust, so why was Rust singled out?
- cpuguy83 6y agoThat's not true of those other languages. While the alternative implementations are always playing catch-up as it relates to language changes, the developers of those implementations do participate in the discussion around those changes.
- stjohnswarts 6y agoI think we can go with the 90% rule here. I would bet that at least 90% of Python users are using cpython.
- adamdusty 6y agoPython has at least 3 relatively popular implementations that I know of.
- grok22 6y agoJust read that the remobjects folks' elements compiler platform can also compile go...go figure! https://elementscompiler.com/elements/gold/ https://elementscompiler.com/elements/gold/
- elteto 6y agoI would say give it time, you can't measure Rust with this yardstick (yet), Rust is a baby in terms of age. Let's not forget that C is ~50 years old and yet having reliable, open-source, high-quality compilers is a thing of the past 20 years or so. Clang was born in the 2000's, GCC is much older but it wasn't that great of a compiler for some time. Same with VS.
- fiddlerwoaroof 6y agoAs far as I know, though, C has had multiple implementations for years: IBM has its own compiler, Sun had one, Borland and all sorts of other vendors had one. It seems to me that C comes from an era where languages were standardized and multiple vendors provided their own implementations: Common Lisp, Ada, Fortran, even a relatively obscure language like Eiffel all fit this criteria.
- moocowtruck 6y agoyep multiple implementations and glorious code work around for each one of them! ahh those were the days
- elteto 6y agoThis might be an overly rosy view of history :) prior to 89 C wasn’t even standardized, and C++ was a mess until 98. And those are just the years that the standards came up. It took time for existing compilers to catch up.
- fiddlerwoaroof 6y agoI’m somewhat familiar with this: I write a lot of Common Lisp and try to stick to the portable features (standard + compatibility libraries). So, I occasionally find issues with particular implementations.
- snarfy 6y agoIt hasn't been a problem for Go. Having multiple implementations didn't seem to help D either. It might be a lock-in but fragmentation is bad too.
- supercheetah 6y agoFor what it's with, this is being worked on[1]. 1. https://github.com/Rust-GCC/gccrs https://github.com/Rust-GCC/gccrs
- stjohnswarts 6y agoOne of rust's strength is the solid structure. We saw what happened with c and c++, no one is forcing other individuals from forming their own coalition and forking rust. It's a young language, the last thing we need is fragmentation.
- deleted 6y ago[deleted]
- baybal2 6y agoI believe it is Microsoft trying the same trick as with their TypeScript thing. An unsuccessful attempt at embrace, extend, extinguish. If they just needed type checking, it could've been done with either tests, or annotation for checks at compile time, but instead they've developed a whole new language that gets more, and more diverged from the original one with each release.
- zild3d 6y agoWhat is the trick that you're saying Microsoft is doing with TypeScript? Also "TypeScript thing" is definitely downplaying where TS is as a language https://2020.stateofjs.com/en-US/technologies/javascript-flavors/#javascript_flavors_experience_ranking https://2020.stateofjs.com/en-US/technologies/javascript-fla...
- pjmlp 6y agoThe goal of these kind of projects is to eventually be integrated into ISO C, if enough people at the committee get interested.
- stjohnswarts 6y agoI don't know why people who want a smaller language don't cut out some of the more disastrous portions of C with more modern c++ equivalents that really aren't all that much more complicated if you consider that you usually end up using complicated macros anyway. Something like Misra C++. There are obviously others. Embedded compilers have gotten a lot better at c++ over time as well.
- pjmlp 6y agoBecause of politics. Many of the people that keep using C as is, will never use something else no matter what.
- tgv 6y agoAbout your first point: the code looks like it will be standard C when you strip the checked parts. So won't this offer a way to develop plain C, but with some guards? And indeed, it's probably not suitable for refactoring, but if you want to start a driver from scratch?
- stjohnswarts 6y agoIt looks reasonable to me as well, I think it could be quite promising for embedded programming on small IOT devices. I prefer a cut down c++ but that isn't always available.
- coliveira 6y agoMany people will not move from C to Rust because Rust is non-standard, doesn't have multiple implementations and multi-platform support at the level of C. The C language, despite its shortcomings, is at another level compared to other languages and it will take decades to make this comparison even possible.