Slashdot Mirror


How Rust Can Replace C In Python Libraries (infoworld.com)

An anonymous reader quotes InfoWorld: Proponents of Rust, the language engineered by Mozilla to give developers both speed and memory safety, are stumping for the language as a long-term replacement for C and C++. But replacing software written in these languages can be a difficult, long-term project. One place where Rust could supplant C in the short term is in the traditionally C libraries used in other languages... [A] new spate of projects are making it easier to develop Rust libraries with convenient bindings to Python -- and to deploy Python packages that have Rust binaries.
The article specifically highlights these four new projects:
  • Rust-CPython - a set of bindings in Rust for the CPython runtime
  • PyO3 - a basic way to write Rust software with bindings to Python in both directions.
  • Snaek - lets developers create Rust libraries that are loaded dynamically into Python as needed, but don't rely on being linked statically against Python's runtime.
  • Cookiecutter PyPackage Rust Cross-Platform Publish - simplifies the process of bundling Rust binaries with a Python library.

8 of 304 comments (clear)

  1. Re:But why? by squiggleslash · · Score: 2, Interesting

    Because C is awful? It always was pretty bad but we used it because when you're trying to manually render a 16 color 2.5D image on a bitplaned VGA screen using a 6MHz 80286 then you pretty much have to forget array bounds checking, be willing to assume endianess, and have an easy way to translate integers into pointers.

    These days there's pretty much no reason to do any of this, which means that the only times you're going to do it is by accident. ie when you put a bug in your application.

    We need to ditch C.

    --
    You are not alone. This is not normal. None of this is normal.
  2. Why does Rust's community lack diversity? by Anonymous Coward · · Score: 3, Interesting

    What I don't get is why the Rust community lacks diversity, despite them putting so much emphasis on supposedly supporting diversity.

    Years ago, back when I was a Java developer, I would sometimes go to Java conferences. There would be men there. There would be women there. There were probably transsexuals there. There would be old adults and young adults. There would be people representing every possible skin color. There would be somebody from pretty much every major ethnicity. There would be practitioners of pretty much every major religion. There was true diversity, without anyone actually trying to impose it through Codes of Conducts and Moderation Teams and "initiatives" and "affirmative action".

    Yet here we have Rust, with its invasive Code of Conduct, and the Rust Moderation Team to force it on the community, and all of its focus on "diversity" and "social justice". But when we look at the profile pictures of Rust's contributors, they appear to mostly be mid-20s white males (I'm assuming "steveklabnik" is a male).

    Now don't get me wrong, there's nothing wrong with being a mid-20s white male programmer. This isn't about singling anyone out, or about claiming that some mythical "privilege" exists, or anything like that.

    The issue here is that it appears that the more that the Rust community intentionally pushes for "diversity", the less of that we actually see. Instead of seeing a naturally diverse community form on its own, like pretty much every other programming language has, we've seen Rust's community become extremely homogeneous.

    It's as if the Rust community's efforts to force diversity on their community has actually had the complete opposite effect! While trying to create the most diverse community, they've actually only managed to create the least diverse one I've ever seen!

  3. Re:But why? by slashdice · · Score: 3, Interesting

    I can (and sometimes do) compile C code that was written in the 80s or 90s. And it often works with little or no modifications. (And there are people running awk scripts from the 70s, calling me a whippersnapper). With something like rust or go or swift, your code will not compile in 6 months. (which is hilarious in the case of go because it's more 70s than Disco)

    --
    Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
  4. By now the propaganda alone is reason to stay away by gweihir · · Score: 4, Interesting

    Something that gets this much hype cannot be good, or the hype would not be needed. Seems to me some cretins are using Rust as a religion-surrogate.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  5. Re:But why? by Anonymous Coward · · Score: 4, Interesting
  6. Rust: an example of Autism-Driven Development? by Anonymous Coward · · Score: 4, Interesting

    I don't intend this to be taken as a joke in any way, nor do I intend it to be unnecessarily mean, but I think that the Rust community inadvertently discovered a new paradigm of software development: Autism-Driven Development.

    When we look at what they've created, both from a technological standpoint and from a community standpoint, I can't help but notice the impact that Asperger Syndrome may have had on how things have developed.

    Let's start with the community. While the communities of languages like Perl, C++, Python, Java and C# developed organically over time, it is almost as if the Rust community has been manufactured instead. It's like the community's interactions have been scripted, to use a programming analogy. It seems to me that the Rust Code of Conduct may actually be there as a way to allow people who suffer from varying degrees of social ineptitude to interact in a way that mimics how they see other, naturally-formed programming language communities made of sociable individuals interacting. They wouldn't be able to manage this social interaction on their own. But if you give them a script or a checklist they can follow, they can at least engage in something that appears, on the surface, to be socializing. That's why I think their incorporation of social justice is quite interesting. In many ways the concepts of social justice are all about imposing a foreign order on what is naturally a very chaotic and perhaps unfair reality.

    The language and its standard library also reflect behavior that may be expected from those suffering from Asperger Syndrome. While creating the language, it is as if its developers haven't been able to make the normal trade-offs that other language developers have made with ease. We've seen this result in Rust, as a language, constantly change over time. It's like they're striving for some unattainable form of perfection that most normal people would realize could not be attained. While other people would accept some drawbacks to their creation and move on, the Rust community appears to waver back and forth, unable to really make up its mind about how to proceed. Even the supposedly stable Rust 1.x release branch has seen 19 minor releases!

    I think the complexity of the language also reflects the role that, I suspect, Asperger Syndrome has had on the development of Rust. It has become an immensely complex and convoluted language, even compared to a rather complex language like C++. It's like the language has been designed, perhaps unintentionally, to be cryptic and unwelcoming to normal people. By its very nature it is like it is trying to be self-isolating, to avoid having to interact with the world and the people around it. Programming languages like Java, Python, C++, Perl and PHP want to be used by normal people. Those languages evolved in ways that draw in new users. But Rust? It has evolved to become very difficult and awkward to use, especially for new, average users.

    From what I can see, the entire Rust ecosystem exhibits the traits that have come to be associated with Asperger Syndrome, or autism in general. Rust has a certain natural awkwardness to it; a inherent difference from every other programming language and programming language community that exists. It's like it wants to fit in, yet no matter how hard it tries it just can't. It's like, in my opinion, the entire Rust ecosystem lacks a natural understanding or ease of existence that other programming language ecosystems develop naturally.

    I am just speculating here, as I do not know any of the Rust developers on any personal level, but could it be that mild/moderate autism or some degree of Asperger Syndrome has influenced how the Rust programming language has developed? If the developers of a programming language exhibit autism or Asperger Syndrome, could they in turn pass this on, so to speak, to a programming language and a related community that they have created? Could Rust be an example of, for lack of a better term, Autism-Driven Development?

  7. Julia! by Anonymous Coward · · Score: 2, Interesting

    I make money doing embedded C. If I am going to replace C with something else it will be Julia. I get the speed of C, the coding efficiency of Python and real support for computational algorithms.

  8. Re:But why? by geoskd · · Score: 2, Interesting

    Let them use Rust. Switch them to C++ for the real work.

    Unfortunately, these interpreted languages tend to ruin programmers. Most (not all, but most) of the programmer I have met who were taught using a "modern" language like python, Go, Rust, Eiffel, etc... just don't amount to much. When they do eventually find they can no longer ignore the performance implications of their code, they are woefully unprepared to deal with C or C++. They consider the error messages cryptic and arcane, and they try their almighty best to use C and C++ the way they have used these other languages. The result is code that is slow bloated and buggy as hell.

    Programmers need to face the memory management demons early in their education. The longer they wait, the less comfortable they will be tackling pointers and all of their implications when the time comes.

    --
    I wish I had a good sig, but all the good ones are copyrighted