The feature in OxCaml that more languages should steal (theconsensus.dev) 6 points by g0xA52A2A 2mo ago ↗ HN
[–] weissi 2mo ago ↗ Swift has `@_noAllocation`:@_noAllocation func foo() -> Int { return [1,2,3].randomElement()! } fails with "error: Using type 'Int' can cause metadata allocation or locks"but@_noAllocation func foo() -> Int { return 1 + 2 + 3 }compiles fine.
2 comments
[ 5.0 ms ] story [ 14.0 ms ] thread@_noAllocation func foo() -> Int { return [1,2,3].randomElement()! } fails with "error: Using type 'Int' can cause metadata allocation or locks"
but
@_noAllocation func foo() -> Int { return 1 + 2 + 3 }
compiles fine.