"In my world we used to do things like that all the time."
Shiara smiled. "Things work differently in this world, Sparrow."
"I don’t see why," Wiz said stubbornly.
Shiara sighed. "Doubtless not, Sparrow. You are not a magician. You do not know what it is like to actually cast spells, much less weave them. If you did it would be obvious."
Wiz wasn’t sure who had said "be sure you’re right and then go ahead," but that had been his motto ever since childhood. The stubborn willingness to go against common opinion,and sometimes against direct orders, had gotten him the reputation for being hard to manage, but it had also made him an outstanding programmer. He was used to people telling him his ideas wouldn’t work. Most of the time they were wrong and Wiz had always enjoyed proving that. In this case he knew he was right and he was going to prove it.
All the same, he didn’t want anyone to know what he was up to until he was sure he could make it work. The thought of Moira laughing at him was more than he could bear.
Just inside the Wild Wood, perhaps 200 yards from the keep of Heart’s Ease, was a small log hut. From the stuff on the floor Wiz suspected it had been used to stable horses at one time. But there were no horses here now and the hut was long deserted. Wiz cleared out the debris and dragged a rude plank bench which lay in a corner under the window. There was a mouse nest in another corner, but he didn’t disturb that.
The next problem was writing materials. This world apparently wasn’t big on writing, at least there weren’t any books in Heart’s Ease. The usual material was parchment, but he didn’t have any. Finally he settled on shakes of wood split from the logs in the woodpile and wrote on them with charcoal.
Fundamentally, a computer language depended on three things. It had to have some method for storing and recalling data and instructions, instructions had to be able to call other instructions and it had to be able to test conditions and shift the flow of control in response to the results. Given those three very simple requirements, Wiz knew he could create a language.
His first experiment would just be to store and recall numbers, he decided. He wanted something useful, but he also wanted something that would be small enough not to be noticed, even here in the quiet zone. Besides, if magic hurt Shiara he did not want to make detectable magic.
Drawing on what Shiara had told him, he put together something very simple, even simpler than the fire spell he had discovered by accident.
Although the spell was simple, he labored over it for an entire day, checking and rechecking like a first-year computer science student on his first day in the computer lab.
Late that afternoon he picked up a clean slab and a piece of charcoal. His hand was shaking as he wrote 1 2 3 in large irregular characters on the wood. Then he very carefully erased the numbers leaving only a black smear.
"Remember," he said and passed his hand over the board. There was a stirring shifting in the charcoal and the individual particles danced on the surface like an army of microscopic fleas. There, stark against the white of newly split wood, appeared 1 2 3.
"Son of a bitch!" Wiz breathed. "It worked."
He stared at the reconstituted numbers for a long time, not quite believing what he had done. He repeated the experiment twice more and each time the characters or designs he scrawled on the board and erased reappeared on command.
Okay, the next step is a compare spell. In IF-THEN. For that I’ll need . . . Then he started as he realized how late it had gotten. He still hadn’t cut wood for the next day and it was almost time for dinner.
For a moment the old fascination and new sense of responsibility warred in his breast. Then he reluctantly put down the board and started back to the keep. If I don’t show up soon someone is likely to come looking for me, he thought. Besides, they’ll need wood for tomorrow.
No one seemed to notice his absence or made any comment when he disappeared the next day after his stint at the woodpile. The comparison spell also proved to be straightforward. The final step was the calling spell, the spell that would call other spells. That was the key, Wiz knew. If it worked he had the beginnings of his language.
Again Wiz worked slowly and carefully, polishing his ideas until he was sure he had something that would work. It took nearly three days before he felt confident enough to try it.
Once more he wrote a series of numbers on a clean slab of wood. Then he erased them. Then he readied the new spell.
"Call remember," he commanded.
There was a faint "pop" and a tiny figure appeared on the work bench. He was about a foot high with dark slick hair parted in the middle and a silly waxed mustache. He wore white duck trousers, a ruffled shirt and a black bow tie. Without looking at Wiz, he passed his hand over the board and once again the bits of charcoal rearranged themselves into the numbers Wiz had written. Then with another "pop" the figure disappeared.
Wiz goggled. A demon! I just created a demon. Shiara had said that once a spell grew to a certain level of complexity it took the form of a demon but he had never expected to make one himself.
He had never considered what a command would look like from within the computer. I never had to worry about that, he thought, bemused.
This particular command looked darned familiar. Wiz didn’t know for sure, but he doubted that bow ties and waxed mustaches were worn anywhere on this world. After wracking his brains for a couple of minutes he remembered where he had seen the little man before. He was the cartoon character used to represent the interpreter in Starting Forth, Leo Brodie’s basic book on the Forth language.
That made a crazy kind of sense, Wiz told himself. What he had just written functionally was very close to a Forth interpreter. And he was basing his language in part on Forth. Apparently the shape of a demon was influenced by the mental image the magician has of the process.
I wonder if he speaks with a lisp?
Then he sobered. More to the point, how could he be sure that his language’s commands would respond only to the explicit spells that defined them and not by some chance idea or mental image? Wiz made his way back to the castle in deep thought.
It wasn’t at all as easy as that. The first thing Wiz discovered was that the universe was not orthogonal. The rules of magic were about as regular as the instruction set on a Z80. Some things worked in some combinations and not in others. Murphy said "constants aren’t" and Murphy was apparently one of the gods of this universe.
He was uncomfortably aware that he didn’t really understand the rules of magic. He deliberately limited his language to the simplest, most robust spells, counting on the power of the compiler to execute many of them in rapid succession to give him his power. But even that turned out to be not so simple.
There were some things which seemed to work and which were very useful, but which didn’t work consistently or wouldn’t work well when called from other spells. Wiz suspected the problem was that they were complex entities composed of several fundamental pieces. He deliberately left them out of the code. After all, he rationalized, this is only version 1.0. I can go back and add them later.
He benchmarked his compiler at about 300 MOPS (Magical Operations Per Second). Not at all fast for someone used to working on a 3 MIPS (Million instructions per Second) workstation, but he wanted reliability, not speed. Besides, my benchmarks are for real, he told himself, not some vapor wafting out of the marketing department.