Live data from Hacker News

Was Rust Worth It?

jsoverson.medium.com

471–480 of 736 posts

Re: Was Rust Worth It?

#471
post #286

Earlier quoted context omitted.

> but the ergonomic is really bad. Every time I write some rust I feel limited. > But I do not think it is a good general purpose language. Remember that this is not a sentiment that's shared by everyone. I use Rust for tasks that need anything more complicated than a shell script. Even my window manager is controlled from a Rust program. I say this as someone who has been programming in Python for nearly two decades…

> At this point, I'm about as fast in Rust as I am in Python. This is factually impossible. For anything larger than (very) small programs, Rust requires an upfront design stage, due to ownership, that it's not required when developing in GC'ed languages. This is not even considering more local complexities, like data structures with cyclical references.

> For anything larger than (very) small programs, Rust requires an upfront design stage, due to ownership, that it's not required when developing in GC'ed languages.

Every language requires this (if you want robust code), most just let you skip it upfront ... but you pay dearly for doing so later.

Re: Was Rust Worth It?

#472

Earlier quoted context omitted.

> "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. Literally nobody has said this. > The attitude of "Rust is memory-safe, so we don't need any other form of security." is not a good one. Fortunately it's an attitude that nobody in the Rust project has!

> Literally nobody has said this. I know of a few people, personally, who have said this.

> I know of a few people, personally, who have said this

jiggawatts

Re: Was Rust Worth It?

#473
post #174

Earlier quoted context omitted.

Well, what do you dislike about it?

Good question! There's no single thing, I think, and the things I dislike about it aren't even really technical criticism or the like. They're more... aesthetic? I find the syntax unpleasant, for instance. It's extremely opinionated and a few of those opinions are ones I disagree with. Also, just generally, it tends to make even simple things pretty complex. I understand why and am not really objecting to that, but i…

Which opinions do you disagree with? For transparency, I tend to find myself agreeing with almost all of its models/abstractions.

Re: Was Rust Worth It?

#474
post #93

> I started writing tests in Rust as I would in any other language but found that I was writing tests couldn’t fail. This is a common refrain in C++ testing: if it compiles then it's probably correct. > Rust has accounted for so many errors that many common test cases become irrelevant In practice, if you think this way I think it's a sign that you aren't testing the right things in those other languages. You should…

A null pointer exception is a bug that breaks business logic. There's no "business logic instead of language stuff" because the language stuff is the foundation that business logic rests on. If you don't test against failure modes, what's even the point in testing?

A null pointer exception is a free runtime check. I really don't understand the fuss about null. The "most expansive design mistake in computer science" and whatever.

Re: Was Rust Worth It?

#475

Earlier quoted context omitted.

I used to be .NET dev and don't agree. Couple of reaons: 1) Modern Java is almost as good as C# with some things I can't give up in Java (static imports => succint code, Groovy Spock => succint tests) 2) Kotlin is better than C# 3) JVM has much much bigger ecosystem (almost all the apache projects are JVM oriented) and default web framework is much less code to type (SpringBoot) is much more productiv 4) JVM has wide…

Java is surely keeping up but I can't name single Java feature that I miss in C# or is implemented better in Java. I haven't used Java in a long time though, just occasionally I read about new Java features and I've never said to myself "cool, I wish I had it in C#". Static import are also available in C# for quite some time now (c# 6, released in 2015, and in C# 10 you can even make this import global for for projec…

Depending on how you look at it, better extension everything support on Kotlin's case, and a way to do DU, while it keeps being discussed for C#, people should just add F# to their codebase, but alas.

Re: Was Rust Worth It?

#476
post #5

Earlier quoted context omitted.

URLs for packages makes a lot of sense. It works well in the land of Go. It also conveniently eliminates the need for the language to have a global packages database. Upload your package to example.com/your-thing and it's released! (You can, of course, still offer a cache and search engine if you want to.)

No, URL's don't make sense because your application shouldn't care where on the internet your dependency happened to be hosted when you integrated it. It's location has nothing to do with what it is. By the time you're going to production, your vetted and locked dependency should be living in your own cache/mirror/vendored-repo/whatever so that you know exactly what code you built your project around and know exactly…

You can use the `replace` option in the Go mod file to redirect your dependency references elsewhere if you need to.

Re: Was Rust Worth It?

#477
post #231

I wrote a lot of rust, but after some years it still feels unproductive. I do a lot of zig now and I am like 10 times more productive with it. I can just concentrate on what I want to code and I never have to wonder what tool or what library to use. I know rust gives memory safety and how important that is, but the ergonomic is really bad. Every time I write some rust I feel limited. I always have to search libraries…

You should try diving into num for like a month and see how you like it. It's different enough that you need to go past a certain kind of ledge to start liking it. Or at least that was my experience. For me, it shares the most important benefits of Rust but with quite a lot more ergonomic coding model.

Woopsie. I meant s/num/nim/ of course.

Re: Was Rust Worth It?

#478
I definitely agree with the first negative point. Rust libraries often feel weirdly restrictive and unfinished, even after having a lot of time to mature. Somehow they just don't end up feeling that much better. I just don't understand why though, is there something about Rust that makes this a problem?

Re: Was Rust Worth It?

#479

Programming in Rust is really not like being in an abusive relationship. The compiler is trying to help out as much as possible, especially since rustc has the best error messages in the world.

Rust's compiler is the first one I've seen to use the word perhaps.

My main gripe is that I still don't fully comprehend lifetimes and the compiler can't really help me every time, because it (understandably) errs on the side of caution.

Re: Was Rust Worth It?

#480

Earlier quoted context omitted.

This. I have exactly the same experience, I can't believe how much I was able to ship with Zig and the code mostly feels like "done". You can always improve it, but there's no need to. With Rust, I was never happy, even after 5 years, I was still thinking about better abstractions and implementing more traits, making it more generic, etc.

Why is there no need to improve Zig code but there is for Rust code? You'd need the same abstractions in Zig as well, no?

No, usually you don't. Rust has closures, iterators, generics, different traits for operator overloading, smart pointers, etc.

Zig doesn't have any of that. It's very interesting combination of low-level, predictable code, with meta-programming, where you get some of that abstraction back.

i.e. Zig does not have generics, but your function can return type, so generic list is just a function which returns a newly created struct.

Post reply on HN