Announcement

Collapse
No announcement yet.

Google Begins Allowing Rust Code For Developing Android

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ssokolow
    replied
    Michael, my post has been unapproved since yesterday.

    Leave a comment:


  • bug77
    replied
    Originally posted by dc_coder_84 View Post
    Wonder about Swift when they add an ownership model in the near future?
    What does that bring to the table on top of Rust?
    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.

    Leave a comment:


  • dc_coder_84
    replied
    Originally posted by paulpach View Post
    Love it or hate it, I don't know any other language that can really serve as a memory-safe replacement for C.
    Wonder about Swift when they add an ownership model in the near future?

    Leave a comment:


  • zxy_thf
    replied
    Originally posted by kpedersen View Post

    C++ done right is pretty close. They should start with that.
    C++, or any OOP language can't 100% replace C without doing tricky things.
    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.

    Leave a comment:


  • uid313
    replied
    Originally posted by 60Hz View Post
    Rust is an absolutely terrible language and an even worse toolchain.
    Why do you think that Rust is a terrible language?

    Leave a comment:


  • 60Hz
    replied
    Rust is an absolutely terrible language and an even worse toolchain.

    Leave a comment:


  • 60Hz
    replied
    Originally posted by uid313 View Post
    I 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.
    According to the lugenpresse, like (((BBC))), (((The Guardian))), (((CNN))), ((((((BuzzFeed)))))), etc.

    Leave a comment:


  • jabl
    replied
    Originally posted by microcode View Post
    I'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.
    Back when Ada was designed in the late 1970'ies / early 1980'ies, C wasn't nearly as dominant as it was later to become. And AFAIU Pascal was a fairly common choice to teach students how to program, so at the time a Pascal-inspired syntax was a reasonable choice.

    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.

    Leave a comment:


  • jabl
    replied
    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)
    Ah, ye olde No True Scotsman. Nobody is claiming that by writing code in Rust you're somehow magically fixing the mountain of existing code (mostly C and C++) your code stands on (like the OS and, heck, the Rust compiler itself sits on top of LLVM which is C++). But at least you can make your own code safer and better by using appropriate tools like, in some situations, Rust.

    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.

    Leave a comment:


  • microcode
    replied
    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)
    Aside from the syscall interface, does it matter whether the "platform" is using the C conventions or not? There are lots of rust libraries, and rust programs can call into C libraries entirely at will. There's a project called remacs, where people are incrementally rewriting Emacs in Rust, it's not that hard to mix the two.

    Leave a comment:

Working...
X