Differences and Limitations
This page describes differences and caveats in RemObjects Silver vs. Apple's standard Swift implementation. These differences fall into three categories:
Please check out the Language Extensions topic for detailed coverage of the features Silver adds on top of regular Apple Swift. These are few, and only added with extreme caution where necessary to properly embrace all platforms.
Temporary Limitations (as of Elements 8.1)
These are temporary limitations or differences in our implementation of Swift. They are due to the beta status or that we simply haven't found proper solutions for them yet on all platforms, and our goal is to resolve these before "Silver 1.0" ships, or in subsequent releases. Please also refer to the Beta FAQ.
- Protocols cannot be applied to structs on Cocoa (bugs://69405)
init!initializers are not supported yet (bugs://69641)
- Currying is currently not yet supported (bugs://71456)
The differences listed here are permanent and intrinsic to Silver's implementation of Swift, usually driven by demands of the platforms. We expect these differences to remain indefinitely.
The standard Swift
[T:U]Array and Dictionary types are classes and not structs in Silver, because the .NET and Java runtimes do not provide the mechanism to implement structs with efficient copy-on-write semantics, unfortunately. Struct-based arrays or dictionaries would perform terribly on .NET and Java. String is a reference type, for the same reason.
Silver uses the platform String types (with some ) which are UTF-16 based, implemented as reference types, and immutable.
Type Extension are limited when the extended class is declared in a different project/assembly, and they do not support (a) adding new fields or stored properties or (b) implementing additional protocols.
On the Cocoa and Island platforms, not every (non-class) type descends from the root
Objectclass. As a result, in Silver types that do not descend from
Objectare not compatible with the Swift-defined