That it has to heap-allocate if non-inlined is a misconception. This is only the default behavior.
One can define:
void *operator new(size_t sz, Foo &foo)
in the coro's promise type, and this:
- removes the implicitly-defined operator new
- forces the coro's signature to be CoroType f(Foo &foo), and forwards arguments to the "operator new" one defined
Therefore, it's pretty trivial to support coroutines even when heap cannot be used, especially in the non-recursive case.
Yes, green threads ("stackful coroutines") are more straightforward to use, however:
- they can't be arbitrarily destroyed when suspended (this would require stack unwinding support and/or active support from the green thread runtime)
- they are very ABI dependent. Among the "few registers" one has to save FPU registers. Which, in the case of older Arm architectures, and codegen options similar to -mgeneral-regs-only (for code that runs "below" userspace). Said FPU registers also take a lot of space in the stack frame, too
Really, stackless coros are just FSM generators (which is obvious if one looks at disasm)
A stackful coroutine implementation has to save exactly the same registers that a stackless one has to: the live ones at the suspension point.
A pure library implementation that uses on normal function call semantics obviously needs to conservatively save at least all callee-save registers, but that's not the only possible implementation. An implementation with compiler help should be able to do significantly better.
Ideally the compiler would provide a built-in, but even, for example, an implementation using GCC inline ASM with proper clobbers can do significantly better.
Doesn't need to be UB, you can write expressions like: "some_s8_var < some_u32_var" and people will be had. Note that is not the same as "some_s8_var < some_u8_var".
-Wextra catches stuff like this, alas I know of a few people that think "-Wextra is evil" (even though annoying warnings can be selectively disabled)
Fair enough. Given that things like `if (uid = 0) {}` can become a privilege escalation in the right context, surely code that takes the opposite branch of what it looks like is also dangerous in the wrong hands.
I still remember being expected to pass -Wpedantic (and probably also -Wextra) in university.
I don't have as many years of professional experience as you do, but IMO code pissing is one of the areas LLMs and "agentic tools" shine the least.
In both personal projects and $dayjob tasks, the highest time-saving AI tasks were:
- "review this feature branch" (containing hand-written commits)
- "trace how this repo and repo located at ~/foobar use {stuff} and how they interact with each other, make a Mermaid diagram"
- "reverse engineer the attached 50MiB+ unstripped ELF program, trace all calls to filesystem functions; make a table with filepath, caller function, overview of what caller does" (the table is then copy-pasted to Confluence)
- basic YAML CRUD
Also while Anthropic has more market share in B2B, their model seems optimized for frontend, design, and literary work rather than rigorous work; I find it to be the opposite with their main competitor.
Claude writes code rife with safety issues/vulns all the time, or at least more than other models.
In your case SetResolution could be a static method calling a private instance-method SetResolutionImpln, for example, similar to what other people said.
> what's the point of globally visible singletons except "everything is an object" cargo-culting?
Having the singleton be an object becomes interesting when:
1) it contains attributes that themselves have non-trivial constructors and/or destructors. Order of initialization and destruction is guaranteed (init is in forward order of declaration, destruction in reverse order)
2) more rarely, inheritance (code reuse)
In the case of 1), you can just opt to construct the singleton on a sufficiently-aligned byte buffer in-place with `std::construct_at`. This gets rid of static-init order fiasco, __cxa bloat (if applicable), atexit bloat, and you can chose to just not call `std::destroy_at` if you don't need to.
In these two scenarios it's a lot more efficient to group many related objects into a bigger object.
You have to give Apple credit where credit is due. They have managed to make first iTunes and now Music worse with every release. Which is truly amazing.
The fact that in the miniplayer you can't display both the album art and the track information at the same time unless the cursor is hovering over the window absolutely boggles my mind. If I'm listening to a station, I want to glance over and see what I'm listening to. And I like the album art showing. This worked until Tahoe.
View menu > Hide Large Artwork will show the track info, but you of course lose the album art.
Of course it's not a major issue, it doesn't make the system unusable, but it was a nice little experience thing.
All I know about modern Apple Music is that it’s always active in now playing when nothing else is playing, and accidentally pressing play sometimes summons an account setup screen.
I've lowered my expectations over the years, but there's this single stupidity that drives me crazy: When you search for a keyword and play a song from the results, playback continues with the rest of the search results. Why the hell would I want to play all of the songs with similar names? iOS Music, on the other hand, does the expected and creates a station from the first played search result.
Apple Music has actually gone to "completely unusable" for my use.
I use it (or did, pre-Tahoe) to play iTunes-shared music over my network. Since Tahoe, it will play a couple (plus or minus a handful of songs) and then just stop rather than transitioning to the next song.
I've been listening to the actual radio for the past couple months because I haven't had the time to work out how to play my network-shared music.
> By accepting a Program subscription, you grant Anthropic permission to identify you publicly as a Program recipient, including by referencing your name, GitHub username, and associated open source project(s).
I was tempted about applying but that part is everything but nice and I think I'll just pass
There's no non-disparagement clause, so how about you left them use your name etc, and then you can come out in public and say those mean things and shame/embarrass them.
That's fair, but I think it's also not unreasonable for Anthropic to want some sort of "compensation" for giving something away for free (even if it's just a paltry 6-months, which screams "sales tactic"). The terms around getting free stuff sometimes have things that aren't compatible with something about how we do things, and that's fine; we just don't get to take advantage of the free stuff.
It's just that I value the right to reveal my identity on my own terms a lot higher than $1200 (using my username and project name is fine). For the offer to become enticing they would need it to be 5~10y instead of 6mo, or to simply remove the $realname part of the "publicity" section
This police ordinance from 1800 was abolished in 2013
> requiring permission of the husband to work
Repealed in 1965
reply