6 ms·
C++ -> Rust ...is correct, but C -> Rust ...is not IMHO. There needs to be a much smaller, simpler, "better C" language than Rust to replace C. Something lik
by flohofwoe 7y ago
C++ -> Rust
...is correct, but
C -> Rust
...is not IMHO. There needs to be a much smaller, simpler, "better C" language than Rust to replace C. Something like zig, or C2, even C99 almost feels like a new language.
PS: ...and I forgot the fairly obvious C -> Go :)
- dickeytk 7y agoI'm not familiar with the C-family languages, but given that Go is GC, wouldn't Rust be a better "C 2.0"?
- 292355744930110 7y agoThe creators of C/Unix are the creators of Go.
- kibwen 7y agoC/Unix is generally largely credited to Brian Kernighan, Dennis Ritchie, and Ken Thompson. Although Ken Thompson did contribute to Go, he appears to have retired early in the life of the project (I can't find any contributions of his that don't pre-date Go's 1.0 release in 2011), and credit for Go instead tends to lean toward Rob Pike and Robert Griesemer, the former of whom worked at Bell Labs, but appears to have joined in time to have more of an impact on Plan 9 than on Unix. In particular Go bears very striking resemblance to Pike's two earlier languages, Limbo and Newsqueak.
- vram22 7y ago>In particular Go bears very striking resemblance to Pike's two earlier languages, Limbo and Newsqueak. From the GoPL (The Go Programming Language book, by Donovan and Kernighan), page xii, part of the genealogy is: CSP (Hoare, 1978) -> Squeak (Cardelli & Pike, 1985) -> Newsqueak (Pike, 1989) -> Alef (Winterbottom, 1992) -> Go (Griesemer, Pike and Thompson, 2009).
- eeZah7Ux 7y agoNot at all.
- flohofwoe 7y agoI would still put Go into the "better C" language group because of its elegance and simplicity, even if it can't be used for all scenarios C can be used for (because of the GC). To me at least, Rust looks like an obvious attempt to fix C++'s problems for large scale software development, but at the cost of being a big and complex language, similar in scope to C++. "Modern C" is a much simpler and elegant language, even though there's some decades old cruft, overall it remained a lot cleaner than C++ because there hasn't been so much stuff added in the first place which would be a burden now.
- kjeetgill 7y agoI sincerely can't fathom how Go can be considered a "better C". It's like comparing cars to sheet metal (or some better analogy). Go is fundamentally incompatible in most contexts C would be your go-to. A moderately heavy runtime with both a scheduler and a GC unable to compile down to a ".so"? C++ and Rust can both do those things readily. Languages aren't just syntax/semantics, they're ecosystems within ecosystems. They fill niches with particular their capabilities. A more appropriate comparison is Go to Java. Distict approaches to "half batteries included" robust application and service development.
- apta 7y ago> A more appropriate comparison is Go to Java. Not even. Golang lacks the expressiveness and vast standard library in Java (e.g. nothing even close to what java.util.concurrent has), not to mention the very diverse ecosystem, tunable high performance GCs, and management capabilities of the JVM.
- e12e 7y agoThere's always "D as better C".
- kevin_thibedeau 7y agoParticularly D's stripped down "better C" mode.
- vram22 7y agoRight. For anyone who wants to get a feel for D: https://dlang.org/ https://dlang.org/ is the main site. https://tour.dlang.org/ https://tour.dlang.org/ is the D tour site, similar to the one for Go and some other languages nowadays; you can run some D example programs right from the site, without installing the language on your machine. On my blog, I have a handful (12-13) of exploratory D programming posts, that may also be of interest. They explore various basic but interesting features of D via some simple D command-line programs: https://jugad2.blogspot.com/search/label/DLang https://jugad2.blogspot.com/search/label/DLang
- pcwalton 7y agoI'm not convinced you can be much simpler than Rust while maintaining memory safety without GC (including reference counting) while still having standard heap allocation and deallocation. If you throw out memory safety, then sure, you can be simpler.
- AndyKelley 7y agoI'm looking forward to exploring this space in the next 1-2 release cycles of Zig. I have some ideas that will make debug and release-safe builds of zig code actually safe with regards to use-after-free and related memory issues. The programmer will still be required to adhere to C-like manual memory semantics, with the difference being the language runtime catches safety mistakes. And then of course in bottlenecks the safety checks can be omitted. If I accomplish my goal, the difference between safety/performance trade-off of Rust and Zig will be that Rust's release mode is both safe and fast, whereas Zig code has the simplicity but the programmer has to choose between performance and safety per scope.
- wuschel 7y agoDid anyone have experiences with ATS lang [1] as C replacement? [1] http://www.ats-lang.org/ http://www.ats-lang.org/
- svnpenn 7y agoI like Zig, but it doesnt even have a HTTP client yet: https://github.com/ziglang/zig/issues/2007 https://github.com/ziglang/zig/issues/2007 granted neither does C, but C has cURL, and Zig doesnt (and wont) have cURL binding: https://github.com/ziglang/zig/issues/2056 https://github.com/ziglang/zig/issues/2056
- AndyKelley 7y agoThis is a misrepresentation of the facts. Zig can use libcurl just as much as C can. Unlike other languages, zig does not need bindings to use C libraries. It's one of the main features. The issue you linked is saying tht zig standard library will not introduce a dependency on libcurl.
- svnpenn 7y agoAndy, you are a really smart and talented person but surely you know the difference between FFI and binding? They are not the same thing, and Zig doesnt (and wont, according to you) have cURL binding.
- haolez 7y agoC -> Zig