You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filed separately from #7 because this is a different and worse failure mode: these do not error, they return the wrong answer. A missing bridge is discoverable — the script stops and names the symbol. These produce plausible output that silently disagrees with stock Swift, which is especially dangerous given the stated goal of running LLM-generated code, where nobody is watching each line.
Found while probing bridge coverage on main (71605b2); each was checked against swiftc for the expected value.
Construct
Stock Swift
swift-script
Property wrapper with a clamping setter
10
50 — the wrapper is ignored, the raw value is stored
Result builder collecting statements
"a b"
"b" — only the last statement survives
"héllo".utf8.count
6
5 — returns the Character count
dict["k"] as? Int where the value is boxed
Optional(1)
nil — as? through an Optional fails
The README lists property wrappers and result builders under "What does NOT work", which is fair — but silently producing a different value is a stronger claim than "not implemented". Rejecting them outright (unsupported attribute @propertyWrapper) would be strictly better than honouring the declaration and ignoring its semantics, since the script author gets a boundary error instead of a wrong number.
The utf8.count and as? cases look like plain bugs rather than documented limits, and both are the kind of thing that shows up in string handling and JSON walking constantly.
Suggested resolution, in order of value:
Make ignored constructs fail loudly. If @propertyWrapper and @resultBuilder semantics are not implemented, refuse the declaration rather than accept it and diverge.
Fix as? through Optional, which currently breaks the common dict["k"] as? T idiom.
Consider a conformance test that runs the Examples/llm_probes/ scripts under both swiftc and swift-script and diffs the output, so divergence is caught by CI rather than by a reader noticing a suspicious number. Tools/bridge-metrics.sh already has a probes-pass axis for this — it is currently reporting zeros for an unrelated reason (see Foundation bridge coverage: five generator limits block most everyday scripting #7).
Two adjacent findings, lower severity: protocol extensions are rejected (cannot extend unknown type 'Greeter'), so protocol default implementations are unavailable; and actors, some P and generics — all listed as unimplemented in the README — actually work, so the README understates the interpreter.
Filed separately from #7 because this is a different and worse failure mode: these do not error, they return the wrong answer. A missing bridge is discoverable — the script stops and names the symbol. These produce plausible output that silently disagrees with stock Swift, which is especially dangerous given the stated goal of running LLM-generated code, where nobody is watching each line.
Found while probing bridge coverage on
main(71605b2); each was checked againstswiftcfor the expected value.1050— the wrapper is ignored, the raw value is stored"a b""b"— only the last statement survives"héllo".utf8.count65— returns the Character countdict["k"] as? Intwhere the value is boxedOptional(1)nil—as?through anOptionalfailsThe README lists property wrappers and result builders under "What does NOT work", which is fair — but silently producing a different value is a stronger claim than "not implemented". Rejecting them outright (
unsupported attribute @propertyWrapper) would be strictly better than honouring the declaration and ignoring its semantics, since the script author gets a boundary error instead of a wrong number.The
utf8.countandas?cases look like plain bugs rather than documented limits, and both are the kind of thing that shows up in string handling and JSON walking constantly.Suggested resolution, in order of value:
@propertyWrapperand@resultBuildersemantics are not implemented, refuse the declaration rather than accept it and diverge.String.utf8.count(and checkutf16.count/unicodeScalars.countalongside it).as?throughOptional, which currently breaks the commondict["k"] as? Tidiom.Examples/llm_probes/scripts under bothswiftcandswift-scriptand diffs the output, so divergence is caught by CI rather than by a reader noticing a suspicious number.Tools/bridge-metrics.shalready has aprobes-passaxis for this — it is currently reporting zeros for an unrelated reason (see Foundation bridge coverage: five generator limits block most everyday scripting #7).Two adjacent findings, lower severity: protocol extensions are rejected (
cannot extend unknown type 'Greeter'), so protocol default implementations are unavailable; and actors,some Pand generics — all listed as unimplemented in the README — actually work, so the README understates the interpreter.