Remix.run Logo
bertylicious 6 hours ago

Nice! That's (seems) so simple yet also so very effective. Shouldn't other memory-managed languages be able to profit from this as well?

KolmogorovComp an hour ago | parent | next [-]

It’s a very well known pattern, as someone else mentioned it’s used in CPP in smallstring, Rust smallvec, C usually hand rolled etc.

6 hours ago | parent | prev | next [-]
[deleted]
lionkor 5 hours ago | parent | prev [-]

C# has `stackalloc`

bertylicious 5 hours ago | parent [-]

But that requires an explicit declaration and isn't done automatically under the hood, or am I missing something?

Smaug123 4 hours ago | parent [-]

The JIT does this automatically in some cases as of .NET 10 (https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotn...).