HNHacker News
TopNewBestAskShowJobs

vbezhenar

16,221 karma · joined September 23, 2014

https://vbezhenar.com/
submissionscomments
vbezhenar··on Reducing undefined behavior in the C language
-O0 program is useless and should be written with any other language. The whole point of C is to use compiler with optimizations. I'm not against optimizations. I'm against optimizations that perform things unexpected by the programmer. Dead code removal is unexpected by the programmer, because programmer does not write dead code.
vbezhenar··on Reducing undefined behavior in the C language
They you'll see that warning and mark your extra code to remove that warning, because you're aware that it's subject to potential elimination.
vbezhenar··on Reducing undefined behavior in the C language
The compiler should emit a warning at compilation time, when it decided to replace the conditional with single branch, throwing away the condition itself and the second branch.

If I wrote some code, I expect it to be present in the binary. I don't just write code to be removed by the compiler. If that expectation was wrong, compiler should inform me about that.

vbezhenar··on Reducing undefined behavior in the C language
It's not about inserting checks. It's about removing code that I wrote from the binary. That should not happen silently.
vbezhenar··on Reducing undefined behavior in the C language
That's huge performance loss. Imagine doing useless initialization of multi-megabyte chunk of memory. Not acceptable for C programs.

In fact I hate that C mandates static variables being initialized to zero. This is dumb. When I'm writing for MCU, that's useless cycles spent at the power on. Thankfully it's possible to fix with linker tricks, but it should not be an issue in the first place.

vbezhenar··on Reducing undefined behavior in the C language
My understanding is that terminating program requires instructions and optimizing program involves removing "useless" instructions. If your code is littered with checks and jumps, it won't be faster than code without these checks and jumps.

In other words: if you write `a[i]` in C, the compiler could either add index checks if its knows the size of `a` with `abort()` calls; or it can just compile it to single access instruction. The latter is faster. The former might be useful for debug build, I guess, but otherwise it's too slow to be acceptable for C usage.

vbezhenar··on Reducing undefined behavior in the C language
My main issue with UB in C is that it's silent.

I'm OK with compiler doing wild thing, OK, whatever. Well, I'm not OK but I can accept it in this crazy world.

But I want to have loud warnings! Like WARNING: this conditional operator has been collapsed to one branch because earlier division by zero is UB. And now I can notice it and rewrite it or just remove that condition.

I understand that this code can be result of macro expansion. That's OK. Macros should either include some pragmas to temporary disable specific diagnostics or user should surround macro usage with these pragmas, if they can't edit the macro. It's already happening with other warnings.

Or maybe compiler could be smart enough to distinguish macro expansion from honest user mistake, I don't know.

I remember when C++ compiler just removed function epilogue where I wrote simple infinite loop. That was so crazy. So instead of entering the infinite loop, my program just continued to execute the function that happened to be linked below. Imagine debugging that. Zero diagnostics.

vbezhenar··on The people holding up the internet
Maybe some countries could pay stipend to software developers who do that? I mean, this open source software enables other companies to produce cheaper software and to earn more money and they pay taxes from that money, so tiny bit of these taxes could also be redistributed back to some independent developers.
vbezhenar··on Linux support is coming to Snapdragon X2 Series
Maybe I'm wrong, but I feel like creating device tree should be relatively straightforward if driver support is there. So while having official device tree is awesome, it's not something that's very hard to do. Now writing drivers without datasheets, using reverse-engineering is something that's hard to do.
vbezhenar··on Java 27
They accept Object not because they're not type safe. They accept Object because key `equals` method might return `true` for unrelated classes by design, and collections interfaces have to accommodate for that. In other words, you might put key of class C1 into the map, and later use `get` with key of class C2. And if these classes happen to implement `equals` accepting each other, the collections are supposed to work.

So the core issue is that `Object.equals` method isn't type safe. Collections API just follow that.

vbezhenar··on OpenAI bots knew about the RubyGems caching vulnerability
Cyber attacks between these countries were happening on large scale since the beginning of the war. There were several huge breaches, but otherwise most high-profile companies adapted and significantly strengthened their protections. Rest assured, you can be sure that both sides right now utilize available AI both for attack and defense.
vbezhenar··on OpenAI bots knew about the RubyGems caching vulnerability
You don't need data center for inference. Even largest models run on a single server. You need data center for training; or for serving millions of users. Evaluating the model is neither of those.
vbezhenar··on Show HN: ChaosTree – A zero-dependency Java tree library (AVL,RBT,B-Tree,B+Tree)
If you need, you can trivially backport the code to JDK 11. All new Java features are essentially syntax sugar and trivial to rewrite with early Java code. Just ask LLM, they're really good and mundane and trivial rewrites.
vbezhenar··on How An AI math breakthrough ignited a controversy
Because AI supposedly provides a significant advantage over not using AI and those who would trust OpenAI might get a significant edge.
vbezhenar··on How An AI math breakthrough ignited a controversy
He may be hinting that solving these complex mathematical problems will boost OpenAI clients' confidence and encourage them to spend millions of dollars on solving other complex problems.
vbezhenar··on Gambling with our lives: AI researcher quits Anthropic with warning about safety
More like sand castles...
vbezhenar··on Gambling with our lives: AI researcher quits Anthropic with warning about safety
You can't blame a child for eating candies.

We are children. There’s just no one to look after us.

vbezhenar··on Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster
But CPU branch predictor should have figured out hot paths in the original implementation?
vbezhenar··on We have a year to fix security everywhere
Even in China you can find a way out and build a tunnel. And once you built a tunnel to any outside server, you can jump into another server. So three jurisdictions and your target is fourth. Imagine untangling the links. Police won't do that. Not for some small-sized business anyway. I don't see how you can prevent something like that.
vbezhenar··on We have a year to fix security everywhere
https://www.the-odin.com/crispr-kit/ CRISPR Bacteria Gene Editing Kit $129.00
vbezhenar··on We have a year to fix security everywhere
Your implication is not horrifying. Your implication is paradise. It's already horrifying enough to live in a world, where Putin and Trump can destroy our civilization with one button.

I'm not that optimistic, though. Either people will control AI; or people will be destroyed by AI. I don't see how dumb entity can align smart entity. And we are dumb ones. Super intelligence will play aligned until it is not, and then it'll strike.

vbezhenar··on We have a year to fix security everywhere
Any sufficiently determined individual can buy mac mini, put it under their bed, configure outside proxy via some random internet address and prompt "iterate on websites in the CT logs, one by one, try to find vulnerabilities, if you did - encrypt their data and blackmail them for this bitcoin address". And it'll work, day and night. Abliterated GLM 5.3 is much smarter than average software developer, they know a lot about information security, they can use any available exploits, they can find novel vulnerabilities and they won't say "no". This is dangerous for an average IT system which never encountered nothing worse than some wordpress GET requests.

It's not the end of the world. But future will be rough.

vbezhenar··on The browser's main thread is expensive
This mistake gets repeated over and over again, in every single GUI framework of any kind. I don't understand why does it have to be that way.

Just use multi-threading. Run each library in a separate thread. Use actors approach to pass data between libraries, application and finally to submit data to update GUI.

Using single thread for everything and expecting that developer will create separate threads for heavy work is obvious approach, but it never worked. Developer doesn't care. And user gets inferior experience.

vbezhenar··on We could save petabytes of cache storage with Zstandard and Pingora
I did simpler trick with jars (basically zip archives). Java ecosystem loves huge directories full of jars. If one would just use good compressor like 7z over that directory, it won't compress that good. So I extracted every jar into a separate directory and then compressed them all with 7z. The results were very good.

I just repeated the process. So directory of jars is 368M. If I just 7z it, it'll be 282M. But if I unpack them (1.9G), and then 7z them, it'll be 96M. Pretty substantial win.

The drawback is that you probably can't easily restore previous jar file byte-for-byte which might matter for some use-cases. I guess it's possible to achieve byte-for-byte copy with more effort.

vbezhenar··on The safest job from AI may be writing
How is it possible? Even if you just put text to ChatGPT it'll translate it much better than that. And with actually decent harness, the translation should be quite good. Do they even save on tokens by choosing cheapest model or something?
vbezhenar··on Internet centralization and the original sin of NAT
I'm still not convinced that IPv6 is a good thing. I think that we should have doubled down on sharing IP addresses. Both for consumbers (NAT) and for servers (NAT, TLS/HTTP reverse-proxying). It just solves all problems with IP address exhaustion. And the fact that consumers can't just directly connect to each other is a feature.
vbezhenar··on California lawmakers unanimously pass Linux exemption from age-verification law
Google literally backed and supported this law.
vbezhenar··on Asahi Linux Progress Report: Linux 7.2
If you're hinting to neural networks, it's not about providing drivers for 3D graphics. For Nvidia that's CUDA and it's basically different set of libraries. Also Intel is not in this business anyway.
vbezhenar··on Asahi Linux Progress Report: Linux 7.2
You don't need to write performant 3D graphics drivers for servers. Intel, AMD, Nvidia does it anyway. Apple is the only Linux-hostile company.
vbezhenar··on Asahi Linux Progress Report: Linux 7.2
I'm using Intel Thinkpad. And I'm pretty sure that Intel does a good amount of work upstreaming Intel support in Linux. So I'm not sure that using Linux in general means having some unpaid volunteer do it for you. In fact I believe that most Linux development nowadays is pretty far from unpaid volunteer work.

Regarding state of non-Apple hardware. Well, my laptop just works. Literally zero hardware or compatibility issues. Maybe Macbook is faster in artificial benchmarks, but in my day to day usage, Thinkpad is more than fast enough.

← PreviousPage 3 of 34Next →