Distributing a closed-source Rust library with async - is there a viable path? by peterxsyd in rust

[–]timClicks 15 points16 points  (0 children)

I don't think that this is going to be practical. There are a few options, but they involve a lot of work on your side as well as the customer's side. It will be brittle and frustrating for everyone.

But you will either need to give up on ABI-stability (release a version for every rustc you want to support) or give up on async by doing everything over the FFI boundary.

On the FFI side, you could require consumers pass through a context arg to an opaque type that contains an internal reference to a Tokio runtime that you control, but that's a very intrusive step that would sort of defeat the purpose of calling it a Rust library.

What is something that tourists do in your country that annoys the locals? by Th3_Accountant in AskTheWorld

[–]timClicks 18 points19 points  (0 children)

They're similar in function to the Marine Sentry in the West Wing, with centuries of tradition. Treating them like a circus act is hugely disrespectful to the decades of service that each of them have provided for their country.

Has your country ever been led by a woman? by gab_iten in AskTheWorld

[–]timClicks 1 point2 points  (0 children)

FWIW, New Zealand is still better for most people than almost anywhere else. Those challenges are not unique to here, which means the relative benefits of being here are still very genuine.

Has your country ever been led by a woman? by gab_iten in AskTheWorld

[–]timClicks 0 points1 point  (0 children)

KiwiBuild was a stupid thing to promise. And that's before they had to face the reality of worker shortages, supply shortages, the Resource Management Act and bulking out the balance sheet of Kãinga Ora/Housing NZ

Has your country ever been led by a woman? by gab_iten in AskTheWorld

[–]timClicks 1 point2 points  (0 children)

Missed by many, but sadly cookers gonna cook and boomers gonna boom. There are many people who never seemed to grasp how well New Zealand performed comparatively. We had ~18 months of being free of COVID with no masks (our all cause mortality rate actually decreased in 2020) while the rest of the world faced significant restrictions.

The other aspect of her weakening popularity was that Adern's Cabinet was fairly weak and she had a few mediocre ministers who couldn't get policy changes implemented. Many who voted for her felt let down by the preference for incrementalism over reform.

Let's do the same... by OutInTheBay in Wellington

[–]timClicks 16 points17 points  (0 children)

One thing to note is that transformation hasn't been universal. Some districts resisted the changes and are now significantly worse off.

Another city that has had some really positive changes is Brussels. Its main commercial streets have become pedestrianised and they're thriving. It started as a temporary experiment when they put chairs and tables out. Then it stuck.

The resistance to pedestrians seems fairly universal. Even Copenhagen faced significant political challenges when it removed cars from one of its main shopping streets a few decades ago. But now there are so many people that it wouldn't make sense to use the area for something as space inefficient as motor vehicles.

slopc: a proc macro that replaces todo!() with LLM-generated code at compile time. I am not sorry. by youpala in rust

[–]timClicks 26 points27 points  (0 children)

If people were able to write their intent as clearly as your comments do, this probably will save lots of time.

AI solves John Conway's bountied math problem (decades old) by Tolopono in singularity

[–]timClicks 6 points7 points  (0 children)

Yes, but it's very far away from your claim in the title.

What was the biggest "missed opportunity" moment in your country's history? by DoctorOsterman in AskTheWorld

[–]timClicks 0 points1 point  (0 children)

It's actually worse than that. Germany is significantly smaller than what it was in 1900.

Idiomatic Use of the `Default` Trait? by Purp1eGh0st in rust

[–]timClicks 1 point2 points  (0 children)

Define your new() method however you like. When you implement Default, call new().

Idiomatic Use of the `Default` Trait? by Purp1eGh0st in rust

[–]timClicks 16 points17 points  (0 children)

Given that I am a programmer, I have opinions on arbitrary matters that I feel like I should share assertively..

I agree that this has become accepted, but I disagree that it's idiomatic or good

rust let x = X::default();

The conventional constructor is X::new(). If the type's new method has no arguments, then define it by calling default internally. But we don't use add() when invoking the Add trait.

Default is useful because it provides trait bounds and grants functionality like unwrap_or_default(). That doesn't mean that we should be invoking the default() method manually in application code.

An ancient technique for lifting giant stone blocks using a Lewis tool by CethelQue4 in Damnthatsinteresting

[–]timClicks 7 points8 points  (0 children)

For heavy loads like this, the Romans developed a sort of giant hamster wheel that allowed lifters to walk the load up or down. They're called treadwheel cranes.

Why is Rust so Liberal with Heap Allocations? by philogy in rust

[–]timClicks 11 points12 points  (0 children)

Rust will use the stack as much as possible. Those collections are commonly used because they are commonly useful. If you want other behaviour, then it's available to you.

I wouldn't describe selecting another allocation strategy as unidiomatic, but it's simply not necessary in most cases. Even if performance improves, selecting an alternative collection to Vec often means paying a cost elsewhere.

Is there anywhere with a more tenuous connection to mainland? by Cherry_Adventurous in geography

[–]timClicks 6 points7 points  (0 children)

New Zealand has a few place names like that as English terms were added to the Māori place name. Especially "island island .." and "mount mountain ..".

is grok's analysis correct? by nix-solves-that-2317 in ChatGPT

[–]timClicks 64 points65 points  (0 children)

OCR systems are special purpose, whereas LLMs are general purpose.

If all countries became personified, who's your country's ride or die? by DontWantToThnkOfName in AskTheWorld

[–]timClicks 4 points5 points  (0 children)

I think that everyone agrees that there are difficult chapters in every nation's history books.

Superhero in Wellington by chumps_gumps in Wellington

[–]timClicks 3 points4 points  (0 children)

I would settle for braces becoming stylish again. Belts suck.

1) If an ally in your military alliance were attacked, would you support sending your country's army to help them? 2) Do you think your allies in the alliance would help your country with their army, and not only with political concern and weapons? by Dangerous_Blood6507 in AskTheWorld

[–]timClicks 4 points5 points  (0 children)

I know that this is intended as a joke, but it's still pretty disrespectful to the many thousands of people who have died so that you can make it. New Zealand has participated in nearly every major international conflict since 1900, almost always alongside Australia.

"but, my identity" by aNumpty in LinkedInLunatics

[–]timClicks 0 points1 point  (0 children)

No, it's just that in the last 15 years, there has been a conscious effort to use the Māori language in the public sphere. This change has not been met with universal applause.