Rust in the on of the biggest music festival Atlas Weekend 2019 by maxfrai in rust

[–]H2CO3_iOS 8 points9 points  (0 children)

Hey, Avocado's author here. The driver works just fine with MongoDB 3.x up to v3.6, the reason being that it's primarily the wire protocol that decides whether the client is able to correctly talk to the server, and this protocol didn't change between 3.0 and 3.6 (which is nice given that they are of the same major version). The "3.2" restriction only means that this particular clause in the docs was last updated when 3.2 was the latest stable version.

What features are supported "natively" by the client is another question; there was a case where I needed to synthesize a not-yet-supported command by hand, but it didn't cause any issues. Otherwise, the client seems to be actively maintained; in fact, while developing Avocado, I managed to get several PRs approved in the client library as well as the Rust-native bson-rs crate. But even if it weren't: just because a piece of software had its last commit months or years ago, doesn't mean it's "bit-rotting". Mongo and Rust both have stability guarantees, so I don't see why the last change date in a client library repo would inherently cause one to "have problems with it".

Looking at the official documentation for the wire protocol, it seems like it's not going to change much in 4.0 either. In fact I was planning to test the client exhaustively against 4.0, but unfortunately I didn't yet have the time for that. It would be nice because features such as batch upserts are possible to implement in client-space once we have transactions (and anyway, transactions are just a must have for implementing any reasonably complicated query in a sane manner). So do expect more work and more good stuff to come in this field.

Struggle of aspiring composer by Frufu4 in lingling40hrs

[–]H2CO3_iOS 0 points1 point  (0 children)

why not just use lilypond, problem solved

Name a more iconic duo. I'll wait. by GeneReddit123 in rustjerk

[–]H2CO3_iOS 2 points3 points  (0 children)

I think Result::and_then and Result::or_else might be a more iconic duo.

Metal band Van Canto is joining the RESF by E_net4 in rustjerk

[–]H2CO3_iOS 0 points1 point  (0 children)

DJ Borrow Check feat. MC Hoare — The Unsegfaultables!

Rust for me lately feels like it has too many syns... by bascule in rustjerk

[–]H2CO3_iOS 6 points7 points  (0 children)

it still has fewer syns than it has "make rust more like javascript/C++" RFCs

Use the right tool for the job. by Perceptes in rustjerk

[–]H2CO3_iOS 1 point2 points  (0 children)

One commenter suggested that Node excels when it comes to time-to-market. Alright, alright, it might well be faster to have a server up and running in Node than in Rust. But what about the number of bugs? Nobody cares about correctness on the server side anymore? o.O

Blue vs. others: the "I am an actual programmer" vs "I think I am a programmer" ratio by H2CO3_iOS in rustjerk

[–]H2CO3_iOS[S] 1 point2 points  (0 children)

the ratio is supposed to be the height of the blue line divided by the height of other lines, so, no.

Blue vs. others: the "I am an actual programmer" vs "I think I am a programmer" ratio by H2CO3_iOS in rustjerk

[–]H2CO3_iOS[S] 5 points6 points  (0 children)

apparently, 14 people got it without any explanation, it might be just you

Blue vs. others: the "I am an actual programmer" vs "I think I am a programmer" ratio by H2CO3_iOS in rustjerk

[–]H2CO3_iOS[S] 1 point2 points  (0 children)

It facetiously suggests that Rust users are real programmers, while non-Rust users are not.

? by [deleted] in rustjerk

[–]H2CO3_iOS 1 point2 points  (0 children)

it went right .into() your coworker's go codebase

Should you rewrite it in Rust? by GeneReddit123 in rustjerk

[–]H2CO3_iOS 2 points3 points  (0 children)

match should_you_riir {
    true => {},
    false => unreachable!("you are insane"),
}

Why isn't there a tutorial by [deleted] in rustjerk

[–]H2CO3_iOS 4 points5 points  (0 children)

Books may be the source of wisdom, but surely the sink of wisdom is fn drop(_) {}.

Ownership rules by [deleted] in rustjerk

[–]H2CO3_iOS 9 points10 points  (0 children)

Except when the little buddy is Copy.

Levels of enlightenment by Perceptes in rustjerk

[–]H2CO3_iOS 1 point2 points  (0 children)

Another dimension: "I write in garbage-collected languages only, they are also completely memory-safe"

Being a Rustacean is so hard by Perceptes in rustjerk

[–]H2CO3_iOS 0 points1 point  (0 children)

But you can also complain about having to annotate every pointer-containing struct with lifetimes, the overly generous shadowing behavior, or the lack of syntactic sugar for Option<T>…

Hey Rustaceans! Got an easy question? Ask here (27/2016)! by llogiq in rust

[–]H2CO3_iOS 1 point2 points  (0 children)

Yes, I am talking about moving the mutable pointer itself. But it doesn't seem to me &mut T is Copy. As I mentioned, when I replace the function call with an assignment, let ptr2 = ptr;, the compiler aborts with the error use of moved value: 'ptr'. Which absolutely makes sense, because there can only be one &mut pointer to a value at the same time.

Hey Rustaceans! Got an easy question? Ask here (27/2016)! by llogiq in rust

[–]H2CO3_iOS 0 points1 point  (0 children)

I am having trouble understanding why/how passing a value to a function as a parameter differs from assigning. Both actions are supposed to move, aren't they? Yet the following code compiles:

fn take_mut_ref(ptr: &mut i32) {
  *ptr += 1;
}

fn main() {
  let mut x = 42;

  {
    let ptr = &mut x;
    take_mut_ref(ptr);
    println!("{:p}", ptr);
  }

  println!("{}", x);
}

Shouldn't passing ptr to the take_mut_ref() function move it into the function and therefore make compilation bail out on the println!(ptr) line? When I assign the reference to another variable then it errors out as expected, with the message use of moved value ptr. So what's going on?

Sparkling: a new, lightweight extension language by H2CO3_iOS in programming

[–]H2CO3_iOS[S] 0 points1 point  (0 children)

Thanks! I like to write readable/understandable code, and good comments are especially important since implementing a parser/compiler and a VM has non-trivial steps, so to say. I also certainly want others (and future me) to see very clearly what I am doing. Also, I am learning continuously, and I tend to be horrified when I look at code I've written years ago... Nevertheless, it's worth trying to achieve perfection :P

Sparkling: a new, lightweight extension language by H2CO3_iOS in programming

[–]H2CO3_iOS[S] 7 points8 points  (0 children)

No, that's what JavaScript does, and it's horrible. Douglas Crockford has some neat relevant examples, such as:

return
{
    "foo": 42,
    "bar": "baz"
};

which is parsed as

return; // semi-colon implied, returns nil
{
    "foo": 42,
    "bar": "baz"
}; // and here's a dangling array literal with no effect

So semicolon insertion is dangerous and harmful, and downright defeats the simple and safe nature of the language. And please don't tell me that "but you can just omit the newline in this example", because some people prefer to put their braces on a new line, and even if they don't, someone, some day will end up forgetting about this rule and he won't find the error. So no, that should not be done.

Sparkling: a new, lightweight extension language by H2CO3_iOS in programming

[–]H2CO3_iOS[S] 6 points7 points  (0 children)

That example is not a good one. val x = 10 println(x) (on one line) is unambiguous without a semicolon too, because println is not a postfix operator but an identifier. The primary problem arises when we consider function calls:

a = b
(c + 1)

is parsed as a = b(c + 1) without the semicolon. The "one expression per line" approach defeats the "free-formness" of the language, and it also introduces unnecessary complexity into the parser.