So with the announcement that Apple's Swift will be open sourced, I spent a
little time this morning going through the language guide to get a sense of
the language. Open source means multi-platform, so prior to that
announcement Swift wasn't really of any interest to me. There's no
particular ordering to the following thoughts.

>From a "modern language design" perspective, I see essentially nothing in
Swift that is interesting. You can see the start of some features that
originated in functional languages creeping in (pattern proto-matching, opt
type, type inference), but not really all that many of them. The language
has generics, but not polymorphism. Some variants of enumerations look like
discriminated unions, and it appears there are no non-discriminated
(indiscriminate?) unions. Swift continues Apple's commitment to ARC, though
the ARC/GC debate remains (so far as I can tell) a holy war. Some renaming
of familiar concepts (Protocols instead of Interfaces).

So far as I can tell, Swift permits method and operator overloading, but
not function overloading. This seems like a very odd choice.

There doesn't appear to be a specification of how inference works. The
language reference, for example, does not give type rules.

There is pseudo-support for currying, but it seems oddly done. There's also
a very odd handling of closures when they appear in the tail argument
position. It seems strange that this wasn't generalized a bit.

There is a limited constraint mechanism on generic types.

All in all, Swift seems like a language designed by people who don't
actually know the current state of the art. It seems very ad hoc, with
partially implemented ideas all over the map.

Buried in all of this, I'm sure there is a new idea or two that I should be
aware of. Can somebody try to enlighten me?


shap
_______________________________________________
bitc-dev mailing list
bitc-dev@coyotos.org
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to