trevor

joined 2 years ago
[–] trevor@lemmy.blahaj.zone 2 points 1 day ago* (last edited 1 day ago) (2 children)

Unless you're talking about some sort of reference counting, which has to be explicitly added by the programmer in cases where doing so is required for memory safety, I'm not sure what runtime checks you're referring to?

From what I've seen, the performance of programs written in C and Rust are generally the same, more or less, with C or Rust coming out on top with roughly coinflip odds in a handful of cases. This feels like the primary differentiator in performance really comes down to the implementation of the person writing it, and less to do with any performance differences inherent to either language.

[–] trevor@lemmy.blahaj.zone 1 points 1 day ago

The --stream functionality looks very useful as well. Super cool!

[–] trevor@lemmy.blahaj.zone 2 points 1 day ago

This is an awesome tool, and I love to see it get a Rust rewrite.

But the one thing I really wish it could do is embed properly in GitHub's markdown UI so that when I click them in READMEs it doesn't have to send me to the asciicinema site.

I'm sure that has way more to do with GitHub than it does asciicinema, but still, that's why I don't use it for my projects. I hope that can change one day.

[–] trevor@lemmy.blahaj.zone 7 points 2 days ago* (last edited 2 days ago) (1 children)

"Thing I say is good, is better than thing I say is mediocre."

Indeed.

[–] trevor@lemmy.blahaj.zone 15 points 2 days ago* (last edited 2 days ago) (4 children)

This is not true. If you know Rust and C equally well, you're likely going to write equally performant Rust.

You could say that Rust is harder to learn than C. I'd disagree based on my personal experience, but you wouldn't be wrong.

[–] trevor@lemmy.blahaj.zone 11 points 2 days ago (21 children)

I have no idea how. I write better Rust than I do C 🤷‍♂️

Rust and C are basically identical in terms of performance (more or less). Idk where the myth that Rust is somehow less performant than C came from.

[–] trevor@lemmy.blahaj.zone 37 points 2 days ago* (last edited 2 days ago) (37 children)

The ill-informed Rust hatred goes in the Phoronix comments. Rust isn't inherently slower than C. This was a bug.

[–] trevor@lemmy.blahaj.zone 2 points 1 week ago (1 children)

One thing I really miss from Unity is the efficient use of the top bar doubling as a title bar for full screen windows. I wish modern DEs would do this.

[–] trevor@lemmy.blahaj.zone 15 points 1 week ago (2 children)

Just here to add that, yes, Snaps are very broken. Do not use them if you value your time or well-being.

The annoying thing is that Canonical dishonestly co-opts your apt invocations for snap installations, so you're likely to waste hours of your life trying to figure out why the thing you installed doesn't work or takes forever to launch randomly. And they keep Snapifying more of their distro, so even things like GNOME packages are only available as Snaps.

[–] trevor@lemmy.blahaj.zone 14 points 1 week ago (3 children)

This is the first time I've heard "lint" used this way, but I like it. I've heard Linus refer to various waste left behind on your system as "turds" 💀

Anyway, this looks like a cool tool. Gonna check this out.

[–] trevor@lemmy.blahaj.zone 2 points 1 week ago (1 children)

I never used erdtree. What do you like about it that is different from eza?

[–] trevor@lemmy.blahaj.zone 8 points 1 week ago

Probably the same shit that Israeli fascists use on Palestinians.

1
submitted 2 years ago* (last edited 2 years ago) by trevor@lemmy.blahaj.zone to c/docker@programming.dev
 

I am looking for something that can take a Dockerfile, like the following as an input:


FROM --platform=linux/amd64 debian:latest
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y curl unzip libsecret-1-0 jq
COPY entrypoint.sh .
ENTRYPOINT [ "/entrypoint.sh" ]

And produce a a multi-stage Dockerfile where the last stage is built from scratch, with the dependencies for the script in the ENTRYPOINT (or CMD) copied over, like this:


FROM --platform=linux/amd64 debian:latest as builder
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y curl unzip libsecret-1-0 jq

FROM --platform=linux/amd64 scratch as app
SHELL ["/bin/bash"]

# the binaries executed in entrypoint.sh
COPY --from=builder /bin/bash /bin/bash
COPY --from=builder /usr/bin/curl /usr/bin/curl
COPY --from=builder /usr/bin/jq /usr/bin/jq
COPY --from=builder /usr/bin/sleep /usr/bin/sleep

# shared libraries of the binaries
COPY --from=builder /lib/x86_64-linux-gnu/libjq.so.1 /lib/x86_64-linux-gnu/libjq.so.1
COPY --from=builder /lib/x86_64-linux-gnu/libcurl.so.4 /lib/x86_64-linux-gnu/libcurl.so.4
COPY --from=builder /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
# ...a bunch of other shared libs...

# entrypoint
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]

I've had pretty decent success creating images like this manually (using ldd to find the dependencies) based on this blog. To my knowledge, there's nothing out there that automates producing an image built from scratch, specifically. If something like this doesn't exist, I'm willing to build it myself.

view more: next ›