first-amend.py

Programmers’ art as
that of natural scientists
is to be precise,
complete in every
detail of description, not

leaving things to chance.
Reader, see how yet
technical communicants
deserve free speech rights;
see how numbers, rules,

patterns, languages you don’t
yourself speak yet,
still should in law be
protected from suppression,
called valuable speech!

The above excerpt is from DeCSS Haiku, a transcoding of DeCSS, which is a piece of software once used to ‘illegally’ decrypt DVDs.

Written by software developer Sech Schoen, the 456-stanza haiku was created to protest the arrest of DeCSS co-creator Jon Lech Johansen, for copyright infringement, and was intended to serve as proof that source code is speech and should be protected under the First Amendment.

I was inspired after reading Gabriella Coleman’s article Code is Speech; which explores various arguments in support of Schoen’s opinion, to make my own attempt at transcoding; only in the opposite direction.

speech >> code.

The below script, which is written using language from the first amendment, prints 'make law'  when unconstitutional = false and the full text of the first amendment on a loop when unconstitutional = true.

import time

acts = ['respects', 'prohibits','abridging','assemble','petition']

violations = ['religion','freedom of','right of']

subjects = ['establishment','free exercise','speech','press', 
'people','petition']

lines = [
'Congress shall make no law respecting an establishment of religion,',
'or prohibiting the free exercise thereof;', 'or abridging the freedom
of speech,','or of the press;', 'or the right of the people peaceably
to assemble, ','and to petition the Government for a redress of 
grievances.'
        ]

unconstitutional = True

def law (): 
    for violation in violations:
        if violation == 'religion':
                for subject in subjects:
                    if subject == 'establishment':
                        for act in acts:
                            if act == 'respects':
                                break
                    
                    elif subject == 'free exercise':
                        for act in acts:
                            if act == 'prohibits':
                                break
                                
        elif violation == 'freedom of':
                for subject in subjects:
                    if subject == 'speech':
                        for act in acts:
                            if act == 'abridging':
                                break
                    elif subject == 'exercise':
                        for act in acts:
                            if act == 'prohibits':
                                break

        elif violation == 'right of':
                for subject in subjects:
                    if subject == 'people':
                        for act in acts:
                            if act == 'assemble':
                                break
                                
                    elif act == 'petition':
                                break

        return lines[0] + lines[1] + lines[2] + lines[3] + lines[4] +
        lines[5] + '\n'

while unconstitutional is True:
    print law()
    time.sleep(.2)
else: 
    print 'make law'