Hacker Newsnew | past | comments | ask | show | jobs | submit | on_the_train's commentslogin

That's the reason why polymorphism is sometimes described as slow. It's not really slow... But it prevents inlining and therefore always is a function call as opposed to sometimes no function call. It's not the polymorphism is slow. It's that alternatives can sometimes compile to zero

Every 8 methods knock out at least 1 cache line for you (on x64, at least). You're probably not calling 8 adjacent methods on the same exact type either, you're probably doing something with a larger blast radius. Which means sacrificing even more of caches. And this doesn't show up in the microbenchmarks people normally write because they vtables are hot in the cache.

So you're really banking on this not affecting your program. Which it doesn't, if you keep it in mind and do it sparingly. But if you start making everything virtual it should hit you vs. merely making everything noinline.


On the other hand, if the compiler can prove at compile-time what type the object must have at run-time, it can eliminate the dynamic dispatch and effectively re-enable inlining.

Which is why runtime polymorphism in Rust is very hard to do. The its focus on zero-cost abstractions means that the natural way to write polymorphic code is compiled (and must be compiled) to static dispatch.

Compilers will also speculatively devirtualize under some circumstances.

https://hubicka.blogspot.com/2014/02/devirtualization-in-c-p...


Pedantic, but I assume you're referring to virtual methods?

Ad hoc polymorphism (C++ templates) and parametric polymorphism (Rust) can be inlined. Although those examples are slow to compile, because they must be specialized for each set of generic arguments.


C++ tools can also devirtualize when doing whole-program optimization or tools like BOLT can promote indirect calls generated by any language.

Another one of these sickening pieces. Framing opposition to an expensive tech that doesn't work as "anti". I tried letting the absolutely newest models write c++ today again. Gpt 5.1 and opus 4.5. single function with two or less input parameters, a nice return value, doing simple geometry with the glm library. Yes the code worked. But I took as long fixing the weird parts as it would have taken me myself. And I still don't trust the result, because reviewing is so much harder than writing.

There's still no point. Resharper and clang-tidy still have more value than all LLMs. It's not just a hype, it's a bloody cult, right besides those nft and church of COVID people.


Did you try telling the model to write the unit tests first, watch them fail, then write a function that passes them?

Your comment sounds like John Glenn's quote "Get the girl to check the numbers… If she says they’re good, I’m ready to go." about Katherine Johnson to double check the calculations done by the first computers used by NASA. At that time in history, it was probably accurate and the safest thing to do, but we all know how computer evolved from that time and now we don't have human calculators anymore but rather human checking the correctness of the written code that will do the actual calculations.

IMO the only rebuttal to this can be that LLMs are almost at their peak and there is not going to be any possible significant breakthrough or steady improvement in the next years, in which case they will never become "the new computers".


But LLMs aren't advertised as some future thing. They're advertised as being almighty and replacing devs in great numbers. And that's simply not true. It's a fad like 3D movies

I know they are pumped and overhyped to death, indeed they are. But that does not mean that they already have some use today and that they can (or not) improve in the future.

I'm skeptical about LLMs as well but I also wanted to see what they are actually capable of doing and I vibe coded an Android app in Kotlin (from scratch) with Claude Code and Opus 4.5 and it basically worked. I'm pretty sure the code is horrible to the eyes of a Kotlin developer because I added so many feature by asking CC to do it over the last 2-3 weeks that it already desperately need a refactor.

But still, this is not something an autocomplete would be able to do for you.


> reviewing is so much harder than writing

This is what reams of the AI proponents fail to understand. "Amazing, I don't have to write code, 'only' review AI slop" is sitting backwards on the horse. Who the heck wants to do that?


Fun story to add: I can't get my heart rate measured. I get so nervous about it that I immediately double my heart rate. Of course it's impossible to communicate that with doctors. One even equipped me with a 24h heart monitor. Only to have my stupid brain go on overdrive and clock my heart at 120+ for the entire time, with 0 sleep. I literally fainted when getting ekg cables on me. I now have on record a heart condition without having one: I just get nervous from measurements lol

It's jokingly called 'white coat syndrome'. Any doctor who has a clue should understand this.

LCD is just the better technology. Besides what this article is about, OLED have awful burning and longevity problems. They're great for watching movies on the first month (and that's what gets them sold), but really not much else.

That’s not my experience. I've had an OLED TV going on 7 years now and it still looks better than any of my LCD screens.

My PC monitors are my only remaining LCD screens largely due to the text fringing issues mentioned in this article and bezel size.



Oh another run of new small apps. Why not unleash this oh so powerful tools not on a jira ticket written two years ago, targeting 3 different repos in an old legacy moloch, like actual work?

It's always just the "Fibonacci" equivalent


Did some of that today. Extracting logic from Helm templates that read like 2000s PHP and moving it to a nushell script rendering values. Took a lot of guidance both in terms of making it test its own code and architectural/style decisions and I also use Sonnet, but it got there.

It has to be clarified though, that askreddits main purpose is to gather karma for new accounts. It's the only popular sub without karma thresholds. So is common knowledge to spam it with new accounts to make them usable. It's the official advice even I think

Uv rays are not safe. But not getting uv rays is also not safe. Like so many things in biology, bodies are optimized for ranges in the middle and not at the extremes.

It's just another run of the mill reddit rage bait fanfic. Nothing makes sense plus the weird responses by the user. Inb4 no shallow dismissals

> The algorithm is a gigantic neural network, and as such essentially a black box, incomprehensible to the human mind.

Yeah right


Even if that was true (it's not), freedom of speech is still more important than a few peoples lives


that site routinely indulges in slander and defamation of its subjects .. which are civil rather than criminal matters .. nonetheless, not 1a forms of protected speech unless it has the affirmative defense of being truthful.

in some cases it hosts published content that is criminal on paper (federally: non consensual intimate images under take it down act, or state charges: PII under californias anti doxing law just to name one. There are others), this simply has not been enforced or litigated successfully, nor defended on strictly 1a grounds yet.

So far it has racked up multiple successful defenses hiding behind section 230, not 1a.

There have been a couple of incidents where someone may have had standing to sue a poster (on any of the aforementioned grounds) who “could not” be identified. [0]

At the present time 230 keeps KF itself from being a defendant.

[0] The same guy who tells cops and courts that he shreds his logs after 30 days somehow finds a way to call out a user who has exclusively been using Tor for two years, (oh. Now he has logs going back several years.) but I digress.


Well there’s an opinion not to take too far...


My family is a family of dancers. My parents love it. My older sister danced and even taught dancing. So I was always under intense observation when it comes to that. And every hint of it was immediately commented on. Every movement to music, too. I hated it. And completely blocked all of dancing from my life. Didn't dance on graduation, not on weddings. That's just a direct and human consequence.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: