The FBI hearing over Apple encryption is now postponed, but one of the arguments in that case – as they Electronic Frontier Foundation advanced it – was that code is speech, and should be free speech:
The Supreme Court has rejected requirements that people put “Live Free or Die” on their license plates or sign loyalty oaths, and it has said that the government cannot compel a private parade to include views that organizers disagree with. That the signature and code in the Apple case are implemented via technology and computer languages rather than English makes no difference. For nearly 20 years in cases pioneered by EFF, the courts have recognized that writing computer code is protected by the First Amendment. In a brief from EFF and leading technology experts, we have told the court considering Apple’s case that forcing the company to write and sign a new operating system for the government is akin to the FBI dictating a letter endorsing backdoors and forcing Apple to sign its forgery-proof name at the bottom.
Here’s that brief: