For most parts it's code. Well, code is a quite sloppy term, it covers a huge list of uses, from card scratching to encryption. So more correctly, it's a program (*1), as it defines a sequence of action to be taken by the machine - interpreted when the loom runs the cards.
If at all, then thread is data. It is input from spools, processed by the loom according to the program and output as cloth.
The holes represent whether the mechanical energy should be transferred to that thread or not.
Exactly the same way an instruction describes what buffers are to be opened or latches to be enabled when executed.
For example a TAX
instruction of a 6502 defines that the AC/SB
signal is to be pulled during PHI1
, as well as the SB/X
signal, thus transferring the content of Accumulator output buffer onto the SB-bus to be latched by the X (register).
The fact, that it's 'punched' as an encoded 8 bit value, instead of separate 'holes' for each latch/buffer doesn't change the workings. Making it explicit for each circuit would turn the 6502 into a VLIW processor - many 'holes', nonetheless a CPU. Isn't it?
Also, how energy is transferred doesn't matter. Direct or indirect, level or type can be of any and does only make a statement about the construction, not the process. A CPU can as well be build using high voltage FET operating at 200V DC. Heck, tube computers did exactly that :))
In digital circuits program code decides the arrangement of the transistors thus configuring the circuit.
Not. Code doesn't configure any transistor or circuit. The circuit is static, and a program commands, when sequenced, its actions.
And that's the core point here: programming is sequencing of actions (*2). And that's exactly what loom cards do - they define a sequence of actions to be performed to generate a certain cloth.
Further Considerations:
This question seams to stir a lot of emotions and many logical shortcuts are taken, so let's look at the details (and some claims made in comments)
What is a Program
Wikipedia (*3): "A [computer] program is a collection of instructions that performs a specific task when executed [by a computer.]". It doesn't require anything special from a program beside instructions (being executed) performing a task. Instructions, when turned into explicite form are usually called code.
What are Instructions
Interestingly Wiki points here again to 'Computer Program'. It seams to be one of the words that are so obvious that there is no need to add an entry. Still, I think it's agreeable to say that an instruction is a data element, that instructs a machine, when read, to show a certain behaviour - aka executing it.
It needs to have Conditionals
Or as Chris puts it: 'That lack of any provision for flow control or conditionals makes the continuous loop of cards clearly just data, not a "program" in the computing sense of the word'
Not sure what a "computing sense" is and why it needs to be introduced. But even in computing conditionals are optional. They are only a requirement if the goal is to create an universal computer. Just because it's the standard we use, doesn't make it the only way.
But let's take a look at this by a very simple example. Assume we have a trafic light, controlled by an 8080 CPU, executing on a fixed (ROM based) program. It runs steady, monotone and forever thru the light cycle. Such a program could look this
OUT YELLOW
OUT WAIT_1
OUT RED
OUT WAIT_15
OUT RED_YELLOW
OUT WAIT_1
OUT GREEN
OUT WAIT_15
JMP START
Each accessing either port switches on the marked configuration (may vary per country) or halts the execution for a given time.
I think we all can agree this is a program, don't we? Sure, it doesn't use conditionals, and doesn't need to, but it's a programmed sequence doing the job. And it's not a fixed function machine, but executing a stored program, which can be exchanged - like with a version for a light scheme used in the US.
Now let's play evil scientist, pull out the 8080, take our handy laser tool and burn all conditional opcodes (and there's 24 of them) from the 8080s instruction decoder. Geniuses as we are, we do not damage any other part. Putting it back, it will run the lights as before. No chance visible.
But there are no longer any provisions for conditions. Does it mean that the unchanged code now is no longer code? No. It still is. All this proves is, that code does not need an universal computer to run. It still is (the very same) code.
What we have changed is the processor executing the instructions - exchanging a __universal_ for a non-universal one. And that's exactly what a Jacquard loom is. A non-universal processor running code.
But the punch cards got a separate hole for each lever to be pulled
True. But also, isn't that the way instructions on a VLIW processor are? Having separate bits for each function available?
Let's take above 8080 and turn it into a VLIW machine with bits for each and every sup function. While it would be somewhat uneconomical (*4), engineers would like it for the simplicity to build it. It would work great, wouldn't it?
Now we can go ahead and remove every function except for the 5 functions needed for the 6 output functions plus the jump - on a loom we can even save that by just splicing the ends to form a card loop. It would still work, despite having separate 'holes' for each function to be executed. In fact, we can even save on one, as we now can encode RED-YELLOW as a combination of the two holes for RED and YELLOW. The benefits of VLIW :)
Like before it wouldn't change neither meaning nor operation.
But again, what's on the cards is data describing the pattern
Maybe on an abstract level. With enough abstraction even humans may count as rational. A real answer needs a closer look, which in this case reveal the holes as instructions to the processor in the of the form
Shed group 1/4/5
; Use shuttle B
; (Pick
; Batten
)
This is not a description for a pattern, but an instruction for the machine to operate. The pattern is what results from processing these instructions by the means of sheding, picking and batting. With different instructions a different pattern will emerge
But I Mean ....
Hmm, meaning is maybe another good angle to look at it - not the personal opinion, but meaning vs. purpose. The Purpose of the holes of punch cards in a loom are to create a pattern - much like the purpose of a game is to entertain you (*5). But the Meaning of the holes is to instruct the movement of machine parts - exactly like the instructions in said video game code is to make 'move' parts of your computer.
The separation between goal to be reached and action to be taken is, as usual a quite a significant one.
Bottom line: A Jacquard loom is a processor running a stored programm from a loop of punched cards - thus what's on the cards is code.
*1 - To distinguish between data and code is rather artificial when it comes to stored program computers, or how would you characterise a program consisting only of instructions using implied or immediate data? Code? Data? CoTa? DaDe? The line isn't just blurry, but effectively nonexistent.
"Data as explicit item" comes only into play when external to the program - and even then one could argue, that the program is a virtual machine, and the data read is the code it runs.
*2 - Which is why we talk about TV, Radio or Theater programs.
*3 - No, I'm not implying in any way, that Wiki got any more authority here than other sources. None the less, it seams like a reliable definition others can agree.
*4 - And that's by the way the whole reason for having compact opcodes instead of VLIW.
*5 - Not entirely shure about that, With some tripple-A titles it seamed more as if they were made on purpose to make me angry at having spend all that money.