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:
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.
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?
And wake me up when Rust stop being a cult and becomes an actually useful language.
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?
Rust is very tied to Mozilla. And Mozilla's only remaining "successful" product is Firefox. But Firefox's market share is dropping. It was only a few percent, last I saw, while Chrome is over 50%. Mozilla reportedly gets a lot of funding from Yahoo, due to a Firefox search deal. So here we have an organization with one major product, but this project is being rejected by consumers, and what might be this organization's most significant source of revenue comes from this failing product and is paid for by another company that isn't doing so well. I fear for Mozilla's future if, say, the Yahoo deal wasn't renewed and they couldn't find a replacement.
If Mozilla goes the way of the dodo bird, then I can't see the Rust project really going anywhere. I don't think it has a robust independent community like C++ has, for example.
I think it is too risky to adopt Rust, especially for important long term projects. The tech industry moves fast. Rust could plausibly be gone in 3 years, while languages like C, C++ and even PHP are far more likely to be going strong.
For example Py-CRust.
Some drink at the fountain of knowledge. Others just gargle.
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.
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!
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.
So what does your excellency suggest that is used instead?
Chrome? Oh yes and pass every detail of what you are doing to Google to use in Adverts to you
Edge? Ditto but for Microsoft.
Safari? Well only for Macs.
Opera? Is that still around?
I use Firefox ESR with a classic theme. Hot seen any changes to it for years.
not forgetting UBlock Origin and noScript. Makes the internet actually usable.
No adverts. Deep joy.
Being able to represent the sort of thing you'd use C or C++ for as a data structure within Python, and then turn into binary via LLVM is something I've been wishing for for a long time. I imagine I'll need to keep wishing for a while longer, but things like numba (in python), and application of LLVM like LLVMPipe, and the Synthesis OS project from a few years back suggest the pieces for doing this are gradually appearing.
John_Chalisque
.. when Linus decides the next major release is to be written in Rust.
... :)
Or for argument's sake, Mozilla itself.
Every language has it pitfalls, at least with ye olde C/C++ I know where to look and what to expect.
Suddenly you start to respect and embrace the get-off-my-lawn attitude, you simply want things to work rather than be written in the next greatest language of the moment.
I think I'm ready to deal with my dad now
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?
They're really enthusiastic, mention that they think it's great at every opportunity, and can't understand when someone is underwhelmed by the object of their admiration....
There is no God, and Dirac is his prophet.
+1 for making me laugh :) Satire at its best
Most C libraries in Python exist in order to interface with existing APIs, also written in C. Adding Rust to the mix merely complicates things without any significant improvement in runtime safety.
Rust can go and, well, rust. If you want to get safer C, than add Cyclone support to gcc and use that. No rewrites, no learning a new language, no hitching your project to a SJW converged organization that is slowly dying, no fanboys who pathetically spam puff pieces on Slashdot... Seriously, Cyclone or any of the other safe-C alternatives are better and less intrusive than a Rust rewrite.
Hydraulic pizza oven!! Guided missile! Herring sandwich! Styrofoam! Jayne Mansfield! Aluminum siding! Borax!
Jeez.
I wonder what would happen if brilliant and smooth-talking developers like Linus Torvalds or Theo de Raadt joined the rust community.
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.
fuckface.
Well,
C++ might be a bit ugly when it comes to templates, but for that you have typedef.
Nothing against Rust, it looks like a decent enough language (exept for the name, looks like the inventors like to repeat the subvers-ive/ion failure).
Anyway: why would one replace C with Rust instead of C++ is beyond me.
If you write new code, then I would probably agree, but for existing old code I see no justification.
I wonder if there is a Rust to JVM compiler ... googeling a bit ...
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Why do you call the once a year mentioning of Rust a Hype? /.
Typical american?
You know something, which most people don't know, you get news about it "again" and then you call it a hype?
I would assume that 90% or more "developers" or "programmers" never ever have heard about Rust.
I only know Rust because it is occasionally mentioned on
This "hype scare" is a quite strange thing for us europeans.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
When people whine about how the stories aren't techy enough, thye get modded up. But apparently people who whine when stories realy are only for nerds (along with some gratuitous homophobic slurs) also get modded up.
Seems like some people will never be happy.
SJW n. One who posts facts.
Opera is still around but AFAIK was bought by some Chinese company.
So your only option seems to be a Mac.
#DeleteFacebook
Since 5 years or so Firefox is autoupdating (you can not disable it) and causing problems over problems (failed updates etc. or UI changes). Why Mozzial.org thinks removing the menu bar and having a "hamburger menu" instead is a good thing is beyond me. Most people tried to revert but could not, then they deleted FF and went to other browsers.
None of my friends is using FF anymore. I only use it when a software project demands FF compatibility and we have to use it for tests. Or for fancy GreeseMonkey scripts.
I think I have no FF anymore n my Mac since 7 or 8 years ... and as long as they don't revert to a sane browser with a menu bar and no automatic forced update I won't try it again.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
You're not very observant, then. Percentage zoom indicator. What's that there for? There are two zoom sizes I care about - too big and too small, and it takes up a lot of space on a small screen. Refresh, reader view (whatever that is) & back button all tied to the URL when they used to placeable wherever you like. Fitt's law, you cunts.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
If Rust is going to replace C on any project, I'm not going to work on the project, nor will I invest money in that project.
Here's a better idea, why not try D / DLang instead?
https://dlang.org/
Any valid C or C++ can be used with D
Rust could potentially replace C, but not C++
It's important to note that Rust does not have Object Orientation, it's more of a pragmatically functional language
It separates data storage and functions into separate grouped objects
but lacks features such as inheritance.
D has inbuilt garbage collection, which can be disabled but is on by default
I think one of the issues in the past has been the disabling of garbage collection with it's standard library, since it assumes garbage collection is enabled for that part.
Although I heard they were working on fixing that, I'm not sure how far they got with it so far
This is what happens when developers make business decisions. Seriously, why is Mozilla focused on promoting/using/developing Rust, when they could be focused on making their browser suck less? Probably because they have no business concerns, at all, about making a viable product (or company.) I spent two weeks exclusively using Firefox, right when Google was found to be recording everything I said, in the event I happened to say "OK Google" without a way to turn this off. After two weeks, I realized I'd rather be bugged than use Firefox any longer.
This is exactly what Joel Spolsky wrote about, when Netscape did a complete rewrite here, or in his awesome book Joel on Software . Netscape focused on a rewrite, instead of making their browser suck less.
It sounds like Netscape made this mistake and then became Firefox. Now, it seems like Firefox is making the exact same mistake. This has to be the funniest business case study ever.
There is nothing wrong with the older languages. The problem is in the newer 'programmers' (and I use that term lightly)
By replacing small pieces of Firefox with new pieces that use Rust, they are avoiding the Netscape problem. They aren't rewriting the whole thing. But one day the whole browser will be Rust, replaced a piece at a time.
You don't think Microsoft Edge still uses pieces of Spyglass or Mosaic do you? And yet, at no point did they rewrite the whole thing.
Even in a modestly large group somebody will always be unhappy, but since opinions are like assholes meaning everybody's got one I'll share mine - the opinion that is, the rest I leave for the goatse.cx guy. The articles here have always sucked donkey balls, they're an untimely mess from an odd selection of subjects and done better by many other sites. The value has always been the discussion, which means the valuable articles have been those who create an interesting discussion. Sometimes there's been very nerdy articles that just doesn't leave much to discuss. Other times it's been soap opera drama that - if you take one step back - is like who gives a shit.
The best articles IMHO are those about some sort of tech/sci advance that sets off a discussion about the subject/implications. Like, SpaceX can land a rocket but I can read that in a thousand places. What will that mean for the future of space travel? That's what is interesting to discuss. Probably second most interesting are the legal subjects, usually because we have a good understanding of the practical feasibility or consequences of implementing the law. Or sometimes how the absence of law lets technology accumulate information and erode their privacy. Of course that could get very narrow and repetitive, like the 1000th time refueling the BSD vs GPL flame war.
I remember us talking about Bush in 2001, so there's politics, so Trump is not new to the mix. There was point releases of the Linux kernel, though of course they usually turned into YotLD discussions. I remember /.'s best headline as "Lance Bass to Continue to Plague Earth's Surface" which ultimately is about a boy band artist's ego trip and not really "news for nerds" at all. It was always kinda CmdrTaco's random blog with comments, it's hard to pin it down. But it was mostly nerdy things that even if they weren't your kind of nerd it felt like they could have been. If anything I'd say it lost that randomness and got too driven by certain submitters' repetitive agendas, like this is the 10th Bitcoin or SJW propaganda this week. Shit got old, discussions were rehashed, many people left.
Live today, because you never know what tomorrow brings
Why not come up with a coding dictionary first. Agree on the words, write/print, var make let, and the list goes on. Agree on the fucking words to be used at least before arguing over their arrangements. Agree on which symbols do what. Come up with reasons for any choices. We are going to keep churning languages driven by nothing but the greed of people pushing specific languages, reality is coders seem to be nothing more than a bunch of purposefully argumentative fuckups who do not want to agree on anything with other coders, argue to win with no purpose or valid reason other than winning the argument.
Chaos - everything, everywhere, everywhen
Your very first claim is false: in Preferences - Advanced - Firefox updates, you can easily set it to ask or never check.
The menu bar can be accessed by hitting Alt, and it can be unhidden by going Hamburger - Customize - Show/Hide Toolbars - Menu Bar. While hiding it is arguable it provides more space for content. The weird thing is the amount of blank space left behind.
How many did you poll to conclude "most people"? I'd be surprised if it was a whole dozen... and the "none of my friends" part makes me wonder how many just won't broach the subject, if you fly off the handle like this at the mention of it.
One of my reasons to use Firefox is that it at supports ad blocking on Android.
I think 1984 called that "doublethink". The ability to do it is an absolute requirement for any self-respecting fanatic!
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Fail and fail and fail again. You have any effective intelligence? Seems not so.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Yes fail :D
As I fail to see a hype.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Your very first claim is false: in Preferences - Advanced - Firefox updates, you can easily set it to ask or never check.
I stopped using FF when they _removed_ that option.
No idea if they reintroduced it.
One of my reasons to use Firefox is that it at supports ad blocking on Android.
Ah, I have a new Android device, I could try FF on it for that reason, thanx for the info.
I know that you can activate the menu ... but as I said: I don't use FF anymore. Only if I have to do a manual test in an obscure software project.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
but [Rust] lacks features such as inheritance.
You overrate inheritance. Even in C++ the trend is to favour composition over inheritance. One good reason to use inheritance in C++ is to create something similar to what Java calls an "interface": basically an abstract base class which you can derive from using one or more concrete classes to do dynamic dispatch. In Rust you can get the same thing via traits -- no inheritance necessary for that.
I'm not saying inheritance is never useful. But in Rust you can get by pretty well without it because of composition and traits. That being said, The Rust community is open for suggestions for language extensions. If you feel something is missing, start a discussion and/or write an RFC for it.
As far as I know this is exactly wrong. Edge was written from scratch, it was not a re-write of IE at all.
Indeed. But true believers (that, by definition, ignore all evidence of any shortcomings of their chosen faith) will be unable to see their faith as "hype". This is quite normal and a sure way to identify what is going on with them.
@angel'o'sphere: You will never hire my as CTO, because I am not available to you. You do not have what it takes to impress me enough. My current CEO does.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Obviously, Rust, with it's run time checks, can't match the performance of C without those checks.
I get that it's tempting to brush off backing up your claim with the word "obviously" especially if the claim sounds so reasonable. But you're actually wrong here. I encourage you to look into the details. Most of the checks are done by the compiler at compile-time incurring no runtime cost. And with respect to array bounds checking ... depending on what you do these checks can often be elided. What do I mean by that? I don't mean "opting out at your own risk"—though, that's possible, too—I mean that there are patterns that make bounds checking just unnecessary in a lot of cases. The Rust team would consider it a bug if a simple C for-loop iterating over an array would be faster than the equivalent idiomatic Rust code. With the help of Rust's zero-cost iterator abstraction and enabled compiler optimizations you'll get exactly the same machine code for the loop logic. People actually checked this because they care about performance.
I see no compelling reason to switch to Rust.
Well, with your attitude and preconceived notions, it doesn't surprize me. You don't really know what Rust has to offer.
If having those run time checks "built in" is desirable enough, I think it would make more sense to re-introduce those checks to C compilers, (Yes, I know, Rust has other features "built in", but most, if not all, of those features are available in libraries with many years of use and testing. (They might even be used by Rust.))
The magic is in Rust's type system. That's how it's possible to avoid dangling pointers without incurring any runtime costs or adding a garbage collector. Show me that C library that does it for C. Sheesh! Array bounds safety is probably the most boring thing about Rust. Everybody can have array bounds safety easily.
And as far as I know, Edge was not a rewrite, it was IE with everything old and legacy ripped out.
Let's see... the UI is new, re-written from scratch. The HTML parsing and formatting is new, written from scratch. The Javascript engine is new, written from scratch. What is left?
Or, in short, if you rip everything out, isn't that a re-write per definition?
I can't convince anyone without a copy of Microsoft's Edge revision control. So I guess think whatever you like.
But if they didn't create a new revision history, then yes it is the same browser. Firefox is still Firefox even though there's nothing left of the original. Linux is still Linux. I think there was an old bit of TTY code and some floppy driver code in the latest Linux left from 1993, but all the rest of it changed, and it's still the same thing.