HNHacker News
TopNewBestAskShowJobs

yb303

39 karma · joined July 7, 2021

submissionscomments
yb303··on Israeli-founded app preloaded on Samsung phones is attracting controversy
If you want to _really_ bar anything of Israeli origin, you should:

- Not use Intel processors, as many are developed in Haifa

- Not use a firewall. It was invented in the IDF.

- Not use Waze. It's Israeli.

- Not use thumb drives. Invented in Israel.

- Not eat cherry tomatoes. Israeli development.

The list goes on and on, but I must add - if you ever suffer a serious head or stomach injury, tell the medics to not use the Israeli bandage.

yb303··on Building a JavaScript Runtime using C
This is not "Building from scratch" This is just using.
yb303··on The Size of Packets
tldr- a document written in 2024 that does fit on my phone
yb303··on Better Shell History Search
Why dedup? Old forgotten things are as good as new :)
yb303··on Better Shell History Search
I have my own solution that I've been using for many years — I record all my bash history.

Bash has a hook (cannot remember the name on my phone) that is called on every command.

It's easy enough to write into a file the command together with the directory and git branch.

Then I can grep it with a bash function that colors the dir and branch in the output.

It does not replace ctrl-r but it's a great addition especially when running multiple sessions and bash saving just the last one

yb303··on Orbit: C/C++ Performance Profiler
Why does it sound like a remake of FlameGraph?
yb303··on GPT-4 “discovered” the same sorting algorithm as AlphaDev by removing “mov S P”
It didn't discover anything. It only minces words it found online up to 2021.
yb303··on Putin gives eight gold rings to presidents of CIS countries, keeps ninth
In the original story they became Nazgûl after receiving the rings
yb303··on When Is JIT Faster Than a Compiler?
The article says: "So when you change what + means, it will throw away all those methods it compiled with the old definition. Poof. Gone."

Is this enough? What about the function's side effects? If the function changed 1000 variables with the wrong + definition, is it going to roll them back?

yb303··on Performance comparison: counting words in Python, C/C++, Awk, Rust, and more
That's not the point. It's perfectly safe and there's nothing else in C. The point is you don't have to call this function for every single word. It takes time and pointer increment doesn't
yb303··on Performance comparison: counting words in Python, C/C++, Awk, Rust, and more
Another 1 minute lookin... multiplication on every byte.. really? If this is supposed to be fast, get one big buffer for the words. Get another if you run out. The hash function can be the word itself for words up to length 8. Longer words would need a mult per 8 bytes. You can do branchless strchr. Roll your own memmove - just always copy 24 bytes and terminate at the length you already know. The whole point of using C or C++ is that you can do non idiomatic things when you have to.
yb303··on Performance comparison: counting words in Python, C/C++, Awk, Rust, and more
I had a 1 minute look at the "optimized" C code - it's calling malloc for every word.
yb303··on Turning nuclear waste into diamond batteries
After death, the person will be giving back his/hers "water of life", like in Dune, to be reused by others :)