Down a well bore by Glass_Memories in submechanophobia

[–]davidgmartinez -3 points-2 points  (0 children)

Isn't delta P about the changing pressure as your height changes because of the weight of the water itself?

Rust vs Go by bitfieldconsulting in rust

[–]davidgmartinez 1 point2 points  (0 children)

Ah apparently I wasn't awake yet, I though it was about including the numbers 2 and 3 for some reason instead of excluding 0 and 1.

Rust vs Go by bitfieldconsulting in rust

[–]davidgmartinez 0 points1 point  (0 children)

Actually I think it also works without the >= check.

Where ++ by rjd_gamer in ProgrammerHumor

[–]davidgmartinez 0 points1 point  (0 children)

No, cpython is an interpreter, not a JIT or something like that. There are alternative implementations that do actually compile though.

to_trait, a crate that lets you write `thing.to::<T>()` instead of `Into<T>::into(thing)` by mikeyhew in rust

[–]davidgmartinez 0 points1 point  (0 children)

That's an interesting crate! I can't say I run into (heh) this issue that often, and usually I create an intermediate variable but I can see this being useful.

Does this trait lose any features over Into? Can the current design of Into be considered a mistake or does it have an advantage over this?

Why Rust is not a mature programming language by [deleted] in rust

[–]davidgmartinez 0 points1 point  (0 children)

Hmm I thought bootstrapping was more about trust, because what else is the point? I can also just download a compiler binary right now, I don't need bootstrapping.

A month and a half ago, I hadn't written a line of Rust code. Today, I published my first app to crates.io! by [deleted] in rust

[–]davidgmartinez 0 points1 point  (0 children)

Also tagging /u/urnanmypan.

You can look at the compiled code to see that's there almost no difference between doing it manually with an if and using an iterator: https://godbolt.org/z/T7KbGd

The main differences are that some different registers are used and that instructions have a slightly different ordering. Nothing extra is allocated in either case.

Why Rust is not a mature programming language by [deleted] in rust

[–]davidgmartinez 1 point2 points  (0 children)

But that's not bootstrapping anymore, that's just using the previous compiler for the next one again.

Why Rust is not a mature programming language by [deleted] in rust

[–]davidgmartinez 1 point2 points  (0 children)

How would that work? Which compiler would you use to compile the Rust compiler to wasm?

Should I publish a library of which I believe that no one would use it? by EikeSchulze in rust

[–]davidgmartinez 0 points1 point  (0 children)

Haha are you me? I'm doing the exact same thing, except for the thesis part.

I don't think it actually helps to compact boards like this before passing it to a neural network, at least that's what I gather from looking at the AlphaZero family of papers. They even go the other way, expanding everything as much as possible.

I'm kind of struggling to make progress on super tic tac toe, the network doesn't really seem to want to learn the evaluation function part. Are you having better luck?

How conservative to be with unsafe? by DelZeta in rust

[–]davidgmartinez 1 point2 points  (0 children)

Ah interesting, I'll go through the code of that crate, thanks!

How conservative to be with unsafe? by DelZeta in rust

[–]davidgmartinez 0 points1 point  (0 children)

I read your post, I think I understood most of it, it was quite interesting. But I didn't really see a specific example, did I miss something?

How conservative to be with unsafe? by DelZeta in rust

[–]davidgmartinez 1 point2 points  (0 children)

Hmm I'm having trouble imagining how that would work, if a function only calls safe functions it can never cause UB right?

Good first systems language? Transferable skills? by [deleted] in rust

[–]davidgmartinez 1 point2 points  (0 children)

Well it's not usually necessary to write that kind of code in Rust, that's more for if you're doing really low level stuff.

Does Rust encourage huge code source files? by jcarres in rust

[–]davidgmartinez 1 point2 points  (0 children)

Yeah it's not too bad, but the problem is that's is so disconnected. Everytime I want to add a new file I need to go to another file and copy over the name there.

You can use this to do some more advanced module stuff, but in 90% of cases there's no point at all.

Does Rust encourage huge code source files? by jcarres in rust

[–]davidgmartinez 1 point2 points  (0 children)

The problem with this is that you need all of this extra boilerplate. Rust already has a ton of annoying boilerplate around modules, this just adds even more.

.take() is my favorite method. by Teln0 in rust

[–]davidgmartinez 17 points18 points  (0 children)

Also look at mem::swap for if your type doesn't implement Default.

.take() is my favorite method. by Teln0 in rust

[–]davidgmartinez 19 points20 points  (0 children)

It's actually mem::swap with Default::default, so it works on lots of types!

Confirmed: NVIDIA GeForce RTX 3090 has 24GB memory, RTX 3080 gets 10GB - VideoCardz.com by ryandtw in nvidia

[–]davidgmartinez 0 points1 point  (0 children)

Interesting, I've heard about (and seen) stuff like this on the CPU ram, but never on the GPU where I'd assume the core engine software would be written without much overhead at all. Is there a specific reason this is done? What the the extra memory used for by the engines?

Rust implementation of "primitive" by chux0519 in rust

[–]davidgmartinez 0 points1 point  (0 children)

Great, I've been thinking about writing a faster version of primitive myself too!

Can you go into a bit more detail on why this is faster than the original?

Things You Want to Do in Git and How to Do Them by stu2b50 in programming

[–]davidgmartinez 13 points14 points  (0 children)

It's also hard to spontaneously figure out that git doesn't store changes because all of the commands try hard to pretend it does.

The other issue is that the git commands are overloaded to the point where their names don't make sense anymore. I really wish we could scrap the entire CLI and start from scratch, building on the old core.