[Cryptography] Swift and cryptography

Nemo nemo at self-evident.org
Mon Jun 9 20:14:33 EDT 2014


Arnold Reinhold <agr at me.com> writes:

> Apple's new programming language, Swift,

"What we need most, at this juncture, is another programming language"

...said nobody over the age of 30, ever.

Why does every fresh CS grad feel the need to invent his own programming
language (and/or "make" replacement)?

I guess Apple has hired a few, so this one may take longer than usual to
fade away, unfortunately. On the bright side, I have had a recent debate
with some colleagues over whether Apple has jumped the shark, and this
should settle it.

> Swift also allows types to have properties, and the properties 'min'
> and 'max' are defined in Swift for all integer types, e.g. UInt8.max,
> which is 255.

Awesome! If only the C++ committee had thought of this and incorporated
it into the ISO standard back in 1998.

Oh wait, they did:

// Initialize n to 255.
int n = std::numeric_limits<uint8_t>::max();

This gadget behaves like a compile-time constant for most purposes in
C++98, and for all purposes in C++11.

> One area that comes to mind is some way to erase data that is
> guaranteed not be removed by the optimizer.

Formally meaningless. Optimizers do not "remove" anything; they
transform code into semantically equivalent code, where "semantically
equivalent" is defined by the language specification. Concepts outside
of the language -- like "leaking data to the operating system" -- do not
generally appear in the language spec, and for good reason.

"Guaranteed erasing of data" is and always will be a platform-specific
concept, regardless of language.

I spent some time reading the Swift documentation today and -- when I
could see through my tears of laughter -- I saw nothing that might
contribute to any application domain, least of all cryptography.

But perhaps I am being too cynical. It has happened once or twice.

 - Nemo
   https://self-evident.org/


More information about the cryptography mailing list