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.

10 of 304 comments (clear)

  1. But why? by Anonymous Coward · · Score: 4, Insightful

    Why use the new language of the month when C has been around for decades, is welll understood and does exactly what we want?

    How long before I start replacing rust with decay? 6 months? A year?

    1. Re:But why? by gweihir · · Score: 4, Informative

      We actually need to ditch people that cannot handle C. Go be a "business coder" but stay away from real programs.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:But why? by Anonymous Coward · · Score: 4, Interesting
    3. Re:But why? by geoskd · · Score: 4, Insightful

      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.

      That has to be the most ignorant thing in these comments so far, and there are some pretty stupid things in the comments above...

      Ignoring the performance of your software is just plain dumb. Web companies tend to get away with it, because they are not paying for the compute power directly, but it still annoys their users. If Google or Bing ignored the performance of the software needed to perform search, they would need vastly more hardware to keep up with demand. It is no accident that the backend of Google Search is written in C++, and that this all runs on a customized linux based OS.

      Do you have an HDMI TV? Have you noticed that it takes many 10's of seconds to turn on? That is because some dumb F^@# thought it would be a good idea to implement the interface in Java and it takes *forever* to start up. 50+ years ago, Kernigan and Ritchie came up with C because assembler was not portable. decades later, Stroustrup came up with C++, and there has not been a language since that can match the performance of either.

      When you are selling 50M of a product, and you want to put a processor that costs $0.50 more in it because you are too incompetent to write efficient code, your ass will be fired and replaced with someone who can do their job. In the mean time I hope I never have to use a product that has any of your "work" product in it.

      --
      I wish I had a good sig, but all the good ones are copyrighted
  2. The future of rustlang is tied up with Mozilla by mnooning · · Score: 5, Insightful

    I've read a third of the Rust nightly book and watched many, many Rust videos on youtube. I like Rust very much. However, I believe Rust was invented by, is sponsored by, and gets it's major funding from the Mozilla foundation. There is essentially no more Mozilla Thunderbird, and the Mozilla Firefox browser is getting significantly less usage. We've had articles on such here on Slashdot. If the Mozilla browser itself falters any more, would Mozilla, and hence rust, stay alive?

    1. Re:The future of rustlang is tied up with Mozilla by jma05 · · Score: 4, Informative

      Python and Perl would have never made it, if people filtered by that logic.

      Programming languages don't need a huge company backing them up, as long as there is enough of a community. If Rust folks are as zealous as the Ruby folks were during the Rails era, we will have a neat C++ replacement.

      I have not used Rust yet and have even been critical (as in, just add those semantics to C++ somehow and don't create a whole new replacement) of it. But the community does seem to be building momentum.

      A peek at module counts
      http://www.modulecounts.com/
      shows that the Rust community is quite active. They are not merely evangelizing it, but rapidly building value. It does not look like Mozilla is significantly driving it on the module front. It only has half the modules as Go (which is impressive for a zero-cost abstraction language compared to a language that is high level application language), but the modules seem to be accumulating at more than twice the speed now. Modules make the language.

      I wish Nim had that kind of momentum though. That is a language better aligned for my purposes.

  3. Rust and SJW Nonsense by Anonymous Coward · · Score: 4, Insightful

    I was interested in learning Rust and perhaps using it for some personal projects, but then I discovered how the community seems to care so much about social engineering.

    We're not allowed to use "Master" and "Slave". https://github.com/rust-lang/rust-buildbot/issues/2

    We're required to rephrase old texts to fit into "gender non-binary" language. https://github.com/rust-lang/rust/pull/25640

    I'm sure they don't have problems "killing child processes" though...

    etc., etc.

    I'm not interested in using a programming language as some kind of social engineering experiment.

  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. 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?

  6. Re:What happens to Rust when Mozilla is gone? by ShanghaiBill · · Score: 5, Funny

    As C has been constantly in the top 3 languages that coder positions are offered for

    But those "coder positions" are for white males only. C was designed in the 1960s, when colonialism was still rampant, and that is reflected in the language design. C ignores array bounds just as the imperial powers ignored the boundaries of tribal societies. Rust can free us from syntactic oppression, and provides "safe spaces" for everyone's data regardless of their culture or previous gender.