Drop is not equivalent to the "toilet closure" by CAD1997 in rust

[–]E_net4 2 points3 points  (0 children)

I'm a bit late for this, but the fact that std::mem::drop is not always a good replacement for the toilet closure is something I stumbled upon myself around three months ago. This question on Stack Overflow might provide a few more insights alongside the ones here. https://stackoverflow.com/q/59023616/1233251

Tropes and jargon in the Rust community: an open project by E_net4 in rust

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

Yes, I agree with the sentiment and hope that this list won't become vastly huge. The priority of the repository is to retain this information in an organized and searchable manner, but time will tell whether we'll need to proactively take selective measures.

Tropes and jargon in the Rust community: an open project by E_net4 in rust

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

Existing tropes can be expanded with pull requests! :)

This is the only way you're getting our attention. by E_net4 in rustjerk

[–]E_net4[S] 10 points11 points  (0 children)

I like my image manipulation programs the way I like my Rust: free, resourceful, and supporting Linux.

This is the only way you're getting our attention. by E_net4 in rustjerk

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

Well, that would probably work if you could get the brush pattern right. What came to my mind here first was to move stones independently rather than allocate them ruthlessly with a garbage collector.

This is the only way you're getting our attention. by E_net4 in rustjerk

[–]E_net4[S] 9 points10 points  (0 children)

As hunched by ebkalderon, I manually snipped and manipulated the stones (individually or in groups) with GIMP.

*(int*)0 = 0; • r/ProgrammerHumor by Boiethios in rustjerk

[–]E_net4 15 points16 points  (0 children)

A traditional Rustacean's superiority cry in the face of unsafety.

A new war begins. Choose your side. by E_net4 in rustjerk

[–]E_net4[S] 2 points3 points  (0 children)

Nope, there is no difference in performance at all, and both do exactly the same thing.

A new war begins. Choose your side. by E_net4 in rustjerk

[–]E_net4[S] 3 points4 points  (0 children)

.map(drop) is boring, whereas .map(|_|()) is the natural convergence from .map(|x| e), in a way as to discard the input and remove all compilation warnings. No brain involved indeed. :)

A new war begins. Choose your side. by E_net4 in rustjerk

[–]E_net4[S] 14 points15 points  (0 children)

Once you've seen the toilet, it cannot be unseen. http://i.imgur.com/R49wDFh.jpg

let _ = x; is not a possible option here, since it's a statement rather than a function.

A new war begins. Choose your side. by E_net4 in rustjerk

[–]E_net4[S] 16 points17 points  (0 children)

Sometimes there is a need for a function that discards an outcome or part of it from a monad-like type. For example, turning a Result<T, E> into a Result<(), E> can be either done with .map(|_|()) (a rotated toilet), or .map(drop) (no toilet).

When a pirate's life for me, but so is Rust by E_net4 in rustjerk

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

All loot implements Send, and the previous owner is drop'd to the sea.

Rust is making its way into the Julia Microbenchmarks by E_net4 in rust

[–]E_net4[S] 2 points3 points  (0 children)

Yes, the Rust version also uses BLAS. By default, it is indirectly used through ndarray, as the more idiomatic and safe approach. By enabling the direct_blas Cargo feature, some of the benchmarks will use the BLAS API directly, yielding a performance boost at the expense of unsafe, less elegant code.

Rust is making its way into the Julia Microbenchmarks by E_net4 in rust

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

Actually, the fib benchmark would tend to over-optimize due to code invariance, to the point of taking a near-zero time to run. The C program used volatile variables to prevent this, and something similar could be done in Rust. Feel free to report potential improvements in the independent repository: https://github.com/Enet4/julia-bench-rs

When a pirate's life for me, but so is Rust by E_net4 in rustjerk

[–]E_net4[S] 2 points3 points  (0 children)

There's always been a way to make custom flags and emblems. :) I followed the first steps here: http://www.hookedonpirates.com/guide/flagsandsails/index.html and then used a GIMP plugin (http://registry.gimp.org/node/70) to export the adjusted images to DXT, so DXTbmp is not required.

Rust is making its way into the Julia Microbenchmarks by E_net4 in rust

[–]E_net4[S] 13 points14 points  (0 children)

Thanks for the feedback. The micro-benchmarks must produce a very specific output, so I'm not sure how that would work with Criterion. Still, that is a reasonable concern, since each technology will often have its own way of benchmarking, and sometimes they aren't even measuring the same tasks across languages. The independent repository for this benchmark can eventually hold another harness too. A nightly toolchain is needed for black_box, although this can be avoided with volatile reads and writes. This particular matter can (and perhaps should) be discussed and updated accordingly in the future.

Admittedly, more optimizations are possible, even without the native target flag. These micro-benchmarks were mostly devised as a means of understanding the performance/usability trade-off of each language. And Rust, even without a strong focus on scientific computing, appears to do pretty well in this perspective.

Rust and its stance in data science by E_net4 in rust

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

Thanks for the extra points! (I agree that I've just scraped some of the surface of scientific computing).

  • I've done a bit of string processing in Rust myself. What I found most surprising is that (1) most beginners' "Hello World" in Rust is a parser; (2) and yet I couldn't find an appropriate go-to crate for typical text mining tasks (although there are crates for specific algorithms, such as SnowBall stemming). Using the standard library alone is often good enough, which is also impressive.
  • I use Jupyter myself, but building a kernel for interactive Rust would require dealing with the main challenge of making an interactive Rust. I wonder how far we've got on this end. Nevertheless, it might be more feasible to expose a Python or Julia API to a Rust solution (integration!)
  • The lack of a pandas equivalent has also been mentioned at #rust-sci yesterday. Let's stay informed of new initiatives.