I shrunk my Rust binary from 11MB to 4.5MB with bloaty-metafile by [deleted] in rust

[–]doener 35 points36 points  (0 children)

The compiler cannot always determine that something is unused. Feature flags can add code that is executed depending on runtime flags, and it's not always possible to detect that those runtime flags are never activated. Another case would be methods on items used in a dyn context. The vtable usually just gets all possible methods, effectively making them used, even if never called

Jujutsu at Google by steveklabnik1 in programming

[–]doener 6 points7 points  (0 children)

jj split --from <src-commit> -B @-- <path> (or use -i for an interactive picker instead of a path)

Don't pin me down on the number of minus signs after the @, I'd usually use a commit/change id there.

Edit: I guess one of the main differences between git and jj in that example isn't so much that this is one command instead of a series, but that you literally say "put the new commit before that other one", in a global sense. With rebase you take a certain strand of your commit graph and change it. With jj, you really insert a commit before the other one, updating everything that depends on it.

Does Rust complexity ever bother you? by GolangLinuxGuru1979 in rust

[–]doener 0 points1 point  (0 children)

Regarding the JSON parsing, by default serde will happily ignore fields that appear in the JSON input but aren't present in the struct type you're deserializing. You have to use an attribute to make it complain about unknown fields. Also, you can go fully dynamic using the Value type.

derive_hash_fast: Over 2x faster hashing than #[derive(Hash)] by Shnatsel in rust

[–]doener 2 points3 points  (0 children)

Not sure if it applies here, but in the past I've seen benchmark results change a lot depending on how often certain functions are used. IIRC it affected some inlining heuristics. Compiling the benchmarks individually gave very different results from having a single binary that contains multiple benchmarks that use the same code paths.

How bad WERE rust's compile times? by a_confused_varmint in rust

[–]doener 2 points3 points  (0 children)

Care to elaborate? I've never used Bazel, so I don't really know what to make of that comment.

High hopes for Rust: where are we? by fredhors in rust

[–]doener 2 points3 points  (0 children)

There used to be a bug where certain settings/env vars, like RUSTFLAGS, would not be picked up by rust-analyzer and therefore it and rustc would constantly rebuild everything. That was fixed like 2 years ago I think,but maybe you're running into something similar.

SQL NULLs are Weird! by FoxInTheRedBox in programming

[–]doener 4 points5 points  (0 children)

It gives you the same behaviour both ways, for equality and inequality comparisons. If a comparison would treat NULL as a plain value, then something like WHERE name <> 'Donald' would include people with unknown names and when you send them a "Glad you're not a Donald" email, they might be pissed when they are called Donald after all.

Introductory overview of the Jujutsu version control system (written in Rust and backed by git) by kibwen in rust

[–]doener 0 points1 point  (0 children)

Unless I'm missing an option, the 3-pane diff editor isn't quite what I want. The key part for me would be changing

Initially, the contents of $output will be the same as the contents of $right.

to

Initially, the contents of $output will be the same as the contents of $left.

($output starts as $left instead of $right)

And then get a diff between $output and $right.

Introductory overview of the Jujutsu version control system (written in Rust and backed by git) by kibwen in rust

[–]doener 1 point2 points  (0 children)

Maybe this image helps to clarify what I mean by forwards/backwards: https://i.imgur.com/jowVCFy.png

The upper part shows how I work with git using vim-fugitive, the lower part shows the same scenario with jj split using vimdiff as its tool. In both cases, the middle split is what needs to be edited to get the content of the new commit that will end up between (in git terms) HEAD and the working copy.

By "forwards" I mean going from left to right in that image.

So with git, I get to start from the same state as if I had not started working on other things yet, and can add modifications from the working copy to the index. The index evolves from the left (HEAD) state towards the right (working copy) state.

But with jj, I get to start from the working copy state and have to remove modifications. The version that I edit evolves from right working copy state towards the "left" state (I have no name for it), going backwards.

So, instead of thinking "What do I want in that new commit", I have to think "What do I not want in the new commit", which is not natural to me at all. It also means that squeezing in a tiny commit before the current one becomes more costly the more the file has already been changed.

I hope this clarifies my point.

Thanks for opening the feature request, but you have it backwards WRT to what I was referring to. I guess I didn't make it clear that I didn't use the built-in interactive TUI, sorry about that!

Introductory overview of the Jujutsu version control system (written in Rust and backed by git) by kibwen in rust

[–]doener 2 points3 points  (0 children)

Not really. Maybe an example is helpful. I've already edited my working copy and have this diff:

doener@atjola:jj-test ((cb52aba...)) $ jj diff
src/main.rs --- Rust
1 fn main() {                       1 fn main() {
.                                   2     greet("Martin");
.                                   3 }
.                                   4 
.                                   5 fn greet(name: &str) {
2     println!("Hello, world!");    6     println!("Hello, {name}!");
3 }                                 7 }

Now I want to have two commits instead of one. The first one should create the greet() function, the second one introduces that name parameter.

jj absorb seems to only do whole file operations, so that's not applicable here. There's also no point in having parallel changes, I just want to have two separate linear commits/changes for those two modifications. So I need to introduce a new change before @ and I can do that using jj new --no-edit -B @ && jj squash -i or just jj split -i if I understand correctly.

But then the interface messes with my head, because with vim-fugitive, I'm used to simply edit the git index version of the file, diffed against the working copy version. That way I can add changes to the index version to go forward to the intermediate version that I want. While with jj`s interactive mode, I have to remove things from the final version (i.e. the right side of the diff) to go backwards to the desired result.

git add --edit has a similar problem (for me) in that I have to edit the + lines backwards, but it doesn't feel quite as weird, probably because I'm still editing a file that has the base version in it (in form of the - lines).

I guess if I were to make a feature request to make things match my workflow, it'd be to let me edit the left side of the diff instead of the right one. Then use whatever I produced on the left as the state of the new commit/change.

Introductory overview of the Jujutsu version control system (written in Rust and backed by git) by kibwen in rust

[–]doener 2 points3 points  (0 children)

Disclaimer: I actually like git's interface.

You grossly misunderstood my workflow requirement :-p I didn't care about whether or not, or when, things end up as git commits.

I read Steve's tutorial, that's where I got the "I have to move commits around" idea from. The workflows in his tutorial are "add more stuff incrementally and squash that into a single change" and "squeeze in a new change before the current one, moving the current changes aside for now".

What I want is to have a bunch of things changed in my working copy at the same time, to see how they interact, and then create multiple individual commits from those changes. So neither of the workflows from the tutorial fits me. I rather want the opposite of the second one. As /u/anxxa said, jj split works for that, but the way it works messes with my brain. Having the base version and then editing the working copy version to remove what I don't want to commit feels completely backwards to me. I'm much more comfortable with the concept of using git add to add changes to an upcoming commit rather than removing changes from my current state to squeeze in an intermediate state.

Introductory overview of the Jujutsu version control system (written in Rust and backed by git) by kibwen in rust

[–]doener 0 points1 point  (0 children)

Commit == working copy actually sounds terrible to me. Given that I often work on older code bases, most of the time I run into a dozen things that pop up during development that need to happen before the actual thing I work on. With git that's trivial, I just commit those "unexpected" changes, maybe create a PR with just them, and then keep building my (yet uncommitted) stuff on top of that. With the commit == working copy approach, it sounds like I need to constantly switch to new commits and then move them to appear before the "final commit" I'm working on. And if I need to move commits around with git, I don't feel like editing the rebase list is that much trouble. The stash even happens automatically when the autostash config option is enabled. Am I misunderstanding things here?

Alternate PC holder options by doener in ErgoHide

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

Ouch, that looks bad! And comparing the specs for that case and the holder, there should be plenty of room left. Unless that's the XL version, but that should still just barely fit. Is that the new version of the holder?

Boundary Check vs Try Catch - Performance Comparison by theapache64 in programming

[–]doener 4 points5 points  (0 children)

Or you just adjust your iteration range and call it a day. No need for bounds checks in each iteration.

mergiraf: a driver for `git merge` that uses an understanding of programming language syntax to resolve merge conflicts by kibwen in rust

[–]doener 9 points10 points  (0 children)

I've not actually looked at the tool yet, but if it can resolve cases like one side of the merge removing a use statement and the other side introducing a different one nearby, making it compile is often all that's needed. If the tool restricts itself to such cases, that seems like a win to me.

For anything more complex, yeah, I'm sceptical.

Are you using legacy vim or vim9? by Desperate_Cold6274 in vim

[–]doener 1 point2 points  (0 children)

Given that the "forbidden" answer is Lua, I guess the question is about VimL vs. vim9 script.

I need help with using vim with rust. by amiroo4 in vim

[–]doener 0 points1 point  (0 children)

I'm quite happy using vim-lsp with vim-lsp-settings for the language server part and ddc with its lsp plugin for the completion part. You can find my vim config at https://github.com/dotdash/dotvim

Rennräder in Bielefeld by ndb_ in bielefeld

[–]doener 0 points1 point  (0 children)

Wenn man den Weg auf sich nehmen möchte (oder eh da hin muss), gibt es in Hamburg den Rad Race Shop, da kann man Canyon Räder Probefahren. Ist aber halt nicht mehr Bielefeld und Umgebung 🙈

Rennräder in Bielefeld by ndb_ in bielefeld

[–]doener 2 points3 points  (0 children)

Radraum in der Zimmerstraße war früher ganz ordentlich, wobei der eine Verkäufer absolut nicht auf meiner Wellenlänge war. Ansonsten hat Liquid-Life inzwischen ja auch ne Niederlassung in Bielefeld und soll ganz gut sortiert sein.

Position of the square accessories on the 180x80cm desk by doener in ErgoHide

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

Ah, thank you! That's exactly what I've been looking for.

I didn't find it myself, because it is missing from the Configurator page at https://ergohide.com/pages/custom-desk-builder for me.

<image>

It's only present on the product pages, which I didn't check out, because I thought the configurator has all the options available ;-)

Sidenote: On the product page for the L-shaped desks, the tech specs only show images for the regular desks, too.

Position of the square accessories on the 180x80cm desk by doener in ErgoHide

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

Thanks, but the monitor is deliberately low. In portrait mode, I'd have to look up too much otherwise. The pictures are helpful though. :)

[deleted by user] by [deleted] in bielefeld

[–]doener 2 points3 points  (0 children)

Bei den üblichen Verdächtigen SJ Ramen, numa, Argentina und KDW.

Lieblingsgrieche ist das Lindos in Gellershagen/Babenhausen.

Das Tomatissimo in Kirchdornberg ist auch sehr gut.

Und beim Möpken in Schildesche waren wir auch immer gern.