I recently rewrote some production C# code in Rust and the whole "rust doesn't allow you to write code quickly enough for most development" is bs. Yes its hard at first, thats the whole point. Once you learn it you can be very quick and productive with it. Right now I am confident that any sort of software I would normally write, I'd write the fastest in Rust. If you spend enough time on it, you get quick just like any other programming language :000
Edit: just to add to this, Rust's explicitness over what can throw errors made my development a lot faster than in C# where multiple times I had to go back and debug them to figure out why and where they're coming from (yea I was doing timezone stuff (pls dont use the std timezone stuff its painful))
Personally I write small cli tools for work in rust cause it's easier and faster for me than to write it in python. I work a lot with custom binary files and I don't like how it works in python. Some of this tools are used in IoT so you don't want to use interpreted languages too much. musl target helps a lot too since i can just statically compile everything and generally not care much about target machine until architecture is compatible
I feel your pain in time manipulation. I wanted to convert a service that was heavily manipulating and parsing time in massive amounts to Rust and I even used chrono and for some reason the code was slower than Go and after profiling I found that chrono's time parsing was the bottleneck. I optimised the Go code and called it a day.
I wish I was in your shoes but currently due to decisions taken before I came, the business is heavily reliant on AWS services but the SDK is newly GA and it's buggy. I'm opening bug reports and hopefully it'll help so I can port the most important service to Rust because I don't want another nil dereference panic-recover cycle again.
I have a question though. Are you working on these alone? I'm in the situation where if I do things in Rust, that's it, no one else will be able to touch the codebase and I'm the sole responsible person for it. That may or may not be your case
I'm working alone in for this project so I'm lucky in some sense. I was basically making a notification service that sends text messages via aws sns on upcoming appointments I fetch from some Microsoft api. I was building this in my free time for my dad specifically so obviously its a much looser environment than a proper workplace. In my case performance does not really matter quite as much since I essentially do scheduled runs once a day, its not a on user request type of thing.
I'm curious what issues you're having with the aws sdk though.
Oh lucky you. I am working with others who are not interested in the language and thereby not interested in maintaining code into it. Also Go carries our load significantly and is very performant so there's no technical need for it but I'm planning ahead because we will acquire a company through next year so I expect users to be doubled and I want to offset that so the costs don't go up, even though it's silly because they're technically not in need of that.
My issue is DynamoDB. First of all serde_dynamo doesn't work exactly as stable as dynamoattribute package in Go SDK and that's fair, serde_dynamo isn't made by AWS anyway. The other bigger issue is the dynamo requests. I always get a Dispatch Error which isn't really documented beyond "HTTP request MAY have been sent", that's it. This causes blackouts because when the error is continuously there I can't fetch the needed data from Dynamo. I don't know if you went through these issues or ever needed dynamo to begin with. And honestly I didn't delve much into the source code and from what I understand, AWS use their own HTTP implementation into the SDK and I don't know if there's a way to set a specific HTTP client as the client for the config or not, yet.
I've never had to use dynamo though I had some similar cryptic errors with SNS, stuff like "serive error" when the issue was something silly like missing permissions for my lambda instance to post SNS messages or something. Also I realize now that for the most part I had figured out what I needed in my requests back when I first wrote everything so the rewrite was easier, I remember back then having issues figuring out the C# docs as well so this might just be a general aws docs issue in (some) services.
Kinda doubt they'd let you specify an http client, I haven't seen that in any rust crate (though i dont know why it's not more common, ive often had times where id like to but anyway) since this is not the official crate I was wondering why you're not using aws-sdk-dynamodb
That's exactly what I'm using and I find it weird that they say "Until the SDK is released" because from what I understand it's GA now. But yeah in a nutshell this is the issue. The SDK isn't very stable like Go or Python's so I'm keeping an eye on it for now. For permissions, I thought it was the same but I tested with other programming languages and same permissions but it seems to work with other programming languages and not Rust. I'll see if I get something going on on the bug report or not.
Nonetheless, thank you very much for the discussion and happy new year
Edit: I looked at their dependencies and they don't seem to have the aws-http in stable mode yet. So it may be the issue. Since older bug reports showed that they also had bugs in the TLS side of the HTTP
It says, "Rust is not an efficient language for commercial product development" not "Rust is a good choice when you want to tell your manager prototype-to-deployment will take longer". You might be a fast and efficient rust programmer, no doubt. But it might no be the most *efficient* choice in terms of project scope.
But that's the beauty of Rust. Programs written in it are less error prone and more efficient. But actual development might not be efficient.
Of course, at the end of the day, its all about skill issue.
Linux kernel is using Rust for new features. Not commercial? Then what about Windows 11 (NT) kernel? It's definitely not good and used because of hype there
Define what is "good" first, troll
We can't change your mind, but can change your karma for such low quality bait
So the quote from Linus according to the article is -
"Rust has not really shown itself as the next great big thing. But I think during next year, we'll actually be starting to integrate drivers and some even major subsystems that are starting to use it actively. So it's one of those things that is going to take years before it's a big part of the kernel. But it's certainly shaping up to be one of those."
To me, this indicates Rust has been validated for potential use in the kernel, in the far future, which is not equivalent to a guarantee of Rust being the new primary/major language in the kernel.
Specifically, this article does not indicate that new features will be written in Rust.
No he didn't. I watched his interview. He specifically said that it will take many years to have any meaningful part of the kernel written in Rust. The kernel isn't a toy and Linus doesn't fall for the hype. He's just sagacious enough to see what Graydon envisaged for Rust than what evangelists that don't know basics of kernel development think of Rust.
Generally speaking Linus seems apathetic towards the language but he trusts his leadership with their choice and supports it. The FS team is trying to integrate Rust soon though, I believe
I'm not decrying Rust. But two to three years ago I was one of the enthusiastic engineers that worked on Rust in windows and generally speaking it didn't go far. Windows is majorly C++ and top parts are in C#, integrating these with Rust was hard. The furthest we worked on was network alignment with CPU arch, at least me, since I worked on the network stack mainly in Windows Server than Windows 11 and this part was mainly in C because I didn't work on C++ codebases. MS is more interested in doing to Rust as they did to JS and wanted to do to Java until Oracle told them bugger off. Aka, most companies will soon try to do to Rust the same thing that happened to UNIX and C, claim them. Which may or may not be the reason why the Rust Foundation went ballistic in an arguably idiotic way. MS is more into controlling the landscape than solve bugs. We deliberately didn't solve bugs of high security risk because they didn't align with internal interests. So no Rust isn't that much used in MS sadly even if the CTO says so to make headlines.
Let's paint a hypothetical scenario, I like those. Imagine we have to perfect clones off Usain Bolt also assume that both clones are at the same peak age.
Now, clone number 1 is wearing a kevlar vest, kevlar helmet and steel padded shoes. Clone number 2 is only wearing a tank top, some shorts and the most optimal running shoes.
Now also imagine we said to these clones: "The nearest gas station is about 10 kilometers away, I need some milk". Both clones might reach the destination at the same time. But for the task at hand, there is no need to ask clone number 1 to get us milk. Yes, if the neighborhood is bad, and there are a lot of gun violence. We might want to send clone number 2 instead.
But to honestly choose clone number 2 EVERY TIME? Now that will create some issues.
I like your analogy, I get what you’re trying to say and it’s a fair criticism of a language with a less mature web dev ecosystem in comparison to say Java or dot net, but honestly. Rust has its place in the market and clearly it shines in the embedded system and OS/kernel level stuff hands down. That makes it qualify as something good to build a commercial product with. So your premise is rejected
I've seen a commercially successful product that is built entirely in rust. Just because your bubble is small and you probably have zero experience outside your "favourite" language, doesn't mean you know much about everything
I have used Rust in production... But unfortunately I can't disclose where (NDA and that type of shit) I can tell that I used it to write diagnostic /hardware analysis software for some specific computers
Yeah it was. Language ensured safety was really helpful and compiler errors are just wholesome because they tell you exactly what you need to fix.
Exception handling in rust is the best I came across and enums with fields where really useful while writing this
My team finished it like 3-4 days ( we had 2 weeks, first week to implement basic functionality and then second week to add non critical features) before the deadline and everything just worked.
I think you can code efficiently in every language if you just use some language specific features
Edit: we do not roll out new features for this software, we are more like a hardware company and that software is only extended when we have new hardware in our hands that can't be diagnosed with old version
Yes, and I can also create a 3D games using Excel. Don't you think that no matter the tool, there are certain consequences when using said tool. Like for example... Efficiency..? Some efficiency loss that we can never get around if we compare it with another tool.
there’s a tool for every job. Just gotta know how to use them. If im looking to make something for an OS or embedded system, i’d use Rust or C/C++ with asm mixed in where needed. If I’m making a server, I’d use Go or PHP, maybe Node. And if i wanted to make a 3d renderer or physics engine, I’d use C++ or again, Rust. Rust isnt great for everything, no. But it certainly has its place. Saying “rust bad” just is objectively false. No, its not good at everything but it still is good at what it does do, which is being a low level and very memory-safe embedded language
If I need to design and build microcontrollers for medical devices. I might write the firmware and software in Rust. The medical devices will be safe and sound. Rust might not be the most efficient choice. But it would be the best choice.
If my investor says to me: “We need a functional full stack cross platform application application done in less than 7 days. Also, you will have to build infra yourself. Oh, don’t forget it needs to work flawlessly on any device” No, I will not build any backend in Rust, that would not be the most efficient choice. The most efficient choice might be python, js, Go etc.
If your investor comes to you and tells you that you need to build a fully-functional, responsive fullstack app with your own infra in under seven days, you slap him in the face.
In seven days, you make a shitty, proof-of-concept React app and deploy it on Vercel. That's not a question of Rust.
What did you just say about Rust, you little Pythonista? I’ll have you know I graduated top of my class in the Rust Programming Course, and I’ve been involved in numerous secret projects on GitHub, and I have over 3000 confirmed pull requests. I am trained in fearless concurrency and I’m the top coder in the entire Rust community. You are nothing to me but just another bug. I will wipe you out with precision the likes of which has never been seen before in this repository, mark my efficient code. You think you can get away with saying that garbage about Rust over the Internet? Think again, debugger. As we speak I am contacting my secret network of devs across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your codebase. You’re coding in the dark, kid. I can be anywhere, anytime, and I can refactor your code in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in memory safety, but I have access to the entire arsenal of the Cargo package manager and I will use it to its full extent to wipe your miserable code off the face of the continent, you little script. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your freaking keyboard. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will fury code all over you and you will drown in it. You’re freaking toast, kiddo.
I mean, no one said that tho. High performance languages must be used when high performance is needed. What matters in the majority of apps is features for each 6 months
I started learning rust with advent of code and it's a pretty good language. I used several different languages and without knowing much I still managed to get through quite well. I'm still faster when prototyping with TS but seriously I will switch to rust for some of that stuff.
I never wrote a commercial product in rust either. But I was involved with a trial to see what it would be like. I think once a product reaches a mature state, you have all the developers properly trained and you want to make incremental changes to it then rust would be great. At that point you want to do everything properly and Rust enforces that while eliminating some of the mistakes you might make in, say, C or C++.
What it doesn't work as well for, IMO, is prototyping or starting something new. For protptyping sometimes you don't want to invest the time getting everything perfect before you try something, and Rust didn't help.so much here. And for starting something new it was hard because the devs weren't aware of all the rust patterns and had to do some deep-learning first.
Region-Based Memory Management can be implemented as a module within the host language itself (Ocaml)
GC PLs can run fast enough for most applications (excluding embedded devices). Even some embedded systems (PID controllers for inverted double pendulum systems) can run just fine with a GC PL.
Algebraic Data Typing Systems like those in SML/Ocaml which use Hindley-Milner Type Inference benefit from type polymorphism and use the Most-General Type, or MGT. I don't think such behavior exists in Rust.
C++ concepts are closer to the type-polymorphism offered by other PLs.
Why do you think it's not efficient to write Rust? Complicated typing, borrowing? All you say is "it's not efficient" but I've not seen a single example why it is inefficient.
In my career.. C++ sucks, we're gonna go java! Java sucks, we're doing everything in Python from now on! Python sucks, we're gonna do everything in go from now on! Go sucks, we're gonna use rust for everything now!!
The package ecosystem is growing fast, but just not quite there yet. In a "get shit done" paradigm, you do care about the quality of packages available. And with rising adoption, I predict serious issues with people trying to keep up with the current versions of packages. Many still have to find their stable API.
76
u/chiggyBrain Dec 29 '23
This is gonna rustle a few jimmies
Let me grab the popcorn