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

This was one of my favorite talks from RustConf this year! The distinction between cancel safety and cancel correctness is really helpful.

Glad to see it converted to a blog post. Talks are great, but blogs are much easier to share and reference.


"Cancel correctness" makes a lot of sense, because it puts the cancellation in some context.

I don't like the "cancel safety" term. Not only it's unrelated to the Rust's concept of safety, it's also unnecessarily judgemental.

Safe/unsafe implies there's a better or worse behavior, but what is desirable for cancellation to do is highly context-dependent.

Futures awaiting spawned tasks are called "cancellation safe", because they won't stop the task when dropped. But that's not an inherently safe behavior – leaving tasks running after their spawner has been cancelled could be a bug: piling up work that won't be used, and even interfering with the rest of the program by keeping locks locked or ports used. OTOH a spawn handle that stops the task when dropped would be called "cancellation unsafe", despite being a very useful construct specifically for propagating cleanup to dependent tasks.


Thanks! I definitely prefer reading blog posts over watching talks as well.


> which are optimized to be readable to humans and writable by AI

How might a language optimized for AI look different than a language optimized for humans?


especially when LLMs "speak" human language.


I may be biased, as I definitely love more than 50% of Rust, but Go also does not protect against logical races, deadlocks, etc.

I have heard positive things about the loom crate[1] for detecting races in general, but I have not used it much myself.

But in general I agree, writing correct (and readable) concurrent and/or parallel programs is hard. No language has "solved" the problem completely.

[1]: https://crates.io/crates/loom


I think Claude Code also already has the option to provide an API key directly for usage based pricing.

I'm a fan of having both a subscription and a usage based plan available. The subscription is effectively a built in spending limit. If I regularly hit it and need more value, I can switch to an API key for unlimited usage.

The downside is you are potentially paying for something you don't use, but that is the same for all subscription services.


I use API but think about getting the $100/mo plan and using API for overflow if it occurs.

But I have slow months and think that might not actually be the winner. Basically I'm going to wait and see before I sign up for auto-pay.


Giving how expensive Claude Code is if you use API key, I think it's safe to assume the subscription model is bleeding money out.


Claude is also really expensive compared to every other model.

Maybe that reflects higher underlying costs. Maybe their API prices are just inflated.


It is! Although they are being used in a really weird and not normal way here.

I found "The Little Book of Rust Macros"[1] to be a really good resource for getting started with Rust's declarative macros.

[1]: https://veykril.github.io/tlborm/


Technically, because the bubble sort is implemented at compile time the program is infinitely faster.

The answer is produced as a compiler error and so there is zero runtime at all.


I thought it all completely landed, that it was very obvious what you were doing, and that it was very funny as well as being real neato. Frankly I would probably put negative stock in the opinion of anyone who sees you accusing that python code of being hard to read and thinks you're remotely serious.


Hey! I wrote this. The python being barely legible is my own fault, as the one who wrote it.

The whole post is written to be a little ridiculous, but I must not have gotten that across =(

I agree with you. In real life, python is absolutely a better choice than trying to write a Rust macro to produce the result as a compiler error.

I added a footnote to the end of the referenced paragraph to say that python is great.


Is it though? How much does all the associated gear, operators, actors, sets, producers cost? In the context of professional video production, a one time savings of $6k seems pretty small.


The point is what the footage looks like. It’s about the camera output.

An iPhone + good lighting + microphone will give you fantastic footage.

You don’t need the drone or lift. If you’re not trying to do those effects they don’t matter. The iPhone can give you great results if you own one, you don’t need to buy a fancy camera, you can spend your budget elsewhere if you’re getting started.


Yeah, I think the real target of this kind of marketing is indie/student filmmakers. People whose entire budget for a short film is a few thousand dollars they've pooled together.


You get what you pay for.

If there is a one off person who can command a higher salary, its unlikely they alone will make a huge difference to the company anyway.

If there are a lot of people who could command a higher salary in that role, the pay is too low.

Overall it seems like a pretty good system. You could argue that the current system favors people who are good at negotiating, and not necessarily more skilled workers.


"Server Not found" for any of:

- https://ai/

- https://www.ai/

- http://ai/

- http://ai.

- http://ai

and http://.ai/ gets redirected to a search engine searchfor ".ai" by firefox.

But http://www.ai/ works for some reason.


http://ai

works for me in firefox. perhaps you are using a wrong browser?


The http://ai/ works with Edge on Android.


ai. in Safari on iPhone works. But I have to type exactly that.


I was mistaken.

Thanks for the -30 downvotes HN.


It is interesting because http://.ai works (it says remove www, not the dot).

Edit: The HN generated link does not work because it appends a trailing slash to the end.


Works without the dot for me. (Not the https variant though.)


Yes, it worked for me too (Firefox). Interestingly http://ai goes to http://www.ai.com while http://ai/ works. ¯\_(ツ)_/¯


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

Search: