Elektrine lite

← Feed

@leeloo@c.im

Post #1758314

2026-04-20 13:58 UTC

@teilweise @Sarnau @mayo @dasdom Why do you think that it is most likely that the compiler didn't do any optimization?

Replies (1)

  • @teilweise@layer8.space 2026-04-20 14:14

    @leeloo @Sarnau @mayo @dasdom Because of the way string substitutions work in the Swift/Obj-C/SwiftUI/UIKit/AppKit world. If you write `"Cannot \(action) because \(reason)"`, the compiler generates code similar to `StringInterpolation(…).appendLiteral("Cannot ").appendInterpolation(action).appendLiteral(" because ").appendInterpolation(reason)`. This would show up as "Cannot " and " because " in the binary. For localizable strings, something like "Cannot %@ because %@" would show up.

    Open ##1758315