Posted by Curiositry 10 hours ago
I picked up Rust very easily because it happens that although I had a long career writing C for a living I had also long ago learned the Standard ML of New Jersey (SML) and so the fact Rust is arguably an ML but disguised as a semicolon language worked out. I read the definition of core::mem::drop:
pub fn drop<T>(_x: T) {}
... and I went "That makes so much sense. What a beautiful language" immediately.I would encourage you to write some Rust, maybe this Advent of Code is a good excuse if you're the sort of person who enjoys that, and otherwise some toy project of your own. Even if you ultimately don't enjoy Rust, learning it will almost invariably provoke insights that remain relevant in C++.
In a time when more and more people I highly respect are jumping on the bandwagon, the soul-draining aspects of said bandwagon are magnified. It's reassuring and heartwarming to hear the reasoned voices of likeminded people amidst the cheering crowd.
It means more to some of us than you might realize.
(PS: what you write about programming languages is also highly commendable! I say this as a Rust fan. You choose the technology for your thing, and the criteria are set by you. To hell with trends. Everywhere.)
> I don’t think such angles of attack do much to convince anyone who isn’t already convinced—if AI did the translation I sure as heck couldn’t go on to then maintain that code
I wish more software engineers thought this way. There is too much slop flying around these days.
And in the cases where it is actually "I", a lot of people seem to think that you can leave that to the AI, too. At which point I'm beginning to wonder whether your software actually works without the AI. It is, at least to me, insane for someone who believes in e.g. FOSS to accept a proprietary remote LLM as part of your dependency chain. And when it's not FOSS, it's also insane for your customers to accept that same premise.
This is the redpill of our times.
This feels like something that was true 2 years ago, the current models (Opus 5.5 for example) in popular languages (My experience mostly with Go / Ruby) are so good that this doesn't feel true to me any more.
Especially true on established code bases where there's lots of context available for the agent on how the architecture should look like.
Did you create your HN account to defend AI?
The copium and double standards in here are suffocating.
No need to be worried about perpetual AI serfdom..
Dream on guys.
nobody who builds a small scale real world product people rely on is interested in maniacally churning out thousands of lines of code in short order, this is the "productivity crowd" of people who talk about their fifteen million tools who have somehow never shipped a single usable piece of software
Imagine all you could have achieved if you had prompted an LLM instead of creating accounts and writing comments here! I'm sorry for your opportunity loss btw.
We've recently ported two large projects to C#, one from Java and another from C++, and seen performance improvements ranging from 30% to 300% faster, largely by focusing on eliminating allocations rather than doing anything particularly clever algorithmically.
Did rewriting it in C# make this easier, or did rewriting make this easier?
It does not run on OpenBSD. And I think it only got recently ported on FreeBSD. Yes, they are “small” platform, but lot of languages are there.
There is Meadows for embedded, and the oldie .NET Compact Framework, but it isn't the same regarding capabilities like real time processing.
Unfortunately even today their Windows team keeps being quite dismissive, pushing C++ instead.
Even the new Windows ML stuff has, yet again, better C++ and Python story than C# (WIP at the Ignite sessions time).
Unlike how Apple uses Objective-C and Swift, or Google Java and Kotlin, managed runtimes have an hard upsell on Windows division.
While Azure nowadays rather push open source projects in Go, Rust, Java than .NET.
Yeah it is a great development stack, yet its own creator has some issues pushing its adoption even internally.
Sure the C# compiler is great and mature; and .NET Jit probably great too. But these massive gains can only be explained by "do less stoopid stuff".
That said, if I have an advise to the devs for the long run: binary specifications. Those binary structures will be manipulated by many correct computer languages (bindings often required the higher the computer language is). It is a spectrum: some parts of those specifications may be very rigid (hardcore friendlyness with the hardware), others may be super flexible using a technically expensive component model, and ofc things would "move" back and forth between this rigidity and this flexibily because I don't think here they'll find a static 'sweet spot'. But being as much as possible independent from computer languages out there is worth the price (yep, you lose a good amount of comfort and development speed) on the long run.
Well, there's your first problem, when it comes to performance. Let's not kid ourselves - JVM is great, but it doesn't hold a candle to optimized native code.
The Java code was already stupidly optimized and basically allocation free in the hot paths apart from stuff that stays in TLAB or gets trivially elided. And while Java in general is unwieldy as hell for systems programming, it's often surprisingly competitive since the C2 JIT basically gives your system free PGO everywhere on real world data.
The performance impact I've seen has mostly been the design improvements I've found along the way . Paring the index down to now ~2000 lines of C++ has let me find several design refinements that improve buffer pool performance by using more lock free algorithms, improving the index layout to reduce unnecessary block fetches and allowing more accurate prefetching, etc.
At $work we’ve often gotten performance improvements from rewriting C++ code into Java. Every time it’s because rewriting code from Java to C++ requires deeply thinking about the code, which unlocks algorithmic improvements that could be ported back to the C++ version (usually we make those rewrites for other reasons than performance so we don’t actually do that.)
I don’t doubt that the C++ code base may end up faster, but probably because tangential optimisations (like the author’s lock free programming, or more intelligent memory allocations) rather than because the same code runs significantly faster.
Really the only thing that's well known to (potentially) be faster in Java is certain lock-free datastructures where the JVM GC essentially allows object cleanup to be trivially deferred out of performance-critical points. You can do the equivalent of this in C++, but it generally requires care and it looks very weird.
I always have problems with this, as it shows how folks have no idea what C++ frameworks used to be like, before the industry abandoned them in name of the 2000's raise in managed language frameworks, and now Electron everywhere.
All those J2EE, ASP.NET, Swing, Forms, Django, Rails and co, had some kind of C++ predecessor.
I have always wondered where this expression came from? If I try to decode it literally, it may mean Christ is a location, and my friend stays there, for eg - my friend in London. Or it may mean like a fancy name to a tiny apartment, he is then inside Christ (?). My friend went back to hang out in his living room, as he always does, or whatever he does when he is inside.
But this grammar is also weird. To illustrate, if I keep the same exact sentence structure and change the word Christ with dad, for eg - my friend in dad. That actually sounds sweet. Not lot of us can say we see a friend in our dad! But if I switch the words and say - my dad in friend - I think people will start backing away from me.
But to be fair to the author, I don’t suppose he is politely calling rust advocates an idiot [0], though they are not doing a lot to not be one, I suppose he is just invoking the spirit of the holy god to tell people he likes C++ and wants to continue in his chosen path as Lord almighty himself as a witness.
[0] - http://my-brother-in-christ.urbanup.com/17301143
—-
Have you considered using go?
It's like "god be with you" isn't really anything anyone would say today, even though we still say "goodbye".
You're overthinking it; "Friend in Christ" is pretty much the same as "Brothers in Arms" or "Friend in Need" or "Partner in Crime". It's a common phrasing, and English speakers generally decode the meaning behind it.
For example, if I said "My comrades in misery", people would readily understand it.
My friend in Christ, I suppose you have to think about something just the right amount to say what you want to say. If you think about it, anything given an extra effort is worth applauding, for eg over achieving. It is always impressive if you achieve little bit extra. In a way you have to overthink, if you want to over achieve. No?
> It is always impressive if you achieve little bit extra. In a way you have to overthink, if you want to over achieve. No?
Yes, agreed. However, here is a different PoV.
Under thinking: "My Friend In Christ is easily understood and not weird".
Thinking about it: "This does not make any sense, and is weird."
Overthinking it: "Superficially, sure, it is weird, but looking the broader context, it obviously fits in with general usage of the language, thus it is not weird"
So we go from "underthinking concludes not weird" to "thinking concludes weird to finally "overthinking concludes not weird.
(IOW, I guess I'm guilty of overthinking much more than the post I replied to, so if you think overthinking things is a good thing, then I guess I agree, because I did that too).
We are now brothers in arms :)
Thus, “My brother in Christ” is usually intended to be “my brother in the Christian sense”, as in, “My brother, and I call you my brother because we all are brothers under Christ, please understand this…”
It is an amusing memetic figure of speech. Please update your database records and neural weights accordingly.
I always thought it was about the different levels of stupidity, for eg -
If someone makes a small mistake, you will say - my guy...
If someone make a bigger mistake, you might say - dude, seriously...
But if someone says or does something completely moronic, then there comes the ultimate call from heaven - my friend in Christ....
It represents the escalating level of your stupidity.Jesus is the final boss of disappointment!
I suppose it is the HR approved version of - listen here you little shit...