Live data from Hacker News

Why I’m dropping Rust

medium.com

151–160 of 164 posts

Re: Why I’m dropping Rust

#151
post #89

Earlier quoted context omitted.

Where did you learn CS that they didn't have lots of cyclic data structures? We had those even in our intro class at Berkeley...

I a few universities I know, including my own, cyclic data structures are on the curriculum, but nowhere near being taught as basic or intro stuff. That would lists, queues, trees, and hash-maps.

When I took my degree we had one full year of data structures, Data Structures and Algorithms I & II, but they were taught on the third year (our degrees are 5 years).

Re: Why I’m dropping Rust

#152
post #57
post #50

Earlier quoted context omitted.

In what conceivable way? Safe Rust allows one to do an incredible amount of things whole providing strong guarantees against the sorts of problems that plague lower level languages. Since this isn't suitable for absolutely everything, we have unsafe Rust to fill in the gaps in the small areas it's needed. Unsafe Rust isn't "bad", it just doesn't provide the same guarantees as safe Rust. And if something goes wrong, y…

And if something goes wrong, you can at least narrow down your search to unsafe areas of the code. No. That's only true if the unsafe code presents a completely safe interface to its callers. If the safe code opens a hole in Rust's protection system, which is very easy to do, you can now have C-type no-idea-where-it-is bugs.

Yes, the crash can come from every line of code, but the origin of the bug is in the unsafe code. That's why unsafe code has to be cleanly inspected to be sure it has a safe interface, and by reducing the dangerous area to only few lines, it is far easier to do.

Re: Why I’m dropping Rust

#153

Earlier quoted context omitted.

You don't need weak references. Just use strong ones.

Then you have an ownership loop.

I meant reference counted strong pointers. Non-reference counted weak pointers make no sense from a systems point of view: in order to be memory safe you have to track the number of outstanding pointers, which is effectively a reference count, so you might as well be honest and use a real reference count.

Re: Why I’m dropping Rust

#154
post #89

Earlier quoted context omitted.

Where did you learn CS that they didn't have lots of cyclic data structures? We had those even in our intro class at Berkeley...

It occurs to me that these courses have been teaching what might (should?) be considered a naive view of memory; you show me a traditional cyclic data structure and I'll show you a concurrency bug. I suppose that's fine in 1978 when no one imagined they'd be dealing with multi-core micro controllers, but today, when you find yourself using a "systems" language for non-toy work and you reach for a tool as sharp as a r…

Cyclic data structures are in my experience very useful for concurrency. It's probably the number three good excuse for using a linked list, when you want to hold a lock for O(1) time with no shenanigans. But also, generally, anything that involves communicating information from point A to point B, and waiting on that information, involves some sort of cyclic reference between the sender and listener.

Re: Why I’m dropping Rust

#155

Earlier quoted context omitted.

vpri.org managed to squeeze a GUI toolkit and a document format and the whole compiler toolchain required for the language (including rasterization) in about 20K lines of code, and it's fast enough to run in a laptop. I'm pretty sure we haven't explored the sheer depth of simplifications that can still be done.

Sounds cool. Got a link? I can't find anything on their website that seems to be that sort of thing?

I doubt that you'll find much.. They didn't release the code of their "crown jevel" (Frank, the 'word processor'), which makes me quite unimpressed about these year of research where the main result is a bunch of papers and demos but (nearly no) code (except for the OMeta part).

Re: Why I’m dropping Rust

#156
post #89

Earlier quoted context omitted.

Where did you learn CS that they didn't have lots of cyclic data structures? We had those even in our intro class at Berkeley...

It occurs to me that these courses have been teaching what might (should?) be considered a naive view of memory; you show me a traditional cyclic data structure and I'll show you a concurrency bug. I suppose that's fine in 1978 when no one imagined they'd be dealing with multi-core micro controllers, but today, when you find yourself using a "systems" language for non-toy work and you reach for a tool as sharp as a r…

I have to completely disagree ... What are you even talking about? The inability to have circular links is deeply hobbling; they arise naturally in all kinds of circumstances.

Re: Why I’m dropping Rust

#157
post #155

Earlier quoted context omitted.

Sounds cool. Got a link? I can't find anything on their website that seems to be that sort of thing?

I doubt that you'll find much.. They didn't release the code of their "crown jevel" (Frank, the 'word processor'), which makes me quite unimpressed about these year of research where the main result is a bunch of papers and demos but (nearly no) code (except for the OMeta part).

I believe they did release the source code, not far from here: http://vpri.org/fonc_wiki/index.php?title=Installation_Guide (may be outdated, you may want to ask the FONC mailing list, may not work on your machine… it's a proof of concept anyway, not a hardened engineering artefact).

Their writing is here: http://vpri.org/html/writings.php

Their various reports are there (most recent first):

http://www.vpri.org/pdf/tr2012001_steps.pdf

http://www.vpri.org/pdf/tr2011004_steps11.pdf

http://www.vpri.org/pdf/tr2010004_steps10.pdf

http://www.vpri.org/pdf/tr2009016_steps09.pdf

http://www.vpri.org/pdf/tr2008004_steps08.pdf

http://www.vpri.org/pdf/tr2007008_steps.pdf

Re: Why I’m dropping Rust

#158
post #50

Earlier quoted context omitted.

In what conceivable way? Safe Rust allows one to do an incredible amount of things whole providing strong guarantees against the sorts of problems that plague lower level languages. Since this isn't suitable for absolutely everything, we have unsafe Rust to fill in the gaps in the small areas it's needed. Unsafe Rust isn't "bad", it just doesn't provide the same guarantees as safe Rust. And if something goes wrong, y…

All languages have design flaws. Thats why people keep making new languages. Arguing that Rust does not have design flaws is going to arouse more skepticism then anything else. It is not mandated that you 'must' write safe code but that you 'can' write safe code. So there really is no fundamental assurance that rust and its libraries are in fact 'safe' by Rusts own definition in any meaningful sense. You could make t…

Nobody's arguing that Rust doesn't have design flaws.

That said, people also need to understand that many such instances are not design flaw, but are instead design tradeoffs. The OP indicated that having to switch to unsafe Rust to represent a cyclic datastructure is a design flaw. My response is that it's a tradeoff that pays dividends in every other piece of code.

Can Rust improve upon the number of problems that can be solved with safe vs. unsafe Rust? Absolutely! Is it worth cordoning off a few cases that don't technically need unsafe behavior, to ensure all other Rust code performs safely? Emphatically yes.

Re: Why I’m dropping Rust

#159
post #100
post #50

Earlier quoted context omitted.

In what conceivable way? Safe Rust allows one to do an incredible amount of things whole providing strong guarantees against the sorts of problems that plague lower level languages. Since this isn't suitable for absolutely everything, we have unsafe Rust to fill in the gaps in the small areas it's needed. Unsafe Rust isn't "bad", it just doesn't provide the same guarantees as safe Rust. And if something goes wrong, y…

I'm not convinced that cyclic data structures are a feature that's exotic enough to warrant breaking the language contracts. This thread alone shows that it's a common occurrence in tree structures. There will be likely be other structures as well. So I'd think a better way than saying "don't do that - or if you have to, you're on your own" would be to analyze use cases and see which scenarios the language can satisf…

You can always use std::rc::Weak if you need a cyclic data structure with weak references. That covers, I suspect, the majority of the use-cases for these type of structures.

For real, honest-to-god, cyclic data structures — just use unsafe Rust. Again, unsafe Rust isn't "bad". It's just unsafe. More care will be expected of the code to ensure that it exports a safe interface, but nothing in the language stops you from doing it. There's quite literally no loss of expressive power.

Re: Why I’m dropping Rust

#160
post #129

Earlier quoted context omitted.

This sounds like a failure of the Rust documentation.

The documentation is supposed to tell you what the language is, not exhaustively detail everything the language is not .

No, it's supposed to teach people how to use the language. When a large fraction of your user base will be bringing a specific skill set, then you should generate documentation aimed at translating those skills!
Post reply on HN