Announcement
Collapse
No announcement yet.
Google Begins Allowing Rust Code For Developing Android
Collapse
X
-
Originally posted by dc_coder_84 View PostWonder about Swift when they add an ownership model in the near future?
Last I checked, Swift syntax was pretty much a clone of Kotlin. Which isn't the most legible syntax (at least to my eyes).
Edit: Just to be clear, Rust doesn't win any points for being easy on the eyes either. And neither did C or C++ before that. In fact, Rust is a strange beast. It can be as easy to read as Python, but it can look like a nightmare if you start inserting lifetime annotation gymnastics in there.Last edited by bug77; 08 April 2021, 10:36 AM.
- Likes 1
Leave a comment:
-
Originally posted by paulpach View PostLove it or hate it, I don't know any other language that can really serve as a memory-safe replacement for C.
- Likes 1
Leave a comment:
-
Originally posted by kpedersen View Post
C++ done right is pretty close. They should start with that.
In C, the interfaces (functions) and the data members (structs) are naturally separated, but in OOP they were bonded together for some reason.
Rust introduced the traits system to fully reproduce this aspect of C.
- Likes 3
Leave a comment:
-
Rust is an absolutely terrible language and an even worse toolchain.
- Likes 3
Leave a comment:
-
Originally posted by uid313 View PostI hope they write all parsers and decoders in this code. Such as Exif, ID3, etc. Saudi Arabia hacked Jeff Bezos by sending a specially crafted video file on WhatsApp.
- Likes 1
Leave a comment:
-
Originally posted by microcode View PostI'll add that Ada was also more different from C than it really needed to be, through a mix of accident and intent, and its capture by tools vendors who only had a foothold in their niche was the death knell. Microsoft was able to make Visual Basic a resounding success despite being a single source because they already had a massive captive audience; random Ada toolchain vendors were in no such position, but they acted like they were.
But yeah, the Ada vendors almost exclusively focusing on the military-industrial complex with their bloated cost-plus contracts meant that Ada completely missed the personal computer revolution. Which later proved to be a fatal mistake, dooming Ada to near irrelevance.
- Likes 1
Leave a comment:
-
Originally posted by kpedersen View Post
Rust basically requires a C++ compiler to prepare the *-sys packages and bindings. So you can never have C++ *or* Rust. If Rust is involved, it will always be C++ *and* Rust.
Sounds a bit of a weak reason I know but until a 99%+ Rust native OS like Redox becomes mainstream you can't get away from ANSI C. And it just so happens that C++ consumes C headers better than Rust's FFI bindings ever can.
C isn't just a language. It is the entire computing platform. C++ is (mostly) and extension of that. So making C++ as good as it can be is currently the best way to directly access the computing platform.
(Unless Rust's unsafe {} system can be made to consume C headers directly by invoking a tiny inbuilt C compiler)
And yes, there's a difference between C the language and C the lowest common denominator ubiquitous platform ABI (I think VMS is one of the rare exceptions with a language-independent platform ABI, but of course that's mostly irrelevant nowadays).
Rust doesn't itself consume C headers, but there are projects like bindgen that can automagically produce Rust bindings for C (and some limited C++ subset) libraries (bindgen uses libclang, so it has a "real" C/C++ parser). Is it as convenient as using C or C++ directly? Obviously not, and there are certainly many cases where C or C++ is the better choice, but OTOH you gain a much better language to make up for the trouble and in many other cases that might well be worth it.
- Likes 6
Leave a comment:
-
Originally posted by kpedersen View Post
Rust basically requires a C++ compiler to prepare the *-sys packages and bindings. So you can never have C++ *or* Rust. If Rust is involved, it will always be C++ *and* Rust.
Sounds a bit of a weak reason I know but until a 99%+ Rust native OS like Redox becomes mainstream you can't get away from ANSI C. And it just so happens that C++ consumes C headers better than Rust's FFI bindings ever can.
C isn't just a language. It is the entire computing platform. C++ is (mostly) and extension of that. So making C++ as good as it can be is currently the best way to directly access the computing platform.
(Unless Rust's unsafe {} system can be made to consume C headers directly by invoking a tiny inbuilt C compiler)
- Likes 5
Leave a comment:
Leave a comment: