Readit News logoReadit News
dubi_steinkek commented on Chromium Has Merged JpegXL   chromium-review.googlesou... · Posted by u/thunderbong
rafram · 2 months ago
> It's relatively new but Rust certainly calms security fears.

https://github.com/search?q=repo%3Alibjxl%2Fjxl-rs%20unsafe&...

dubi_steinkek · 2 months ago
That looks pretty good to me. Every `unsafe` function has clearly stated safety requirements, and every `unsafe` blocks justifies why the requirements are met.
dubi_steinkek commented on LLVM: The bad parts   npopov.com/2026/01/11/LLV... · Posted by u/vitaut
lenkite · 2 months ago
The Rust compiler also uses LLVM right ?
dubi_steinkek · 2 months ago
mainly, but it also supports alternative codegen backends (cranelift, rustc_codegen_gcc)
dubi_steinkek commented on How well do you know C++ auto type deduction?   volatileint.dev/posts/aut... · Posted by u/volatileint
jcelerier · 3 months ago
> But if vec contains eg long strings, you've now murdered your perf because you're copying them out of the array instead of grabbing refs.

I've seen much more perf-murdering things being caused by

   std::map<std::string, int> my_map;
   for(const std::pair<std::string, int>& v: my_map) {
       ...
   }
than with auto though

dubi_steinkek · 3 months ago
Why is this a perf footgun? As someone who doesn't write a lot of c++, I don't see anything intuitively wrong.

Is it that iterating over map yields something other than `std::pair`, but which can be converted to `std::pair` (with nontrivial cost) and that result is bound by reference?

dubi_steinkek commented on Java Hello World, LLVM Edition   javaadvent.com/2025/12/ja... · Posted by u/ingve
maccard · 3 months ago
So can a random deb, or npm package, or pip wheel? You’re either ok with executing unverified code or not - piping wget into bash doesn’t change that
dubi_steinkek · 3 months ago
Maybe they can with postinstall scripts, but they usually don't.

For the most part, installing packaged software simply extracts an archive to the filesystem, and you can uninstall using the standard method (apt remove, uv tool remove, ...).

Scripts are way less standardized. In this case it's not an argument about security, but about convenience and not messing up your system.

dubi_steinkek commented on Jujutsu worktrees are convenient (2024)   shaddy.dev/notes/jj-workt... · Posted by u/nvader
rk06 · 3 months ago
there is no difference as jj is only a frontend to git.

author me tions that git cli require multiple steps when there are unstaged changes.

I don't know if git has one liner cli command for it as i myself use gitextn to create worktrees

dubi_steinkek · 3 months ago
> there is no difference as jj is only a frontend to git.

That's not really true in this case, as the worktree feature from jujutsu is not implemented on top of git worktrees.

dubi_steinkek commented on Jujutsu for busy devs   maddie.wtf/posts/2025-07-... · Posted by u/Bogdanp
ants_everywhere · 8 months ago
You know your evangelists have gone haywire when they're explaining that your requirements are wrong instead of listening.
dubi_steinkek · 8 months ago
I don't think that's a fair characterization.

It's more that there isn't really a big difference between the workflow of

    # you're on
      staging area
    @ commit A
    # make some untracked changes and console logs you don't wanna commit
    git add -p && git commit # select only what you want
vs

    # you're on
    @ empty commit 
    | commit A
    # make some local changes (which are tracked in @)
    jj commit -i # select only what you want
You're still "in charge what gets tracked" if you treat the last @ commit as your local playground, exactly the same as the staging area. The only difference is that you can use exactly the same tools to manipulate your "staging area" as other commits. The only difference being that you can manipulate your staging area with the same tools as any other commit.

dubi_steinkek commented on Small Strings in Rust: smolstr vs. smartstring (2020)   fasterthanli.me/articles/... · Posted by u/airstrike
duped · 2 years ago
This is what the `AsRef` trait is great for

    impl AsRef<str> for MyCoolString {
        fn as_ref(&self) -> &str {
            ...
        }
    }
To be totally defensive, other library authors can write their APIs like

    fn my_cool_function(s: impl AsRef<str>) {
        let s: &str = s.as_ref();
    }
and now `s` is treated like any other &str. But even if library authors don't program defensively and use `s: &str` in the argument type, callers can always do this:

    my_cool_function(my_cool_string.as_ref());

dubi_steinkek · 2 years ago
It's possible but I would prefer to just pass &str at that point, leading to less monomorphizations and a simpler API
dubi_steinkek commented on 4B If Statements   andreasjhkarlsson.github.... · Posted by u/r4um
phkahler · 2 years ago
Same. When I was 12ish trying to write a Pac-Man game in basic, I dreaded writing the logic for the 4 ghosts. I'd need separate code for the ghosts at (x1,y1)....(x4,y4) and said to my dad it would be cool if I could use xn and yn inside a for loop, but those are just 2 more variables. I wanted n to indicate which one. This seemed kind of weird, but it's what I really really wanted. He grabbed the little basic book and showed me that x(n) was actually a thing!

I think back to this in discussions about teaching. Abstract concepts are best understood when the student has a legitimate need for them. You can explain something all day and have their eyes glaze over wondering why something is important, but if it solves a problem they have it will click in seconds or minutes.

dubi_steinkek · 2 years ago
This seems to be a somewhat common occurrence. When I was first learning programming with python I wanted multiple balls in a pong-like game, so after some googling I ended up writing something like `globals()["ball" + i]` until someone mentioned that arrays were a thing I could use for that.

u/dubi_steinkek

KarmaCake day36April 6, 2021View Original