6 ms·
Rust seems so low level that I don't get why people flock to it when C# and Java would be much better fits? Is it just because they're bored of C# and Java and
by sbjs 8y ago
Rust seems so low level that I don't get why people flock to it when C# and Java would be much better fits? Is it just because they're bored of C# and Java and want to learn a new language? Even Erlang should scratch that itch! I would guess that only the Servo team really benefits from Rust, or maybe some wall street traders who need hyper speed! Every other app should work fine with something slower.
- steveklabnik 8y agoWe've got a lot of comapanies using Rust for various things that aren't Servo nor Wall Street traders :) https://www.rust-lang.org/en-US/friends.html https://www.rust-lang.org/en-US/friends.html In many cases, C# or Java are great choices for a project, but Rust fits in quite often too.
- sbjs 8y agoWow, big list. I guess more people need the speed Rust gives after all! Would you say the job market is good for Rust? I only sunk my teeth into React and I'm loving it but I'm open minded.
- steveklabnik 8y agoCompared to Java or C#? Miniscule. There are jobs happening, but they're often not pure Rust jobs. It's changing a lot though; there used to be like, two or three at best.
- k__ 8y agoI don't understand why anyone would go for C# or Java. If you want GC and/or fast dev speed, go for JavaScript. If you really need static typing, go for TypeScript. JS has one of the fastest VMs on the planet and virtually everywhere. If you need speed and don't want to mess around with decades of C/C++ legacy quirks, go for Rust.
- sbjs 8y agoI'm with you, I love TypeScript! It's my favorite language of all time! But people using Java and C# are usually tied to a platform and SDK that TypeScript can't easily interoperate with. But I guess if you can replace your whole app with an Electron version, go with TypeScript all the way!!
- jcranmer 8y ago> I don't understand why anyone would go for C# or Java. Library support immediately comes to mind. If I need an implementation of, say, the Kerberos protocol, I'm more likely to find a binding in Java than in JS.
- steveklabnik 8y agohttps://www.npmjs.com/search?q=kerberos https://www.npmjs.com/search?q=kerberos shows 26 packages. The huge ecosystem is one of the big selling points of JS!
- sbjs 8y agoI feel like it's a mixed bag. For every 10 packages, maybe 8 are half-baked and strapped on in a hurry with no care. That said, those other 2 are usually amazing. Java has an edge there, because there's a lot more fully supported, corporate backed, high quality packages for Java.
- jcranmer 8y agoI recall a few years ago when some people were talking about porting an application to nodejs. The idea was dropped when it was found that there was no LDAP library that supported Kerberos SASL authentication, which was an absolute requirement for the application. (A quick look suggests that there still lacks an implementation of this). Note that the number of packages is not a great indicator of the quality of implementation.
- vvanders 8y ago> JS has one of the fastest VMs on the planet and virtually everywhere. Citation? Last time I looked at LuaJIT it still beat V8 by a healthy margin.
- staticassertion 8y agoI write web services in Rust. I'm extremely productive in Rust vs other languages, especially for young projects where I spend a lot of time refactoring. Things like borrow checker errors just don't happen very often to me anymore, or they catch legitimate bugs and are generally quite easy to fix. I just don't run into them very often at this point. I've written Python and Java professionally. In both cases I felt like I just couldn't express what I wanted to, at all times, in my program. This led to me being a lot less comfortable refactoring - relying on tests that were far too heavily tied to implementation details. I had some really complex logic I needed to write for one of my services. Basically I needed to represent a 'thing' and that 'thing' could be in a few different states. I wrote out the code, types first, so that every state had a type. I was able to do this generically using Rust's associated types in a way that allowed me to implement the state machine for multiple 'things'. It was very testable, very readable code that I had high confidence in. I would have had a much harder time doing this in Java/ Python (I have done similar things, and you can get value from the approach, but not the same level). I've refactored that code a lot with confidence. Speed is a nice bonus, but mostly secondary.
- kbenson 8y agoCan I ask what you use as a database abstraction layer, if any, and what methods you use to convert your request params/JSON to queries? I was playing around with trying to do this a while back (while also trying to learn Rust some), and it felt very cumbersome to have to write many specific Diesel update methods to handle different types of requests. It could have been my now knowing a better way to accomplish it, or it could have been the type of queries I was trying to model aren't a good fit for a staticly typed system like that (and there may be a better way to architect it). In any case, it felt like I was poorly approximating the strict typing I had already implemented in Postgres, a few times over, when I would be happy just handing it to Postgres and letting it throw out errors as needed.
- staticassertion 8y agoThe only data stores I currently use are redis and dgraph. I write raw dgraph queries, though I have a small, highly focused library that I use to generate some of them. As for redis, I use it as a dumb KV store, no need for an abstraction layer.