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

Sounds like you have a data structure like `Array<Float>`. The immutable approach has methods on Array like:

   Array<Float> append(Float value);
   Array<Float> replace(int index, Float value);
The methods don't mutate the array, they return a new array with the change.

The trick is: How do you make this fast without copying a whole array?

Clojure includes a variety of collection classes that "magically" make these operations fast, for a variety of data types (lists, sets, maps, queues, etc). Also on the JVM there's Vavr; if you dig around you might find equivalents for other platforms.

No it won't be quite as fast as mutating a raw buffer, but it's usually plenty fast enough and you can always special-case performance sensitive spots.

Even if you never write a line of production Clojure, it's worth experimenting with just to get into the mindset. I don't use it, but I apply the principles I learned from Clojure in all the other languages I do use.


> The methods don't mutate the array, they return a new array with the change.

But then I need to update a bunch of stuff to point to the new array, and I've still got the old incorrect array hanging around taking up space.

This just sounds like a great way to introduce bugs.


It ends up being quite the opposite - many, many bugs come from unexpected side effects of mutation. You pass that array to a function and it turns out 10 layers deeper in the call stack, in code written by somebody else, some function decided to mutate the array.

Immutability gives you solid contracts. A function takes X as input and returns Y as output. This is predictable, testable, and thread safe by default.

If you have a bunch of stuff pointing at an object and all that stuff needs to change when the inner object changes, then you "raise up" the immutability to a higher level.

    Universe nextStateOfTheUniverse = oldUniverse.modifyItSomehow();
If you keep going with this philosophy you end up with something roughly like "software transactional memory" where the state of the world changes at each step, and you can go back and look at old states of the world if you want.

Old states don't hang around if you don't keep references to them. They get garbage collected.


Okay, so this sounds like it's a method of programming that is entirely incompatible with anything I work on.

What sort of thing would it be useful for?

The kind of things I do tend to have maybe several hundred thousand floating point values that exist for maybe a couple of hundred thousandths of a second, get processed, get dealt with, and then are immediately overwritten with the next batch.

I can't think of any reason why I'd ever need to know what they were a few iterations back. That's gone, maybe as much as a ten-thousandth of a second ago, which may as well be last year.


It is useful for the vast majority of business processing. And, if John Carmack is to be believed, video game development.

Carmamack's post explains it - if you make a series of immutable "variables" instead of reassigning one, it is much easier to debug. This is a microcosm of time travel debugging; it lets you look at the state of those variables several steps back.

In don't know anything about your specific field but I am confident that getting to the point where you deeply understand this perspective will improve your programming, even if you don't always use it.


Eccleston had the best dynamic range of any of the actors that played the Doctor. He could do funny, sad, angry, dorky, brooding, mean, lovable... everything. I wish we could have gotten another season or two out of him.

He’s the creepy husband in The Others which took a second to get over. He’s so happy to be there as the Doctor.

Counterpoint: "Chatgpt said this" is an entirely legitimate approach in many contexts and this attitude is toxic.

One example: Code reviews are inherently asymmetrical. You may have spent days building up context, experimenting, and refactoring to make a PR. Then the reviewer is expected to have meaningful insight in (generously) an hour? AI code reviews help bring balance; it may notice stuff a human wouldn't, and it's ok for the human reviewer to say "hey, chatgpt says this is an issue but I'm not sure - what do you think?"

We run all our PRs through automated (claude) reviews automatically, and it helps a LOT.

Another example: Lots of times we have several people debugging an issue and nobody has full context. Folks are looking at code, folks are running LLM prompts, folks are searching slack, etc. Sometimes the LLMs come up with good ideas but nobody is sure, because none of us have all the context we need. "Chatgpt says..." is a way of bringing it to everyone's attention.

I think this can be generalized to forum posts. "Chatgpt says" is similar to "Wikipedia says". It's not the end of the conversation, but it helps get everyone on the same page, especially when nobody is an expert.


I'd agree. Certainly mentioning that information came from an LLM is important so people know to discount or manage it. It's possibly incorrect but still useful as an averaged answer of some parts of the internet.

Certainly citing GPT is better than just assuming it's right and not citing it along with an assertion.


This should be a top level comment, it is the "ah hah" that suddenly makes everything clear.


Nobody saw a gun in a video. Nobody even saw something that looked like a gun. A chip bag, at most, is going to produce a bulge. No reasonable human is going to look at a kid with a random bulge in their pocket and assume gun. Otherwise we might as well start sending our kids to school naked; this is the kind of paranoia that brought us the McMartin Preschool nonsense.


Please provide the quote from the article, or link that lets you know, so confidently, that it wasn't passed through human review.


The presence or absence of human review is irrelevant. A system with stupid humans are just as bad as a system with stupid machines. They are complementary, really.

Nobody saw a gun. We know this because there was no gun.


Are you genuinely interested in the answer, or are you using rhetorical techniques to create the illusion of ambiguity when a quick search for the facts of the case produce a clear and definitive answer?


I just spent a few weeks in southern France. Lovely place, lovely food, lovely people...

...with one national flaw. All that lovely food is available strictly between the hours of 12 and 2 (for lunch) and 7 and 9 (for dinner). If you don't eat on the precise timetable as everyone else (say, jetlag) then you don't eat.


It's a small city thing. In Paris and Lyon at least, some establishments have very extended hours or are even 24/7. And you can get a kebab at ungodly hours in even small cities.


Wider range in bigger cities, I think it’s quite common everywhere? Small town restaurants need pauses


Even in small towns in the US, it's fairly rare for restaurants to have such limited hours. It's more commonly seen with high end restaurants in cities.

I certainly understand why, I'm not mad about it, just a disappointed. I really liked the food.


Did a van trip, I remember that too well.


Imagine a felon, convicted by a jury, claiming "the case was so weak it fell apart on its own".


A felon convicted of essentially same 'crime' his opponent in the prior election committed but was given a settlement and a fine instead.

Hilary Clinton funded the creation of the Steele dossier-- which was later shown to be generally false and unsupported-- but paid for it through one of her law firms and misclassified it as legal expenses in an effort to conceal its origins.

Trump was criminally charged with falsification of business records because he paid Stormy Daniels hush money (to get her to deny her earlier claim that they had an affair) via his lawyer, and classified it as legal expenses. A visible hush money payment would have made it ineffective, just at the Steele dossier being known to be a campaigned paid hit piece would have made it ineffective.

There are plenty of things to ding Trump on, but I think if you're trying to persuade someone that the legal system wasn't weaponized unfairly against him this is a particularly poor example.

Even an argument that the facts make him worse here (e.g. maybe you say concealing an accusation of an affair says more about his integrity than paying for a false report says about hers)-- wouldn't change that this is just not a good example.

Particularly because there was nothing unlawful about the hush money payment itself-- the crime was an obscure accounting violation resulting from it... and in any other circumstance nothing would happen at all or at most, as seen with Clinton, a nominal fine would result. Sure, it's true that random details (like what state the acts in) will often decide if an act is technically illegal or not, but that's hardly an argument for the fairness of the justice system or that it was fairly applied to him.

I don't even hope to convince you of this-- but only to convince you that your example is unlikely to convince others, and is easily exploited to wrongfully convince people opposite your intentions.


Or maybe just the new publicist is better than the old publicist?

Or maybe it's a simple change of strategy; the goal is now "rehabilitate image" rather than "prevent conviction" - and with the new strategy, a new team.


> These things will fly at high altitudes.

That seems improbable? Lithuania is only a couple hundred miles across and these balloons are completely at the mercy of wind.

I would expect the balloon owners want a quick hop over border security. Chasing them down over hundreds of miles of potentially private property sounds like more trouble than it would be worth.


Helium or hydrogen balloons are easier to fly at higb altitudes, but you might be right that shorter hops would be more controllable.


What is shorter hops in this sense to you? If you make some sort of weather balloon where the balloon never bursts, yes, they will travel very far. If you use a cheaper balloon that does burst, they don't travel down range very far in comparison. As I posted previously, depending on the balloon/parachute/payload, our little "experiment" went just over 100+ miles. That seems fairly acceptable. You could start 50 miles away from the border, and the recovery team would also be 50 miles away from the border. That's a pretty good buffer from any security teams working border crossings.


Shorter hops as in tens of kilometers rather than thousands.

I think you can just use mylar, but maybe you'd need a net over it?


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: