Posts
179
Following
26
Followers
383
@joel_linux @ljs there's no good heuristic, either you have write fair or write unfair. There's one good alternative, and you already know what that is. šŸ˜‰
0
0
3
@joel_linux @ljs
It's not about performance, it's about not locking up the system. rwlocks are short and fast because they can't be preempted so new readers can still block writers. rwsems can sleep so it's much more likely to have writer starvation.
0
0
2
Happy New Year to the new force of social media!
0
0
5

I also want to state that I do not dislike Rust. This is just me ranting about things I have grown accustom to as a developer whoā€™s main programming language has been C for over 3 decades!

0
1
3

@jose_exposito As Rust is really good at inferring logic, Iā€™m surprised that it couldnā€™t just infer the PartialEq trait for simple enums.

0
0
0

@michaelphamct @acmel I will admit that I should have just started to learn to program Rust before learning the details of its implementation. But, here I am ;-)

0
1
2

@michaelphamct @acmel

Yes, your book is probably better to learn the language. And I wouldnā€™t recommend the book Iā€™m using to just learn to program in Rust. But I like the book, because I am interested in how rust works. I want to get as good at rust as I am with C. With most C programs, I can usually visualize what the assembly output would be. I donā€™t have that with Rust. And this book is useful to have in order to get that kind of understanding of the language.

1
0
2

@jose_exposito That should be the default. Iā€™m finding that Iā€™ll be adding lots of #[derive(...)] all over the place.

0
0
0

@vbabka OK, i got recursion working. I donā€™t know what went wrong before. Perhaps it detected right away that a bug in my code would do an infinite recursion and failed out. Unfortunately, it didnā€™t quite tell me what that infinite condition was :-(

1
0
1

Although Iā€™m ranting here, I also want to add what I really like. The RUST_BACKTRACE environment variable creating a nice backtrace on assert!() errors, is really nice!

0
1
2

Another annoyance is that you canā€™t compare enums.

use self::Direction::*;
enum Direction { UP, DOWN, LEFT, RIGHT};

fn foo (dir: Direction) {
     if (dir == DOWN) { ... }  <<--- Error!
}

But instead you must do:

   if matches!(dir, DOWN) { ... }
0
0
1

@aissen Moves something ;-)

0
0
0

@vbabka I immediately got a ā€œStack overflowā€ and the println! only went 3 deep. Maybe it was smarter to know it would go further?

1
0
0

@acmel Rust is very much becoming dominate (especially by my employer). I like the guarantees that Rust brings, so Iā€™m working on learning it. I bought a book on Rust, which really gets into the details of the language, but honestly, isnā€™t a good way to learn the language. I found that learning by example is a much better approach.

I have a non trivial program Iā€™m writing (it was one of the programs I had to write for my interview), and Iā€™m hitting all the fun corner cases with it. Iā€™m trying hard to keep an open mind, but for someone thatā€™s been programming C for over 3 decades, itā€™s really hard to do so. ;-)

0
0
1

@ljs @acmel I thought that cover said SYSTEM ADMIN

0
0
2

And today I learn that Rust does not like recursive functions :-(

(In user space, Iā€™m recursive function happy!)

1
0
1

@acmel @ljs I was thinking of shimmy()

0
0
1

Continuing my Rust Rants :-)

Itā€™s unfortunate that move is a keyword. As I write my little programs, I found that thatā€™s a common function name I use. Now I need to come up with something else. adjust ?

4
0
0
@mripard also, this is really the exception and not the norm. I find saving these programs in subversion (svn) is more convenient than git. It's best with a central repository than trying to keep several machines in sync.
0
0
0
@mripard I totally agree, and why I've been an advocate. But I like to write these small programs, sometimes to just learn and sometimes to do a small job. All these are mostly throwaway code (but I keep for reference). In this case C/make is so much more convenient than Rust/cargo.
1
0
0
Show older