top | item 44846536

(no title)

conorbergin | 6 months ago

I think the problem with this attitude is the compiler becomes a middle manager you have to appease rather than a collaborator. Certainly there are advantages to having a manager, but if you go off the beaten track with Rust, you will not have a good time. I write most of my code in Zig these days and I think being able to segfault is a small price to pay to never have to see `Arc<RefCell<Foo<Bar<Whatever>>>` again.

discuss

order

Sytten|6 months ago

I view it as a wonderful collaborator, it tells me automatically were my code is wrong and it gets better with every release, I can't complain really. I think a segfault is a big price to pay, but it depends on the criticality of it I guess.

pron|6 months ago

Not to mention that `Arc` uses a GC (and not a stellar one, at that)...

surajrmal|6 months ago

You can use alternative GC such as crossbeam if you want. You're not locked into using an Arc.

veber-alex|6 months ago

Lol, what are you even trying to say here?

Is Zig such an amazing language that while using it you won't ever need reference-counted pointers?

the__alchemist|6 months ago

You can write rust without over-using traits. Regrettably, many rust libs and domains encourage patterns like that. One of the two biggest drawbacks of the rust ecosystem.

surajrmal|6 months ago

I can't imagine writing c++ or c these days without static analysis or the various llvm sanitizers. I would think the same applies to zig. Rather than need these additional tools, rust gives you most of their benefits in the compiler. Being able to write bugs and have the code run isn't really something to boast about.

conorbergin|6 months ago

I would rather rely on a bunch of sanitizers and static analysis because it is more representative of the core problem I am solving: Producing machine code. If I want Rust to solve these problems for me I now have to write code in the Rust model, which is a layer of indirection that I have found more trouble than it's worth.

ViewTrick1002|6 months ago

How do you guard concurrent access in your multithreaded code?

Due diligence every single time after the tenth refactor?