News for hackers. Stuff that matters.
Re:Why I’m dropping Rust by TillE on Sunday September 11, 2016 @02:29PM (#12474801)
A lot of problems in Rust seem to involve replacing (smart) pointers with handles. Sometimes you really do want to do that, but it's bad if it's a necessary kludge.

Like someone else said recently, it's a problem if you can't reasonably teach a basic computer science course in Rust.

Re:Why I’m dropping Rust by ekidd on Sunday September 11, 2016 @02:45PM (#12474914)
"Safe" Rust works for almost everything in a typical CS curriculum.

But if you want to teach an operating systems course or build cyclic, pointer-based data structures, you'll usually need a modest amount of "unsafe" Rust. Using "unsafe" gives you access to real pointers, which work just like they do in any systems language.

It's just that Rust chooses to lock those features away when you don't explicitly ask for them. If you actually need "unsafe", it's no more dangerous or more difficult than writing C code.

Re:Why I’m dropping Rust by jblow on Sunday September 11, 2016 @04:59PM (#12475698)
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...
Re:Why I’m dropping Rust by coldtea on Sunday September 11, 2016 @06:12PM (#12476012)
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.
Re:Why I’m dropping Rust by desdiv on Sunday September 11, 2016 @06:38PM (#12476095)
The regular LinkedList in Java is implemented as a doubly linked list, which is cyclic.
Re:Why I’m dropping Rust by pjmlp on Monday September 12, 2016 @02:52AM (#12477705)
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 by topspin on Monday September 12, 2016 @01:33AM (#12477404)
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 microcontrollers, but today, when you find yourself using a "systems" language for non-toy work and you reach for a tool as sharp as a raw pointer, those naive data structures are frequently (usually?) inadequate.
Re:Why I’m dropping Rust by SamReidHughes on Monday September 12, 2016 @04:36AM (#12478062)
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 by jblow on Monday September 12, 2016 @10:53AM (#12480158)
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 by pcwalton on Sunday September 11, 2016 @09:04PM (#12476552)
> A lot of problems in Rust seem to involve replacing (smart) pointers with handles. Sometimes you really do want to do that, but it's bad if it's a necessary kludge.

It's not a kludge. It's how you prove to the compiler that you're using those structures safely.

If you aren't used to programming with compiler-enforced safety, you might be tempted to call working with the safety mechanisms a "kludge". But in reality all you're doing is doing things a little differently so that the compiler can ensure safety.

Re:Why I’m dropping Rust by barrkel on Sunday September 11, 2016 @08:47PM (#12476494)
Using handles / indexes instead of pointers is a type hole and introduces similar problems of memory safety through the back door. The problems will be semantic in nature rather than more fundamental but will still be bugs.

For the article author, I'd recommend going down a virtual DOM like approach rather than traditional OO toolkit. Rust meshes a bit more closely with functional ideas than OO.

Re:Why I’m dropping Rust by lmm on Sunday September 11, 2016 @05:06PM (#12475734)
My basic CS course was taught in Standard ML. Pointers are an implementation detail for the vast majority of CS.
Re:Why I’m dropping Rust by steveklabnik on Sunday September 11, 2016 @02:39PM (#12474874)
There are already some CS courses in Rust, Penn is running another one this upcoming semester.

(It's not a basic course, but you absolutely could.)

Re:Why I’m dropping Rust by eriknstr on Sunday September 11, 2016 @08:17PM (#12476405)
CIS 198 or something else? https://cis198-2016f.github.io/

I am currently "attending" the above mentioned course by following along online. I am enjoying it very much so far. There have been three assignments so far, the first of which was to get rust installed and such. I think it would take most of the HN crowd less than a week to catch up with the course so that they can follow it for the remainder of the semester, even if they have a day job. The most experienced programmers might be able to catch up within just a few hours.

The schedule at https://cis198-2016f.github.io/schedule/ has links to the slides, lecture notes and assignments.

Re:Why I’m dropping Rust by steveklabnik on Monday September 12, 2016 @02:30AM (#12477634)
That's the one!