Live data from Hacker News

Was Rust Worth It?

jsoverson.medium.com

361–370 of 736 posts

Re: Was Rust Worth It?

#361
post #338

Earlier quoted context omitted.

I rather use compiled managed languages like Swift, D and C# instead, they provide enough low level coding knobs for C and C++ style coding, while being high level productive. Would add Go to the list, but only when I really have to. Nim and Crystal could be alternatives, but don't seem to have big enough communities, at least for what I do. However I do agree with the conclusion, Rust is a great language for scenari…

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

I've always found those sort of firms with C#, in my experience, have the best architected code. Proper domain-driven design, onion architectures, clean testable code... Some have legacy issues where they might not have the most cutting edge CI/CD pipeline or high automated test coverage, but the code itself can be very nice. I've never really experienced that level of consistency with a different language/company size.

Re: Was Rust Worth It?

#362
post #2

Perhaps my biggest critique is that crates.io has no namespacing. Anyone can just claim a global and generic package name and we mostly have to deal with it (unless you avoid using the crates.io repository, but then you'll probably have more problems...). Some of these globally-claimed generic packages are not really the best package to use. Maybe it was a reaction against the Java-style reverse DNS notation, which i…

I don't think a lack of namespace is that much problem. Sure, it is often annoying, but people are creative enough to create a short enough and still available crate name for most cases. Namespacing only makes sense for a large group of related crates---and it wouldn't give much benefit over a flat namespace. As other mentioned though, a typosquatting is a much bigger problem and namespacing offers only a partial sol…

Id argue typesquatting a namespace is arguably easier then type squatting a package name since you will often ignore the namespace name

Re: Was Rust Worth It?

#363

Earlier quoted context omitted.

What's a frequently encountered case for such cyclic loops? Without details I'm drawn to trying to break the cycle, either by promoting the shared state to a container object for the set, or by breaking it out into it's own object that multiple things can point at.

ASTs

An Abstract Syntax Tree / or Double-Linked List both qualify, but they're also a lower level implementation detail than I'd expect to frequently interact with in a reference safety focused language.

I've still been meaning to write something in / learn Rust's ways of thinking; is there not an intended replacement for these data structures? Or do they expect it all to go under Unsafe?

Re: Was Rust Worth It?

#364
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…

Opposite experience for me. Writing Rust on embedded systems greatly improved my confidence and speed. When using C a small mistake often leads to undefined behaviour and headaches. Rust theres none of that - its been a game changer for me.

Re: Was Rust Worth It?

#365
post #157

Earlier quoted context omitted.

> Give me rusty bash. Bash with types (especially floats), fewer edge cases, functions with explicit parameters, simple command line flags...

Now you have me curious - where do you see the need for floats in shell? You are more creative than myself, because I am struggling to come up with a situation where I would lean on this. A "path" type would be by far more useful to my work.

I have a script which uses wmctrl to tile windows when I press a shortcut key (for when I'm using an editor and want the editor window to take up most of the screen).

I guess I could avoid floats using multiplication, but I would rather keep the code as simple as possible.

Re: Was Rust Worth It?

#366
post #338

Earlier quoted context omitted.

I rather use compiled managed languages like Swift, D and C# instead, they provide enough low level coding knobs for C and C++ style coding, while being high level productive. Would add Go to the list, but only when I really have to. Nim and Crystal could be alternatives, but don't seem to have big enough communities, at least for what I do. However I do agree with the conclusion, Rust is a great language for scenari…

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

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 wider variety of langs

For those reasons IMHO if you are small-mid company (or startup) it's wiser to choose JVM.

Re: Was Rust Worth It?

#367
post #320
post #316

Earlier quoted context omitted.

I tried to get into rust for many years, I'm now in a C/CPP job (after Java/Python/Ruby and other gigs). What I've come to understand is that Rust's lifetime model is very difficult to work with whenever you have a cyclic reference. In C/CPP the same holds, but you deal with it through clever coding - or ignoring the problem and cleaning up memory later. Java, and other GC'd languages just work for these structures.…

> I just wish Rust learning resources would be more upfront about this. While beginner resources don't dwell too much upon cyclic references, they don't consider unsafe blocks as unusual. All the material I've seen say that there are certain domains where Rust's compile-time safety model simply won't work. What Rust allows you to do instead, is to limit the scope of unsafe blocks. However, the beginner material often…

> Cyclic references can be dealt with runtime safety checks too - like Rc and Weak.

Indeed. Starting out with code sprinkled with Rc, Weak, RefCell, etc is perfectly fine and performance will probably not be worse than in any other safe languages. And if you do this, Rust is pretty close to those languages in ease of use for what are otherwise complex topics in Rust.

A good reference for different approaches is Learn Rust With Entirely Too Many Linked Lists https://rust-unofficial.github.io/too-many-lists/

Re: Was Rust Worth It?

#368

Earlier quoted context omitted.

80% of crates have no unsafe code in them.

I'm interested in what went into this number. I checked the six most recently published crates on crates.io (blablabla, nutp, tord, g2d, testpublishtesttest, hellochi, at the time of writing). Three of those (blablabla, testpublishtesttest, and hellochi) did some variation on printing `hello world`. g2d seems like an interesting graphics library. tord provides a data structure for transitive relations, which is also…

What is the fact that many foundational ecosystem crate contain unsafe code supposed to prove? That's the entire point of the language. That someone writes a really good regex crate once and then the rest of us don't have to write unsafe to use it. It seems like you have a fundamental misunderstanding about the goals and purpose of rust.

Re: Was Rust Worth It?

#369
post #340
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…

Wait, I am a bit confused. Does Zig have more/better libraries than Rust? I thought it's a pretty new language. The most limiting thing for me with Rust was the lack of libraries (vs. say Python or Node/JavaScript).

It interops seamlessly with C libraries.

Re: Was Rust Worth It?

#370

Earlier quoted context omitted.

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

Ok, but like, were any of them people of note, actively working on the project? Because it seems like the people who are working on the project aren’t saying that.

The people that are working on the project haven't implemented namespaces, or any other security feature really, so what they say is immaterial. What they do is the only thing that matters.
Post reply on HN