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

> When I watch a movie, I don't care about the artist's life. I care about character life, that's very different.

It may seem like this, but up to now, you haven't been able to divorce a story from its creator because every story has an author, whether it's a novel like Harry Potter or a movie that has a writer and director. When you're experiencing the story, in the back of your mind, you always know that there is someone who created the story to tell you some kind of message. And so you can't experience something like a movie without trying to figure out what the actual message behind the movie was. It is always the implicit message behind the story that makes it valuable versus just the elements of the story.

The story has more weight because it is the distillation of somebody else's life and most likely, if it's a successful story or book, it is the most important lesson from that person's life and that's what makes it more valuable compared to the random generation of words from a computer.

The food analogy is that a cookie baked and given to you by a friend is going to taste far better than anything you buy in a store.


> you can't experience something like a movie without trying to figure out what the actual message behind the movie was

I believe you that your brain works like that but this is absolutely not how mine works. I care if i enjoy the movie, and if the characters are believable, i absolutely do not care what the message is supposed to be.


"When you're experiencing the story, in the back of your mind, you always know that there is someone who created the story to tell you some kind of message."

I might know that, but I usually don't care.


Only in as much as their product is a pure commodity like oil. Like yes it’s trivial to get customers if you sell gas for half the price, but I don’t think LLMs are that simple right now. ChatGPT has a particular voice that is different from Gemini and Grok.


You can use “set()”. Introducing more weird special cases into the language is a bad direction for Python.


And you can use dict() for an empty dictionary, and list() for an empty list.


For reasons I don't think I understand, using the functions is "discouraged" because "someone might muck with how those functions work" and the python world, in it's perfect wisdom responded "Oh of course" instead of "That's so damn stupid, don't do that because it would be surprising to people who expect built in functions to do built in logic"


Yes but they are not equivalent. dict and list are factories; {} and [] are reified when the code is touched and then never reinitialised again. This catches out beginners and LLMs alike:

https://www.inspiredpython.com/article/watch-out-for-mutable...


That article is about how defaults for arguments are evaluated eagerly. It doesn't real have to do with dict vs {}.

However, using the literal syntax does seem to be more efficient. So that is an argument for having dedicated syntax for an empty set.


I am not replying to the article but to the poster.


I am talking about the article you linked to in your comment.


They are equivalent. In function signatures (what your article is talking about), using dict() instead of {} will have the same effect. The only difference is that {} is a literal of an empty dict, and dict is a name bound to the builtin dict class. So you can reassign dict, but not {}, and if you use dict() instead of {}, then you have a name lookup before a call, so {} is a little more efficient.


Right, but it instantiates it _once_ on module load! That is the point I am making; nothing else.


Your link doesn't support your argument.


I wrote the link and yes it does. Module evaluations reify {}, [], etc. once. That is why people keep making subtle bugs when they do `def foo(a=[]):` unaware that this will in fact not give you a brand new list on every function call.

Factory functions like list/tuple/set are function calls and are executed and avoid this problem. Hence why professional python devs default to `None` and check for that and _then_ initialise the list internally in the function body.

Adding {/} as empty set is great, sure; but that again is just another reified instance and the opposite of set() the function.


There is no difference between “def f(x={})” and “def f(x=dict())”, unless you have shadowed the dict builtin. They both have exactly the same subtle bug if you are mutating or return x later.


No no no, it's a great direction towards becoming the new Perl.


> to see if the serial numbers are out of circulation.

Cash cannot be invalidated like this. It would ruin the value of all cash since you could no longer trust cash from anyone. Only damaged notes are taken out and replaced by the government.


Specifically invalidating serial numbers of cash used in a crime is a very common process.


This is something you see in movies. Cash is by nature not traceable, so invalidating notes after issue would make it impossible to trust any cash transaction.


Race conditions are generally solved with algorithms, not the language. For example, defining a total ordering on locks and only acquiring locks in that order to prevent deadlock.

I guess there there are language features like co-routines/co-operative multi-tasking that make certain algorithms possible, but nothing about Java prevents implementing sound concurrency algorithms in general.


> Race conditions are generally solved with algorithms, not the language. For example, defining a total ordering on locks

You wouldn't make that claim if your language didn't have locks.


Exactly, this thread is full of ignorant comments. I was talking about a certain class of race conditions that can be completely prevented in some languages, like Rust (through its aliasing rules that just make it impossible to mutate things from different threads simultaneously, among other things) and languages like Pony, for example, as the language uses the Actor model for concurrency, which means it has no locks at all (it doesn't need them), though I mentioned Dart because Dart Isolates look a lot like Actors (they are single-threaded but can send messages and receive messages from other "actors", similarly to JS workers).


In Java, racing a field is safe - you can only ever observe the value as one that was explicitly set by a thread, no tearing can happen. Safe data races can happen in Java, but you sometimes do want that (e.g. efficient concurrent algorithms), and avoiding it is not particularly hard (synchronized blocks are not the state of the art, but does make it easy to solve a problem).

Pony and Rust are both very interesting languages, but it is absolutely trivial to re-introduce locks with actors, even just accidentally, and then you are back at square 1. This is what you have to understand, their fundamental model has a one-to-one mapping to "traditional" multi-threading with locks. The same way you can't avoid the Turing model's gotchas, actors and stuff won't fundamentally change the landscape either.


> avoiding it is not particularly hard (synchronized blocks are not the state of the art, but does make it easy to solve a problem).

Please have a read of https://joeduffyblog.com/2010/01/03/a-brief-retrospective-on... (and don't just skim it.)

(This was not written by some nobody, he does know what he talks about.)

  Contrast this elegant simplicity with the many pitfalls of locks:

  Data races. Like forgetting to hold a lock when accessing a certain piece of data. And other flavors of data races, such as holding the wrong lock when accessing a certain piece of data. Not only do these issues not exist, but the solution is not to add countless annotations associating locks with the data they protect; instead, you declare the scope of atomicity, and the rest is automatic.

  Reentrancy. Locks don’t compose. Reentrancy and true recursive acquires are blurred together. If a locked region expects reentrancy, usually due to planned recursion, life is good; if it doesn’t, life is bad. This often manifests as virtual calls that reenter the calling subsystem while invariants remain broken due to a partial state transition. At that point, you’re hosed.

  Performance. The tension between fine-grained locking (better scalability) versus coarse-grained locking (simplicity and superior performance due to fewer lock acquire/release calls) is ever-present. This tension tugs on the cords of correctness, because if a lock is not held for long enough, other threads may be able to access data while invariants are still broken. Scalability pulls you to engage in a delicate tip-toe right up to the edge of the cliff.

  Deadlocks. This one needs no explanation.


Nice "gotcha".

But STM doesn't solve e.g. deadlocks - there are automatisms that can detect them and choose a different retry mechanism to deal with them (see the linked article), but my general point you really want to ignore is that none of these are silver bullets.

Concurrency is hard.


Not sure what you mean!? Locks, at their core, are not implemented by languages. They’re feature of a task runtime e.g. Postgres advisory locks or kernel locks in a Posix OS.


Yes, exactly. Latency is the killer feature. Doing a video call with extra 50ms of latency is noticeable.


This is a great point. Life is tough because we are all competing in a game. Tweaking the rules of the game so that each basket is worth more points doesn’t make the game easier for any player.

From Henry George:

> Now, to produce wealth, two things are required: labor and land. Therefore, the effect of labor-saving improvements will be to extend the demand for land. So the primary effect of labor-saving improvements is to increase the power of labor. But the secondary effect is to extend the margin of production. And the end result is to increase rent.

> This shows that effects attributed to population are really due to technological progress. It also explains the otherwise perplexing fact that laborsaving machinery fails to benefit workers


>explains the otherwise perplexing fact that laborsaving machinery fails to benefit workers

I disagree, the reason why workers don’t benefit is because they are mostly paid to put hours in. Owners claim the gains of better machinery because they reason it is a capital investment at the business level.

Really I don’t see why see why this is perplexing. What is really perplexing is that some economists thought that productivity gains would somehow accrue gains for workers.


You say this isn't perplexing while commenting on an article by one of the most important people in industry repeating exactly this fallacy?

HN is full of people who happily and earnestly propagate this "obvious" falsehood.


I don’t know why they couldn’t do the friggen obvious move of asking the police to unblock the roads by force, and impounding the vehicles for repeat offences. Going after bank accounts was a coward move that never made sense. If I just sat down in the middle of a subway tunnel, I would be removed by force immediately, no matter what I was protesting. They created problems for themselves by not doing the obvious solution.

Blocking a road is a fire hazard and should never have been tolerated by local police for that reason alone. You cannot impede transit in a city.


If only more people A) asked this question and B) looked into what was (not) happening.

Basically Ottawa police were insubordinate, sided with the truckers/occupiers/protesters, etc. The populist conservative provincial government completely failed to act, likely due to the protestors being on "their side".

> Ottawa was not being policed. Ticketing didn’t start for days. Tow-truck companies hesitated to move illegally parked trucks for fear of losing business from truckers after the protests ended. Protesters were refilling their trucks with jerry cans of diesel. When the police were ordered to put a stop to that, protesters began to carry empty jerry cans en masse to overwhelm law enforcement, but they needn’t have bothered: front-line officers were not following orders to stop them from gassing up. There were reports that sympathetic officers were sharing police intelligence with protesters. Anything the police did could backfire. Families with children were living in some of the trucks, and there were reports of firearms in others.

https://thewalrus.ca/freedom-convoy-the-prince/


> Basically Ottawa police were insubordinate, sided with the truckers/occupiers/protesters, etc

Maybe the correct move was to resign if it got that bad.


I agree, the police should've resigned if they failed to do their job. Call in the military.


That's basically what happened.


The police chief? He did.


The city or the province could have done that. They didn't. The Feds could only use federal reasons.

The mishandled response to the trucker protest should be blamed on the city and the province, not on Trudeau.


There is room for two failures. The province should have enforced the provincial law, and the feds should not have have taken action through the banking sector.


But this leads to the question if the province is not doing it's job, what do you do as the feds?

Not saying they did right, but curious.


My preference would be that the fed enforce the laws on the books themselves (if they have the power to do so), or pressure the province to do so (using the democratic leverage available).


They tried that for weeks and it didn’t work. So what did you want them to do.


Are there no federal police or laws that are applicable? Is there no federal funding that goes to the province that can be used as leverage?

Those would be my starting place.


There’s no federal police, the government can make their resources available but it’s up to the province to use them or not. And sure, you could use funding, but there’s no guarantee that that would have solved the problem. The province could have kept digging their heels in.


Arent there 30,000 Mounties capable of enforcing the law?


Sure, but like I said the federal government can’t deploy them, only the provinces. And the premier of Ontario is a drug addict nimby conservative that hates trudeau, so he refused to do anything about it.


Interesting, I'm somewhat shocked that the fed has no ability to direct and deploy the Mounties, but I wont argue with a Canadian. That said, I think the democratic solution is to act through ones representatives, impeach the premier, ect.

I also dont see why the emergency act, if declared, couldn't be used to enforce existing laws and remove the truckers.

I think my core point is that there are conventional and broadly accepted methods to take when people are breaking the law. People breaking the law does not provide a blank check to stop them by any means desired.


It’s a whole thing because Quebec threatened to secede in the 80s, so the federal government doesn’t intervene unless provinces ask for it. I’m not sure about the legal basis for it either though hahaha.

And like, I agree with you in general, I just don’t see the action as an abuse of power. The economic intervention was also accompanied by on the ground action, as you said should have happened. At the time there were lots of questions about foreign interference in funding the protest, that’s why their accounts were frozen.


> what do you do as the feds?

I don't know exactly how Federalism works in Canada but the answer is their jobs. If that doesn't entail stepping in to provincial business, they shouldn't do anything.

There doesn't always have to be something done.


This is very easy to say as someone who wasn’t affected by the situation. Most people supported the federal governments decision.


Provinces are absolutely responsible, policing is all on them.


Ultimately, the responsibility rests with the truckers, period.


Trudeau was the one who triggered the protests in the first place.

The liberal, moral, fast and peaceful solution to the trucker protests was simple: stop forcing people to take experimental drugs against their will. The vaccines didn't reduce transmission, and there is no rule against living life in a risky way (even if you believe the vaccines worked at all), so there was never any moral argument for the mandates. The truckers were right to protest, as Trudeau and the Canadian people were doing them a severe injustice.


Then you best blame the US gov't even more so, since it was Trudeau's gov't that had the vaccine mandate for truckers delayed by 6 months and it was only the insistence of the US gov't that this policy was forced in.

Please, this is just preposterous.

Two seconds of attention to who the key leaders of this "protest" were should cause you to question its legitimacy.


I'm an Ontario resident.

Every single vaccine or gathering mandate I experienced was either provincial (Conservatives) or municipal (also conservative for Toronto and georgetown where I live).that they barked up the completely wrong tree is the breathtakingly depressing stupidity behind the whole thing.

Don't believe me? Alberta Conservatives did not have same policies. Then they begged BC and Saskatchewan for ICU beds but that's besides the point - provinces and municipalities had freedom to enact different policies.


Also in Ontario. I am still very confused how none of this seems to have affected Doug Ford. This was the most mandated, school-closed, shut-things-down jurisdiction in North America at the time. And somehow Trudeau is apparently to blame for it all, and Ford is still... electable?

Meanwhile the feds only had jurisdiction over borders and airports. They acquired the vaccines, but it was the provinces that doled them out and set the policies for what would require them.

At the height of covid Ford even had outdoor ski hills shut down. Crazy times. Some of it made sense, some of it didn't. But I can tell you my neighbours with F Trudeau stickers were very angry about the vaccines, but still somehow are voting for Ford. Confusing.


Provincial governments were a mistake - the average Canadian fundamentally misunderstands the division of powers and responsibilities between federal and provincial governments, and this is remarkably useful for bad actors.

I personally think Chrétien was a terrible offender, since his balanced budgets in the 90’s were a result of pushing responsibilities on the provinces. The current wave of conservative provincial governments have similarly created their own problems (particularly with the international student explosion) while placing all of the blame of the federal government.


Agree on your second point for sure.

Harris/Klein + Chretien was a deadly combination, and more intimately connected than people will admit. Supposed ideological opponents, but the latter created the conditions for the former to thrive.


Thing is, the federal government does not have the power to "ask the police" to do anything. That's obviously by design and part of the demarcation of powers we expect from a democracy. The accusations of authoritarianism would have been just as drastic (I think?) if the PM had stood up and tried to call the RCMP or Ottawa police / OPP to task for their inaction and so on.

Sibling commenter is right: the police should be the ones under the microscope, for failing the citizenry. Questions should be asked about to what degree their membership was compromised by allegiance to or involvement with the convoy and its cause.


> Thing is, the federal government does not have the power to "ask the police" to do anything.

Wut?

The RCMP reports to Parliament up through the Public Safety minister. The bucks stops with the PM.

The federal government has not only the right but the obligation to hold the RCMP accountable.


But that's not what I was arguing? Holding accountable is not the same as telling them what to do in terms of enforcement action.

This was actually discussed as a specific controversy at the time the convoy was undergoing. Trudeau getting on the phone with chief of police and asking him to clear the protest would be a serious breach of political standards in our democracy.

Also the police in question here are the Ottawa Police Service, not the RCMP, I believe.


Your phrasing is "do not have the power". Trudeau most certainly does have the power.

And I'd disagree about breeching political standards. The police are an executive function and report to the PM. I'd like to think Canadians know that.


The police are NOT an executive function and do not report to the PM.

The Ottawa police, report to the city of Ottawa. (https://en.wikipedia.org/wiki/Ottawa_Police_Service)

The Ontario police, report to the Province of Ontario (https://en.wikipedia.org/wiki/Ontario_Provincial_Police)

The RCMP, reports of the Country of Canada (https://en.wikipedia.org/wiki/Royal_Canadian_Mounted_Police). And the RCMP is "a police service for the whole of Canada to be used in the enforcement of the laws of the Dominion, but at the same time available for the enforcement of law generally in such provinces as may desire to employ its services."

The most important part is the RCMP enforcement in provinces is at the DESIRE of the provinces, in this case The Ontario Provincial Government.

Some Canadians may know the above.


Please read your own links!

RCMP

Minister responsible Dominic LeBlanc, Minister of Public Safety

How a Canadian doesn’t know the structure of their federal government is beyond me.


The local police do not report to the PM. It is that simple.

Your local cops don't report to the president.

The RCMP don't have jurisdiction in Ottawa. You said it yourself, it's the federal government and it's not the same as the municipal government.


Additionally regardless of formal "powers", no legitimate leader in any democratic govt wants to be seen "giving orders" to police forces -- that's entirely outside of democratic norms.

The federal govt sets standards and expectations and framework for the RCMP. It should not, and does not (hopefully), tell them what to do on specific case files.


Where can I educate myself on the issue? The differing narratives have left me puzzled.


RCMP in Ottawa would enforce federal laws not provincial. Seems to me you are talking about OPP responsibilities.


It was something like the Ottawa police said they were unable to and Ford said it was a local issue or not a priority. He was onboard with emergency act as it helped with Windsor too.

This was also voted on in Parliament too, 185 to 151


> never handled correctly

I’ve seen this argument, but if you look at real golang code and examples, it’s just a bunch of “if err <> nill” copy pasta on every line. It’s true that handling errors is painstaking, but nothing about golang makes that problem easier. It ends up being a manual, poor-man’s stack-trace with no real advantage over an automatically generated one like in Python.


Which could be solved in one swipe by adding a Result<T, Error> sum type, and a ? operator to the language. This is more a self-inflicted limitation of Go, then a general indictment of explicit error handling.


Nothing prevents explicit error handling in Python either. Forcing explicit error handling just creates verbosity since no system can functionally prevent you from ignoring errors.


Interesting! I wonder how this plays into AWS pricing. They charge a flat fate for MBps of IO. But I don’t know if they have a rule to round up to nearest 4K, or they actually charge you the IO amount from the storage implementation by tracking write volume on the drive itself, rather what you requested.


> They charge a flat fate for MBps of IO

They actually charge for IOPS, the throughput is just an upper bound that is easier to sell.

For gp SSDs, if requested pages are continuous 256K they will be merged into a single operation. For io page size is 256K on Nitro instances and 16K on everything else, st and sc have 1M page size.


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

Search: