8 ms·
Ask HN: Will programmers write more efficient code during the memory shortage?
Maybe there will even be more interest in the invention and use of more advanced algorithms and data structures that use less memory?
- Jtarii 4mo agono
- m00dy 4mo agojust switch to Rust.
- tristanj 4mo agoProgrammers won't, but LLMs will.
- krapp 4mo agohttps://www.youtube.com/watch?v=_n5E7feJHw0 https://www.youtube.com/watch?v=_n5E7feJHw0
- BearOso 4mo agoWe're in this situation because of laziness. I doubt doubling down on it is the solution.
- tristanj 4mo agoProgrammers will just /goal the LLM to make the code more memory efficient. Then let it run it run overnight.
- vengefulduck 4mo agoAnd it will spend 1 million tokens finding the most memory efficient program: int main(){}
- sneilan1 4mo agoI've dumped python for anything that doesn't involve scipy / pytorch in favor of go. So yes, I'm having my llm's output go now which is generally more memory efficient than python.
- winrid 4mo agoPython isn't even that bad, I have python desktop apps that use 50mb of memory. More than needed but not 1-2gb realm people complain about with electron stuff.
- Uptrenda 4mo agoLad, modern day "programmers" don't even know what memory is. You'll be lucky to find any "software engineer" who can even tell you what a pointer is.
- devin 4mo agoI can refer you to some documentation on the topic. ;)
- dosisking 4mo agoI'm pretty sure the person who you are responding to already knows and does not need your documentation. But most 'programmers' are just Python programmers and not real programmers.
- devin 4mo ago1. It was a joke about pointers. 2. Cut out the macho gatekeeping nonsense around what makes a "real" programmer. It's tiresome.
- wseqyrku 4mo agoI don't think at this point in history limitations drive the the way we do things, abundance does.
- ms_menardi 4mo agoIncreasingly, the "what do we have the most of?" questions will return "RAM" less and less often.
- wseqyrku 4mo agoNuclear-powered hyperscale data centers in your neighborhood disagree. Not saying it's a good thing, but like it or not, if you ask "what generally drives how we do things", that's probably it.
- gregw2 4mo agoI don't see the underlying economic dynamics of the relevance of substitution costs driving the way we do things going away. And substitution costs are all about limitations. Abundance and limitations are a bit of ying/yang phenomena in terms of driving things, you don't have one without the other. Igor Stravinsky: "Constraint drives creativity" (I also don't see Amdahl's Law --which is fundamentally about limitations -- going away any time soon.) I do agree that there are compounding abundancies present.
- winstonwinston 4mo agoUnless users complain it’s not going to happen. Somehow SPA (Single-page application) consume memory as much as operating system.
- novafunc 4mo agoI don't see the trend reversing, but if we're lucky, perhaps a freeze. Won't get more efficient but may not get worse.
- johanvts 4mo agoOnly if people start buying computers with less memory, if they just buy fewer computers it doesn’t seem worhwhile.
- pnikosis 4mo agoThere's hope for the extinction of Electron based apps.
- smackeyacky 4mo agoThey aren’t going away. They are an obvious answer to Microsoft GUI development being in the wilderness for 20 years.
- jswelker 4mo agoJava has been right there all along like the awkward best friend in a romcom.
- smackeyacky 4mo agoIt’s funny to me that a lot of the initial dismissal of Swing was “it isn’t native widgets”. Now that’s seen as a positive.
- pona-a 4mo agoAnd Qt. They even made QML with literal reactive JavaScript.
- pjmlp 4mo agoIf only there were other options available, cross platform even,...
- int3trap 4mo agoNo. Customers will pay more across all markets.
- kantord 4mo agoFor this incentive to exist, the app needs to be such an obvious memory hog that users start identifying it as the source of the problem. Even then, a lot is required for most businesses to prioritize this (presumably) temporary issue at the cost of things like: participation in the AI race, other features, bug fixes, new markets etc. Heck, sometimes software is so inefficient that it costs developer and tester productivity but a fix is not prioritized for years.
- devin 4mo agoYour response suggests that you're only considering native apps where users can view memory usage. For cloud apps where the costs are largely hidden from users, the user has no way of doing that analysis. I agree with the second part of what you said, though: I expect businesses to just raise their prices in those cases rather than systematically focus on actual difficult engineering problems.
- mike_hearn 4mo agoFor cloud apps incentives are aligned already. The cost of memory usage falls on the people who are both paying for it and can control it. It's only really on end user devices where it's a problem, and only really on desktop class machines. iOS and Android were built in a RAM starved environment anyway and aggressively kill any non-foreground process that is using too much memory.
- deleted 4mo ago[deleted]
- martinald 4mo agoI was thinking about this recently. If you discount web/electron bloat, actually the memory bloat of software isn't hugely terrible. I still often notice that servers on Linux use <1GB of RAM even with relatively high use. I don't think that's really changed massively in 20 years.
- cheesecakegood 4mo agoMemory? Doubt it. But I’m hopefully optimistic that we’ll see a renewed emphasis on speed and responsiveness, since users do notice that despite most products ignoring it.
- burnte 4mo agoNo.
- asp_hornet 4mo ago> will programmers write Who’s going to tell them?
- t-writescode 4mo agoWell, they're asking on Hacker News, so they're probably asking the broader collective, not just (presumptuously) themselves.
- furyofantares 4mo agoI think the implication is programmers aren't going to be the ones writing code anymore.
- deleted 4mo ago[deleted]
- HaloZero 4mo agoThe memory shortage is really for these insane memory requirements for LLMs. A web browser and the basic mobile app will be fine. The iPhone 17 Pro has the most RAM and it's only 12GB. Hell the iPhone 16 Pro only had 8 GB. The vast majority of consumer cases don't need it. I doubt Apple and other manufacturers will go beyond that to keep prices down.
- cornstalks 4mo agoSome programmers will write more efficient code. At my $dayjob (one of the big tech companies) we're already planning a major goal next year of optimizing server code to reduce RAM requirements, and this is directly in response to the crunch. In practice I expect most optimizations will come from "stop doing stupid stuff" and not "use fancy advanced algorithms." But that's a cynical perspective so don't be cynical like me.
- kapperchino 4mo agoReal, there are so many low hanging fruits for optimization but no one has time to do them. And they don’t incentivize spending your time on it either.
- thewhitetulip 4mo agoEspecially when LLMs are used to generate most of the code anyways in bigcorps
- inigyou 4mo agoIs there a single example of a successful LLM project apart from Claude Code?
- thewebguyd 4mo agoIf the CEOs are to be believed, then 75% of all new code in Google is AI generated. 46% of GitHub internal code, and roughly 30% across all of Microsoft is AI. Meta expects at least 65%, and snap reported 65% is AI generated. Its how software is built now in these palces.
- elcritch 4mo agoUnfortunately doesn’t answer the question “successful LLM project”. From what I’ve seen of GitHub and AWS this year the answer is no. That’s despite me being bullish on LLMs and finding them highly productive.
- comrade1234 4mo agoWill you stop using docker to deploy a simple application? No? Didn't think so.
- ameon 4mo agounless something niche, no. It's not like we are going back to cpp pointers and memory management.
- Joker_vD 4mo agoOf course not. Why would they? The software nowadays is mostly written for people who already own computers with RAM already installed. Yeah, they probably won't upgrade for the next couple of years, so what? Besides, have you heard about "virtual memory" and "swapping"? Nowadays, SSDs (and especially NVMe) are quite fast, so thrashing is much less of an issue.
- andix 4mo agoIf that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected. If buyers can't afford the hardware anymore, the studios need to adjust. It's definitively possible to scale games down a lot. There are a few AAA games that were "dumbed down" for the Switch 1 (Hogwarts, cyberpunk, ...). And that's a really low-spec device. There are two factors: existing gamers not able to afford upgrading. But also new gamers, that might only be able to afford much lower spec PCs than people who bought 2 years earlier. Why games? Because there is a clear point where people stop buying games. Minimum hw specs are known before buying.
- operatingthetan 4mo agoIf you listen to gaming Youtube then the gaming industry is already in trouble from hardware costs and availability. I'm not sure if they are making a mountain out of a mole hill or not though.
- laughing_man 4mo agoI don't know if I buy it. In the last few years the AAA gaming industry has turned out a lot of bad games, and that probably explains most of the trouble.
- thomastjeffery 4mo agoThat's memory efficient assets, not memory efficient code. The latter is already optimized for the former.
- tayo42 4mo agoAre programmers and their use of data structures driving up storage requirements in games though? Or is it just high poly models and high res textures?
- andix 4mo agoI guess it's not just models and textures. Those should be the easiest to dial down, even optionally with a "low" setting. Maybe making high-res assets an optional download, to reduce game size (ssds are also getting expensive)
- nrmitchi 4mo agoUntil prices hit the large hyperscalers, I don't think most people are going to make significant changes. You might see a small set of open source projects related to self hosting put in an effort, but in general, I don't think so. Some big-tech orgs (that have their own hardware) will take costs into account, but they already do that. The "optimization" is more likely to be business-optimizations; "this can be slower if it uses less memory", rather than inventing new stuff. Note that I am excluding any of the big AI labs. They are definitely going to be working to figure out how to use less memory, but that's primarily not related to the direct cost.
- justincormack 4mo agoThe new generation of Graviton on AWS ships with half the RAM per core in the standard family.
- jinpan 4mo agoclaude code and friends will make it much easier to rewrite python/js/$memory-hungry code in rust.
- hollowturtle 4mo agoand make memory hungry rust code with unsafe everywhere. Way to go!
- winrid 4mo agoNone of my LLM created rust code has unsafe, or unwrap and must pass clippy checks..
- physix 4mo agoIf the producers see a long term demand for memory they will meet the challenge and produce enough to bring prices down. Economics will invariably alleviate the memory crunch. It just takes long and requires a huge upfront CapEx. They have been burned in the past and are hesitant to over invest, worried that the bubble might burst. I expect high prices to stick around for a while, but I would be surprised if this was permanent. Which means to me, that price pressure probably won't be the driving force for writing more memory efficient software. For those who want, I expect AI to make it easier to do that, assuming it's done right, i.e. not vibe coding it. If you have a subscription to The Economist, I recommend listening to this Money Talks podcast. They talk about the shortage and the economics behind it. Can anything stop South Korea’s bull run? https://www.economist.com/podcasts/2026/05/21/can-anything-stop-south-koreas-bull-run https://www.economist.com/podcasts/2026/05/21/can-anything-s...
- ojbyrne 4mo agoFrom a paywalled article in the WSJ: “ The China card Two Chinese chip makers—CXMT, the country’s top DRAM producer, and Yangtze Memory Technologies, which focuses on NAND storage—are growing fast and want to expand their global clientele. China is the closest thing to a quick fix for the chip shortage, but the solution is at best partial. Yangtze Memory is building three new factories in China that would more than double its current capacity by the end of 2027, people familiar with the plans said. Meanwhile CXMT is seeking to raise $4 billion in an initial public offering in Shanghai, and it is building new factories. It said its revenue rose by more than 700% year-over-year in the first quarter of 2026, though it acknowledged that its products still trail those of the three industry leaders.” Gift link: https://www.wsj.com/tech/why-the-memory-crunch-is-almost-impossible-to-solve-4023cb40?st=YiodgP&reflink=desktopwebshare_permalink https://www.wsj.com/tech/why-the-memory-crunch-is-almost-imp...
- jklein11 4mo agoA few will write low level code that will make all code behave more memory efficiently.
- Insanity 4mo agoI doubt many of the newer generation ever even tried. Maybe they had a course at uni where they did some C or Assembly, but that's probably the extend of it. So no, I don't think so lol.
- sudoshred 4mo agoDepends. I can certainly offer to rewrite my old code that contributed to the memory shortage, for a price.
- koliber 4mo agoNo. The cost of one programmer’s hour of work compared to the increase in price of RAM is not very big. One is a variable cost one is fixed.
- bborud 4mo agoOne can certainly wish, but I am inclined to believe that RAM use isn’t just about sloppy programmers. I think it is, to a significant degree, about the kinds of problems we solve now that we have more RAM. And not all exorbitant RAM use is about sloppiness. Sometimes you can trade more RAM use for lower complexity. Bugs and development time were expensive. RAM was not. So sometimes there is calculation rather than sloppiness behind certain types of heavy RAM use.
- focusgroup0 4mo ago[dead]
- mherkender 4mo agoAlgorithms and data structures aren't the problem, bundling Chromium to make a chat app is the problem. I think Rust's rise in popularity will probably lead to some benefits. Games will probably get more efficient but they're easier to scale down to the memory that's available.
- xp84 4mo ago> bundling Chromium to make a chat app is the problem. Precisely. And all that extra resource wastage is completely free! (paid by your customers). Perhaps if there were any big software companies who were so iconoclastic as to write fast software and avoid wasteful patterns like using Electron, pressure to do better could be felt, but every company that ships software[1] behaves the same so if anyone tries out competition due to performance beefs, they'll have no relief. They'll be forced to blame their hardware and upgrade it. [1] Only exception of course is some indie developers. I don't know of any companies that have more than about 2 devs who haven't adopted the 'modern' approach, where we only fix performance issues that completely block using the app.
- mike_hearn 4mo agoYou're forgetting about Apple and that entire ecosystem. Android, too. Not much Electron to be found there. Both Android and iOS were heavily optimized for low memory environments back at the start.
- xp84 4mo agoFirst-party and lovingly-crafted indie apps do use native technologies, and often care about performance, but it feels like everything else uses various bloated cross-platform frameworks. The fact that nothing on my modern day iPhone feels any faster than my iPhone 4 did, when the current phones are 10x more powerful tells me that developers consistently spend >= 100% of the yearly Moore's Law dividend on framework bloat, spyware, and useless animations. If we could run iOS 6 and its matching apps on modern hardware, and set animation duration to 0 like jailbreaks used to allow, imagine how fast our phones would be!
- xp84 4mo agoProgrammers might write more efficient code if the performance was unacceptable on their own laptops, but even in the not-flush-with-cash companies I've worked all my career, it's been easy for me to always have a dev laptop with twice as much RAM as most consumers have. I'm presently working on a laptop with 64GB, and we don't even use any local AI models. If a PE company is willing to spec dev laptops like this, even in the memory shortage, then I assume the memory pressure will never hit developers. So, this carefree attitude directly shapes all code that runs client-side (JS + native apps) since the only impact on the company is whatever happens on the dev's laptop. The rest of the impact is "free" since it's paid (in either money or in misery) by customers. For server side, I also highly doubt it, as being more memory efficient on the server side has always had a benefit to the company who pays the bill. The only things that may change may be the relative cost, but if management comes and says "AWS bill going up, help?" devs will say "OK, we can find ways to save RAM, but the team won't be doing any new features or fixing any customer-facing bugs during that time" and management will say "Okie dokie, we'll just pay the bigger bill then."
- naet 4mo agoI don't think we will in the HN snark sense of "this react site or electron app uses way too much memory". Those companies will continue to work in the same way, maybe even less efficiently as people chase modern UIs with extra animations or videos or effects, or with some AI code generation tacking on too many features or tech debt. In specific sectors I do think we will see more optimization. If you're working on cloud compute or AI training / large scale data processing, there will be a big focus on optimization as prices are very large at that scale and shortages have a bigger effect. Also in gaming I think the next cycle will be different. Big game studios used to push for the best possible graphics that might require the newest consoles or high end gaming computers, but the next releases might not be as much of an upgrade. The next gen of consoles or graphics cards themselves might be delayed, or be less powerful, or be too expensive and flop, as chip manufacturing companies continue focus on more lucrative markets and leave average consumers behind.
- segmondy 4mo agoWill they? I don't know. Should they? Yes. If AI is so great, we should use it to optimize. Rewrite all the bloat into lean efficient systems...
- WheelsAtLarge 4mo agoNo, even at these high memory prices it's cheaper to produce code as fast as possible than to spend the time to optimize it for efficiency. It has always been the case that hardware improves at a faster pace than software. So what will happen is that we will get tech improvements in hardware that will reduce its price faster than we can write software to fully take advantage of the hardware. The current bottle neck that's causing the spike in memory prices will subside relatively soon so we'll be in better shape before we know it.
- antinomicus 4mo agoWill we? I don’t think new capacity will come online for several years and at the current rate there’s not a lot of evidence that the new capacity won’t simply be scooped up by the big data centers like they are now. At the very least we’re in for a rough 4 years at least
- WheelsAtLarge 4mo agoTrue, it will be years before the supply expands but that does not negate the fact that it's cheaper to buy hardware than to try to squeeze performance out of software. I know we are having issues with china and they can't produce the latest tech but I suspect they will produce ram so cheap relative to the competition that companies will find away to buy from them.
- laughing_man 4mo agoIt's going to be years before memory prices go down to what the were last year. At least two or three years.
- __s 4mo agocurrently porting code from Go to Rust primarily motivated by memory efficiency gains
- xnx 4mo agoAI (like alcohol) is the cause-of and solution-to all our problems. Computer: Rewrite this python code in Go. Make it memory efficient.
- jswelker 4mo agoThis is sadly a Betteridge's Law of Headlines situation.
- Shitty-kitty 4mo ago8Gb laptops are about the only tech still selling. Exec's better think long and hard about that.
- lesuorac 4mo ago> Will programmers write more efficient code during the memory shortage? If we can insert "some" then Yes. > use of more advanced algorithms and data structures that use less memory? I don't think so. At least at work there is a push to decrease memory usage but the way I've seen it playing out is not using some O(N) data structure instead of O(N lg(N)) per-say but instead replacing `int[]` with `byte[]` or in-lining some fields to remove some indirection costs.
- thewhitetulip 4mo agoAre there promotion metrics tied to app performance? Or are they tied to deliverables? Unless that changes we won't see any spike in optimization
- jpollock 4mo agoProgrammers will write more efficient algorithms if their employers tell them to trade time-to-market for hardware cost. Previously, it was trade hardware cost for time-to-market. "Programmers" don't make this decision, the product owner does.
- Pooge 4mo agoI disagree. Engineers choose the technical stack based on the specs. With LLMs, it's faster to ship even in a more verbose language like Go or Rust.
- armada651 4mo agoWho determines the specs?
- Pooge 4mo agoSpecs are business requirements. Choosing a programming language is not a business requirement; it's a technical one.
- shakna 4mo agoPlatforms are often part of the business requirements. If you're working on SAP or Salesforce, the language decisions are already made for you. If you're integrating with an existing Electron runtime, then you'll be using something in the JS family, like it or not.
- Someone 4mo ago> Choosing a programming language is not a business requirement; it's a technical one. Not solely. The business will have reasons to stay on a mainstream language, for example because - it offers better guarantees for hiring maintainers in the future - it has a higher likelihood that security issues will be fixed rapidly for free - LLMs are better at maintaining code written in it
- jpollock 4mo ago
- garyfirestorm 4mo agoLet me get this straight. We have a memory shortage due to AI slop which is not really efficient and to solve that problem we need to stop the AI slop and hand write the code.
- vrighter 4mo agothose that did before still will. Those that didn't still won't
- MaulingMonkey 4mo ago> Will programmers write more efficient code during the memory shortage? Yes. No. Yes. I've worked in gamedev, helping ship code that ran on consoles. Nice fixed hardware targets. You OOM, you crash. We crashed a lot, and cut and saved and optimized and explicitly invoked the garbage collector twice on level transitions, because a single full scripting language GC doesn't work when finalizers must run to deref C++ objects to unroot script objects, and committed other horrific hacks. The memory shortage may eventually impact fixed targets like this. Or the minspec publishers will swallow for fuzzier targets like "PC". But it takes awhile for new targets to roll out, and for newly bought PCs to make a significant dent on total percentage of PC ownership. Steam Machine's about to release with 16+8GB and while price and market saturation may be affected by the memory shortage, I'd be suprised if the actual spec changed. > Maybe there will even be more interest in the invention and use of more advanced algorithms Not for typical gamedev IMO. There the focus will be more on "reduce the amount of content loaded in memory simultaniously". That means less detail, smaller scale, or less variation. Going from 4096x4096 to 2048x2048 textures quarters your texture memory usage. The surface of meshes also has some square density nonsense going on. Basic animation tends to scale with bone count and keyframes, which are more linear, although shape keys are more per-vertex nonsense. And of course, reusing the same mesh or texture multiple times doesn't use more memory, just more memory bandwidth. Audio is more a factor of "how many sound effects (and variants) do we need preloaded just in case there's suddenly an event that triggers them". These are the big ticket items for memory use and advanced algorithms don't help much. Rather, the algorithms help stretch whatever amount of memory you do have to provide the best amount of quality you can, and the small constant shift in total memory availability doesn't change the calculus for how important that is very much (which depending on the game ranges from "unimportant, everything fits in memory easily" to "critical, we're doing open world streaming and we've got terrabytes of raw data already, 16 vs 64GB of memory doesn't change that much") > and data structures that use less memory? Some bit packing type stuff comes up for smaller logical data structures in gamedev, and that can be useful for saving memory bandwidth, but I'm skeptical of how critical it is for total memory usage outside of the occasional Factorio.
- Werewolf255 4mo agoAre you joking? If anything, they'll use even more memory by shoving 8B LLMs in every single app.
- reinitctxoffset 4mo agoDepends entirely on how competitive / adversarial the market segment is. And there are wild nonlinearities, just as you care a lot whether or not something fits in an 8-way set associative L1d but once you're too big or bank conflicted to make it the cost model drops sharply until you're about to spill the L2. The hackers doing the drone software in Ukraine will go to enormous lengths to get something onto Jetson Orin, but once it needs Thor? New cost model. I think what the parent might be asking is whether the cost of DRAM will be passed along to the most powerless actor in the system, and that depends on whether it's a real competition (war, HFT) or a pillow fight between frenemies (consumer Internet, too big to fail AI lab). Us liberals have this quaint idea that good referees make capitalism an adversarial contest instead of a rolodex contest, but that idea is out of fashion at the moment.
- DANmode 4mo agoIt could certainly be used as a way to sell killing some technical debt for performance improvements to management, for anyone struggling to. “The new MacBook only has 8 gigs of sheep - we need to go resource-lean!!1!”
- holoduke 4mo agoYes. Let's hope bloated frameworks like react, angular and vue with their dreaded hydration and ssr approaches will be replaced with pure clientside applications with stateless servers with small data apis only. That alone will reduce zeptibytes of memory requirements in the world.
- whateveracct 4mo agono
- cco 4mo agoI expect mobile OS and maybe mobile app developers to do so. Google has already downgraded memory for their upcoming Pixel 11 while at the same time imposing local running models as a first-class feature. Both decreasing the memory pool and increasing the demands on it. The key is that they own the full stack (hardware and software) and can demand the OS be more efficient, along with perhaps forcing that goal on app developers as well via tightened background limits etc.
- throwa356262 4mo agoGoogle has done multiple Android memory reduction sprints over the years. The problem is that things go quickly in the other direction between these sprints.
- digitaltrees 4mo agoNo
- deleted 4mo ago[deleted]
- jbird99 4mo agoI'd hope so. Not just because of the memory shortage, but because of the speed at which AI can help write code. Most high-level languages came about in order to speed up development, at the cost of performance and resource consumption. It's time to revisit some of these applications and see if we can use less resources to accomplish the same task. My work laptop with Teams and 2 Edge tabs open uses roughly 11GB of memory, which is insane.
- pjmlp 4mo agoOne could hope for.
- xena 4mo agoNot unless you get promoted for writing more efficient code.
- Lionga 4mo ago[flagged]
- dang 4mo agoWe've banned this account for repeatedly breaking the site guidelines with snarky, shallow, and aggressive comments across many threads. We can't allow that here because it destroys what the site is supposed to be for. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- __mharrison__ 4mo agoI think they are writing shorter code for to token limits... (Just refactored an app to do this. 60k lines to 20k)
- deleted 4mo ago[deleted]
- cryo32 4mo agoThat’ll be a minor part of it. The whole Electron “ship a browser for each app” ideology will die first.
- Panzerschrek 4mo agoIt's unlikely. It means rewriting all these Electron apps using something more performant, which is pretty costly.
- cryo32 4mo agoYeah it won’t mean rewrites. It’ll just die as a starting point.
- antisol 4mo ago> Will programmers write more efficient code during the memory shortage? Hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
- herbst 4mo agoNo. They won't. Most games are written for the 3% who can afford a luxury gaming PC. That's how the market is working for a while now.
- FroshKiller 4mo agoMost games are developed for game consoles, not high-end PCs.
- herbst 4mo agoMost AAA games maybe. All the unity games that run sh*t on anything except a high end PC aren't. However that's more or less unity fault
- linhns 4mo agoProbably not, clarity still triumphs
- dehrmann 4mo ago> advanced algorithms and data structures This isn't where memory goes or real-world speed comes from. For most applications, it's abstractions like React running in electron that hurt performance. There are also richer resources backing parts of apps--higher resolutions, better quality, higher framerates.
- jimnotgym 4mo agoIt is a really simple matter of incentives. If your backlog is full of feature requests you will add features. If your backlog is full of tasks to reduce memory usage, speed up areas etc., then that is what you will do. Most programmers will have no choice whatsoever.
- harel 4mo agoIt's not like we're stuck back with 640kb... At the very least you probably have 8-16GB of RAM still...
- citrin_ru 4mo agoIf memory shortages were not caused by AI then may be (but still unlikely). In the current situation even cautious in the past companies are switching to “move fast and break things” mode to not fall behind vibe coding competitors. When the velocity is the top priority there is no time fo efficiency.
- dainiusse 4mo agoMy bigger hope (for apple ecosystem) is that macbook neo forces apple to optimize. Devs don't have that scale.
- deleted 4mo ago[deleted]
- casey2 4mo agoBackwards thinking programmers might (there is currently plenty of memory efficient software; but it's always missing that feature you really need funny how that works). Forward thinking ones will realize we are heading towards the glut of all gluts and buy 4TB to play around with.
- tinco 4mo agoThey might, but the final outcome of that depends on whether the tokenmaxxing rust-using zero-user startups are using more memory in ci/cd than the users of efficiently written successful apps are using in production.
- v3ss0n 4mo agoWith the age of AISlop why you expecting better quality?
- sim04ful 4mo agoI certainly hope so, it's cheaper than ever to write native code, but if sub-trillion dollar valuated companies like OpenAI have done the math and still use electron for the codex app, one has to ponder what was considered.
- patrulek 4mo agoI would say that in most cases you dont need fancy algorithms and data structures, you just need to stop treating RAM as a rough notebook. Allocating in a loop, not reusing buffers and pointer chasing are a performance killers and are quite easy to avoid before they are introduced to code. Other than that, just be more thoughtful about network and disk usage and nested loops. Its a sum of stupid things that make your program slow.
- rramadass 4mo agoYou must be joking. Niklaus Wirth wrote his A Plea for Lean Software in 1995. Pdf at https://people.inf.ethz.ch/wirth/Articles/LeanSoftware.pdf https://people.inf.ethz.ch/wirth/Articles/LeanSoftware.pdf People did not bother and then the Web made everything worse. We are now so used to layers and layers of abstraction, humongous libraries and frameworks that most do not know anything about how to write "lean" software. Nothing is going to change in the application/services layer.
- swiftcoder 4mo agoRealistically, the impetus here will come from the platform holders, not the individual programmers. Apple recently released an 8GB MacBook Neo, which bucks the previous trend of increasing RAM in low-end SKUs, and signals that software needs to be prepared to run in that configuration for a long time to come. I expect we'll see similar moves in smartphones if RAM prices stay elevated.
- astrobe_ 4mo agoWe sill probably see an increase in the use of OS-level memory compression tricks instead - things like zwap on Linux, for instance. Because the trend is usually to cure the symptoms, not the cause, as it is generally easier to set up and good enough. Makers who already have invested on memory-careless tech such as Electron won't rewrite; at best they'll just be replaced by better alternatives.
- agile-gift0262 4mo agoI might be wearing my tinfoil hat too tight, but I think that market pressure will continue prioritising shipping worse code faster, especially now that with AI it's possible to ship code really fast. The "solution" to expensive hardware will be way less capable hardware and we'll end up with "thin clients" and all compute will happen in centralised "clouds". I hope I'm wrong
- jakub_g 4mo agoI don't believe so do for two reasons: - everyone assumes their program / website is the only thing running at the machine at a given time, and dev machines are always more powerful than user machines - it's not really lack of advanced data structures and algorithms that result in the bloat most of the time but the fact that programs and websites are delivered by large teams, there are dozens of submodules that are often loaded even when not needed, and doing it properly is hard to architect to without getting into big complexity and gnarly bugs waiting to happen when someone from other team modifies something and does not know full picture. So it's cheaper to just keep things the way they are to reduce complexity of architecture and fragility.
- mike_hearn 4mo agoIt's a bit more subtle than bad assumptions. The main place RAM usage is going to get optimized is on the server side, because the client's RAM is a tragedy of the commons. If you're reducing RAM usage while your competitor adds features then the extra RAM saved by your app will just be silently allocated to theirs, the device won't feel any different and the user will prefer your competitor. There is little incentive to optimize RAM usage on the client side because it only helps other companies, so nobody does it - except (ironically) browser devs, who tend to assume they have first dibs on all the RAM of the device. If you really wanted people to care about it OS devs would need to surface memory usage of apps visibly in a way ordinary users can understand and translate to customer feedback forms, which is difficult.
- jcgrillo 4mo ago> The main place RAM usage is going to get optimized is on the server side Agree, but it's going to be a long, hard, potentially ultimately unsuccessful uphill slog. I think the main obstacle is basically 2 decades of inertia. Approximately everyone believes that server side software needs to scale horizontally. So we optimize systems for this property--I can make it work better by just throwing more computers at it. This was a lot more important ca. 2004 (MapReduce) than it is ca. 2026. For resiliency and redundancy, how many nodes does your service actually need? If you're running more than that number, do you have some kind of justification as to why? This is the mindset we need to try to move towards, but it's very different from how we currently do it. EDIT: Another good question to ask, which we don't do enough: "does it really need to be a separate service?" Using data in RAM that's already been allocated is probably better than allocating more and shipping data over the network...
- tumdum_ 4mo agoIn my experience advanced algorithms and data structures are almost never needed. You need simple data structures and algorithms and understanding of the environment in which you are running (for example see https://handmade.network https://handmade.network).
- mirmor23 4mo agoyou are assuming this is a new problem to be 'solved'; folks working on the embedded systems, and network infra headless systems have been wiping this surface clean for many decades; stepping outside of garbage collection, and managed runtime systems could teach a lot; there was a book written 20 or so years ago; https://smallmemory.charlesweir.com/ https://smallmemory.charlesweir.com/
- xlii 4mo agoNo. Even today it is possible to use languages and programming techniques to be ultra efficient when it comes to memory. It's not that difficult to use them but the world don't care. Actual example: I have built same utility using Rust, Zig and Haskell (and Go, humorous writeup[0]). Rust binary is 450kb, Haskell binary 30mb. Zig was unfinished but I constrained memory to 512kb just for fun. Thus it's not about memory per se but more about convenience. Many applications could be scaled by 1-3 degrees of magnitude in memory if they reused techniques but... no one cares. 4K resolution frame is ~40mb uncompressed. Another 10mb is 80k lines of text. Thus fitting in 50mb for 99.8% of applications should be perfectly doable with today's tech. If the price increase would be per each next 1mb then maaaaaybeeee. But if it's like 100% over GB then I'm sure it won't have any impact. [0]: https://xlii.space/eng/the-four-language-waltz-a-tale-of-allocators-and-regret/ https://xlii.space/eng/the-four-language-waltz-a-tale-of-all...
- lukan 4mo agoYou can drain all the system RAM with a tiny binary, so I am not sure you used the right metric.
- elAhmo 4mo agoNo
- renoir 4mo agoWhat's causing the memory shortage is also directly writing less efficient code, so no.
- wewewedxfgdf 4mo agoIt's not THAT much of a memory shortage. It's not a memory shortage like the world had run out of gas for cars. It's not like we suddenly only have 1MB of RAM to fit stuff into. The memory shortage means stuff costs more that's all.
- gsliepen 4mo agoIt's definitely possible, but I agree with many other commenters it probably will not happen. I wrote an encrypted mesh networking library that runs on normal operating systems. A customer asked me if I could make it run on an ESP32 with 520 kiB of RAM. At first this seemed impossible, but it turned out that it was, and not even that hard. While the original library was not memory hungry at all for a desktop CPU, it still wasted space on unnecessarily large buffers. Cutting those out made the library run on an ESP32 while leaving plenty of room for an application. Also, my first PC was a 200 MHz single-core 32-bit AMD k6 with 32 MiB of RAM. This ran a graphical OS with browsers, word processors, 3D games and so on. Nowadays you can get a CPU with more than that amount of RAM as just built-in cache. So a good place to start optimizing code would be to actually get a "severely resource constrained" computer and start making your code work on it.
- marton-laszlo-a 4mo ago[flagged]
- bjackman 4mo agoYou don't save memory with code, you save it with architecture, platform decisions, and feedback loops. Feedback loops are the important bit. If you want to reduce your service's memory footprint, don't at the code look at the memory profile and monitoring. You will find something like "oh shit 30% of our RAM is used by these buffers that we could basically eliminate if we tweak the flush frequency". If you automate/regularise those investigations you will get an efficient service. Same is true of every other performance metric, and reliability. It comes from your engineering processes (alerts, qualification, prod experimentation) not "write better code".
- forinti 4mo agoI'll just recognise that I'm old (and a bit grumpy): back in the day, if you didn't write minimally efficient code, it simply wouldn't run or it would be terribly slow. Young devs have not been exposed to this and they can get away with writing inefficient code most of the time, sometimes all of the time. And even if there is a RAM shortage, we are still in the Gigabyte age. So I don't think we will go back to cycle and byte counting. I can't even get some devs to care if their query runs in 3s or 8ms.
- deleted 4mo ago[deleted]
- Devasta 4mo agoA lot simply wouldn't be able to. You could be a senior dev with over a decades experience at this stage doing nothing but chucking react slop over the fence, performance may have never once come up as a consideration in that time.
- dijit 4mo agoUnless there's an actual financial metric to hit: no. For most people; computers just suck now. I work in AAA video games, and I'm often told that consoles hold back games. This is true in the most essential sense: for consoles we are forced by the first-parties to optimise our games so that they function on consoles at a reasonable framerate with not hitches. Those optimisations help PC players too; and they have more hardware headroom so they can crank things up even higher: without those constraints games would be much heavier and would require you to be on a faster moving hardware cycle. The same is true when I worked in ecommerce; there was a common verbiage which I don't remember verbatim but the spirit of it was "we lose 10% conversion every 100ms" - so we built our systems to do as much as possible within 100ms (including network RTT). If people actually have target hardware, and a metric that they're pushed towards, it can happen, people can learn how to navigate the abstractions or do better with the abstractions they have... but I think this wont happen, because in the examples above there was an actual cost to things. Conversion rate is money, not being permitted to launch on console is money. But you know what modern MBAs see as being money? Time to market & developer salaries. If every company has the same mentality: then it doesn't affect conversation in the same way. Those exogenous constraints simply don't exist in the majority of technology today. It's like a collective action problem. If there was going to be a collective action against this for financial reasons we would have seen it, shipping laptops with 16G of RAM instead of 4G (or 8G) has a really large headline cost in a company of a few thousand people; but those companies never pushed hard on Teams or Slack.
- frumiousirc 4mo agoIn particle physics, processing jobs face a limit of about 2GB/core. This is driven by the realities of "grid computing". The hardware in the computing facilities have approximately 2GB/core and jobs allocate based on number of core. This ratio has been fairly stable for a long time. Some facilities may have a bit more RAM per CPU core but 2GB/core is the general rule of thumb. I hazard a guess that this will not change throughout the (hopefully small number of) years that this memory cost bubble persists. In fact, the increase in cost may lead some facilities to keep older hardware going beyond its EOL/warranty period, prolonging a ratio that may actually be relatively generous compared to today's hardware systems. As a consequence of this fixed RAM/core ratio, substantial software development effort goes to either making jobs fit in 2GB or if that is not possible then to utilize multithreading. Generally, particle physics processing does not particularly benefit from MT except in this fixed RAM/core situation. Sometimes large memory jobs are needed (inherently or because of bloat that is too costly to improve). When run on the "grid", these jobs must allocate multiple cores just to get "their" memory. If those jobs can use the extra cores, overall throughput does not have to suffer. That's for conventional software, which still makes up the bulk of the computing. The situation for the growing amount of GPU-accelerated software is different and more varied. One trend can be seen relating to VRAM. Research groups with easy access to big GPUs like A100 write code to fit or exceed the relatively copious VRAM limits of the data-center GPUs, while groups that lack easy access to DC GPUs but have access to more modest "gamer" GPUs write more advanced software that can fit the smaller VRAM. In some cases, they write the software so it can scale the computation, keeping GPU utilization high while staying just under the VRAM limit. General budget crisis and limited resources in the particle physics field are in part responsible for all of this tailoring of the software to fit the hardware. If better funded, particle physicists could spend more time doing physics and less time squeezing last drops of processing power.
- jcgrillo 4mo agoI remember reading somewhere about an HPC "rule of thumb" that was like 1GB RAM/1GHz of processing is about the right amount for most applications.. Don't recall where that came from or what the exact reasoning was. That kind of aligns with 2GB/core.. Was that a thing?
- customguy 4mo ago"will they" seems like the least interesting/useful question though. How can we, e.g. raise awareness in users and programmers that this is possible and useful? I wanna hang out with coders who care, I wanna read articles about caring and how you can achieve more with less code, and I want to see video content that visualizes the sheer insanity of it all. Like those "scale of the universe" videos, except the complexity isn't fascinating, but embarrassing. Make it uncool, make software bloat a goober thing you people do at most because they "have to", for pointy-haired bosses, or because they're in a rush or under other constraints. Not something that just gets normalized because hey, thinking is hard, caring is hard, so let's all conspire and pretend we're not being deplorable slobs, under the "leadership" of even worse slobs. There is little technical difficulty here, it's mostly social. Ignorance and greed are in cahoots and don't want to get called out, so call them out. Though I think to start with, you have to not give a shit about the majority, and huddle with people who care and make better things. If the majority comes around, great, if not, still better than standing on the beach, wondering if the ocean will ever spontaneously take this or that shape.
- codethief 4mo ago> I wanna hang out with coders who care, I wanna read articles about caring and how you can achieve more with less code This very much reminds me of an expression coined by Loris Cro (VP of Community at Zig Foundation): "Create software you can love". Looks like it's even got a website these days: https://softwareyoucan.love/ https://softwareyoucan.love/
- shinobi-apps 4mo agoit wont happen, we gonna get uber lazy and stop using brain. new generations already scored less points in every single intellectual tests then generations before them. we will need even more memory in future cos of bad code, just look at windows 11, its awful
- jmclnx 4mo agoA related question "Do current programmers know how to write programs with low memory requirements ?". When I started out, the mini computers were 16 bit and there was a limit to program size. You could do a lot within those limits, but once in a great while I did exceed the limits and the compile (if lucky) would fail or the program would dump. That was well before GUIs. I believe the GUI portion of a program are the largest use of memory, so I do not even know if people today can survive without GUIs :)
- warumdarum 4mo agoCan they still write that code?
- bdcravens 4mo agoNo, because most of your memory usage comes before a line of your code runs. That's where the efforts will be focused.
- LarsKrimi 4mo agoI don't think many will. But I think they should. Not only for the practical reason, but because it leads to better software in my opinion Limitations foster creativity. Abundance kills innovation. In my company: - All computers are refurbished and at least 10 years old. - Cloud deployments use Hetzner or self hosted machines. - All hardware in general is a bit dodgy. Our main CI/CD setup is on a very unreliable network with varying availability and bandwidth It can be annoying once in a while but it reflects our customers reality. And it catches a lot of usability and performance bugs that we wouldn't otherwise catch I can only recommend it
- rekabis 4mo agoConsidering how many greenfield projects are reaching for Electron, and how few of them are moving off of it, I would say not. Until Electron based projects have viable competitors that aren’t using Electron, this nightmare will continue. There is absolutely no justification for consuming 300Mb to 4Gb of RAM when a native app doing the exact same thing typically uses 5% to 0.05% as much memory.
- ponector 4mo agoThe only way to make them to write efficient code is to force developers to do development and testing of the software on the weak machine. At my current job we have Windows virtual machines with 4 old Xeon cores, running at 2.4Ghz and 16Gb of RAM, no GPU. Such config will force them to write efficient UI.
- jcgrillo 4mo agoMachine telemetry data (logs, metrics, traces) are shipped around as highly redundant utf-8 strings. I'm sure there are plenty of other examples of 2+ orders of magnitude improvements that aren't even low hanging fruit, they're basically groundfall. But picking them up may nonetheless require quite a bit of effort, and a major reevaluation of corporate values. Maybe the RAM crunch will be sufficient incentive? Idk. EDIT: It's also possible that the era of hypergrowth might end. Most of the world's addressable eyeballs are already being monetized. There's no new coal seam to mine. If tech becomes more about doing the same with less, and less about explosively growing at all costs, we'll probably see more efficient systems. And fewer people building them. I think this kind of larger systemic change would be more likely to drive efficiency improvements than the (probably more temporary) RAM crunch.
- nowlanpi 4mo ago[dead]
- deleted 4mo ago[deleted]
- 1vuio0pswjnm7 4mo agoWill users choose more efficient programs during the memory shortage Or is user choice illusory, nonexistant
- 1vuio0pswjnm7 4mo ago*nonexistent
- phendrenad2 4mo agoThankfully, AI allows you to write tightly-coupled code (the kind Uncle Bob and Martin Fowler warned you not to write!) which is usually more efficient.
- BornInTheMud 4mo ago[dead]
- bschmidt5000 4mo ago[dead]
- jjice 4mo agoOne can dream, but I doubt it. As for all the reasons I don't have much faith, I'd defer to the other comments. I will say though, optimizing memory usage is easier than ever. Doing a scan of your codebase with an LLM for _large_ memory gains can probably shave a decent chunk off of any application with ease. You don't have to go down the rabbit hole, but taking the top 3 large things it catches would probably result in notable gains for minimal time usage. Hell, I've hunted down code that was causing an OOM from a coworker that ran a regex that would have to search the entire string of a base64 payload that was often around 24MB, when it very easily could have been a basic string operation on the first 50 characters or so. I caught it myself, but went back after with an LLM about 8 months ago and it also spotted it with a vague point in the direction of where it could be. There are probably a lot of small slip ups across a codebase that are simple fixes that add up over time, but we never catch because we're not actively profiling.
- adrianwaj 4mo agoThe key may be more brutalist user interfaces.
- opentestudox 4mo ago[dead]
- PaiDxng 4mo agoMemory constraints force programmers to pay more attention to efficiency, but whether they can write better code depends on whether they know how to balance performance, readability, stability, and maintenance cost.
- MomohNobert 4mo agoIt would force programmers to rethink what the web actually is, and can be. We'll end up realising there was never a hardware problem, it was software all along.
- peelle 4mo agoFor the people I work with, I'd say no to writing more efficient code, and maybe to using more advanced algorithms. I say maybe only because they'll just ask an LLM to make it more memory efficient. Which in theory will cause the LLM to choose a more advanced DS. But I don't have a lot of faith that the LLM will get said DS right all the time. I work with dynamic language developers. Perl, React, Python and so on. Most currently don't care about memory usage. Some devs are actively wasteful. Usually in the name of code clarity or speed of delivery.