Book Read Free

The Wiz Biz

Page 19

by Rick Cook


  “Thank you, Lady. Yes, I will promise.”

  Shiara nodded. Moira sniffed and bent to her mending.

  ###

  After that Wiz and Shiara talked almost every night. Moira usually went to bed earlier than they did and out of deference to her feelings they waited until she had retired. Then Wiz would try to explain his world and computers to Shiara and the former wizardess would tell Wiz about the ways of magic. While Shiara learned about video-game-user operating systems, Wiz learned about initiation rites and spell weaving.

  ###

  “You know, I still don’t understand why that fire spell worked the second time,” Wiz said one evening shortly after the first hard frost.

  “Why is that, Sparrow?” Shiara asked.

  “Well, according to what Moira told me, I shouldn’t have been able to reproduce it accurately enough to work. She said you needed to get everything from the angle of your hand to the phase of the moon just right and no one but a trained magician could do that.”

  Shiara smiled. “Our hedge witch exaggerates slightly. It is true that most spells are impossible for anyone but a trained magician to repeat, but there are some which are insensitive to most—variables?—yes, variables. The coarse outlines of word and gesture are sufficient to invoke them. Apparently, you stumbled across such a spell. Although I doubt a spell to start forest fires would be generally useful.”

  Wiz laughed. “Probably not. But it saved our bacon.”

  “You know, Sparrow, sometimes I wonder if your talent isn’t luck.”

  Wiz sobered. “I’m not all that lucky, Lady.”

  The former sorceress reached out and laid her hand on his. “Forgive me, Sparrow,” she said gently.

  Wiz moved to change the subject. “I can see why it takes a magician to discover a spell, but why can’t a non-magician use a spell once it’s known?”

  “That is not the way magic works, Sparrow.”

  “I know that. I just don’t understand why.”

  “Well, some spells, the very simple ones, can be used by anyone—although the Mighty discourage it lest the ignorant be tempted. But Moira was basically correct. A major spell is too complex to be learned properly by a non-magician. A mispronounced word, an incorrect gesture and the spell becomes something else, often something deadly.” Her brow wrinkled. “Great spells often take months to learn. You must study them in parts so you can master them without invoking them. Even then it is hard. Many apprentices cannot master the great spells.”

  “What happens to them?”

  “The wise ones, like Moira, settle for a lesser order. Those who are not so wise or perhaps more driven persevere until they make a serious mistake.” She smiled slightly. “In magic that is usually fatal.”

  Wiz thought about what it would be like to work with a computer that killed the programmer every time it crashed and shuddered.

  “But can’t you teach people the insensitive spells?” he asked. “The ones that are safe to learn?”

  Shiara shrugged. “We could, I suppose, but it would be pointless. Safe spells are almost always weak spells. They do little and not much of it is useful. Your forest fire spell was unusual in that it was apparently both insensitive and powerful. There are a very few exception but in general the spells that are easy to learn do so little that no one bothers to learn them, save by accident.”

  “Well, yeah, but couldn’t you build on that? I mean start from the easy spells and work up to the harder ones that do something useful?”

  Shiara shook her head. “Once again, magic does not work that way. Mark you, Sparrow, each spell is different. Learning one spell teaches you little about others. Wizardry is a life’s work, not something one can practice as a side craft. You must start very young and train your memory and your body before you begin to learn the great magics.”

  “I see the problem,” Wiz said.

  “That is only the beginning. Even if ordinary folk could learn the great spells, we would be cautious about teaching them lest they be misused. A wizard has power, Sparrow. More power than any other mortal. By its very nature that power cannot be easily checked or controlled by others. Few have the kind of restraint required to do more good than harm.”

  “But more people are dying because, only wizards can use the really powerful spells,” Wiz protested, thinking of Lothar and his cottage in the Wild Wood.

  “More would die if those who are not wizards tried to use them. Life is not fair, Sparrow. As you know.”

  Wiz didn’t pursue the matter and their talk went on to other things. But it troubled him for the rest of the evening.

  Shiara’s right, he thought as he drifted off to sleep that night. You can’t have just anyone working magic here. It would be like giving every user on the system supervisor privileges and making them all write their own programs in machine language. Not even assembler, just good old ones and zeroes. He sleepily turned the notion over in his mind, imagining the chaos that would cause in a computer center. You can’t trust users with that kind of power. God, you don’t even want most programmers writing in assembler. You make them use high-level languages.

  A vagrant thought tugged at the edge of Wiz’s sleep-fogged brain. A computer language for magic?

  My God! I’ll bet you could really do that!

  He sat bolt upright. Well why not? A computer language is simply a formalism for expressing algorithms and what’s a magic spell but an algorithm?

  If it did really work that way the possibilities were mind-boggling. You’d need the right language, of course, but God what you could do with it.

  These people were the original unstructured programmers. They were so unstructured they didn’t even know they were programming. They just blundered around until they found something that worked. It was like learning to program by pounding randomly on the keyboard. They never seemed to generalize from one spell to another. They needed some land of language, something to let them structure their magic.

  It would have to be something simple, Wiz decided. A language and an operating system all in one. Probably a very simple internal compiler and a threaded interpreted structure. And modular, yes, very modular.

  Forth with object-oriented features? Yep, that made sense. All thought of sleep vanished as Wiz got of bed. His mind was full of structural considerations.

  He dug a chunk of charcoal out of the fireplace and started sketching on the hearth by the wan moonlight. Just a basic box diagram, but as he sketched, he became more and more excited.

  A Forthlike language was about the simplest kind to write. Essentially it was nothing but a loop which would read a command, execute it and go on to read the next command. The thing that made such languages so powerful was that the command could be built up out of previously defined commands. MOBY could be defined as command FOO followed by command BAR. When you gave the loop, the interpreter, the command MOBY, it looked up the definition in its dictionary, found the command FOO, executed it, went on to the command BAR and executed it, thus executing the command MOBY.

  At the top of a program was nothing but a single word, but that word was defined by other words, which were defined by other words, all the way back to the most basic definitions in terms of machine language—or whatever passed for machine language when the machine was the real world.

  The more Wiz thought about that, the better he liked it Forth, the best-known example of the genre, had been originally written to control telescopes and Forth was a common language in robotics. It had the kind of flexibility he needed and it was simple enough that one person could do the entire project. That Forth is considered, at best, decidedly odd by most programmers didn’t bother Wiz in the slightest. The critical question was whether or not a spell could call other spells. The way Shiara had used a counting demon to trigger the destruction spell in her final adventure implied that it could, but the idea seemed foreign to her.

  He sat on the hearth, sketching in the pale moonlight until the moon sank below the horizon and
it became too dark to see. Reluctantly he made his way back to bed and crawled under the covers, his excitement fighting his body’s insistence on sleep.

  Nothing fancy, he told himself. He would have to limit his basic element to those safe, insensitive spells Shiara had mentioned. So what if they didn’t do much on their own? Most assembler commands didn’t do much either. The thing that made them powerful was you could string them together quickly and effectively under the structure of the language.

  Oh yes, debugging features. It would need a moby debugger. Bugs in a magic program could crash more than the system.

  It’s a pity the universe doesn’t use segmented architecture with a protected mode, Wiz thought to himself as he drifted off. As he was slipping into unconsciousness, he remembered one of his friend Jerry’s favorite bull session raps. He used to maintain that the world was nothing but an elaborate computer simulation. “All I want is a few minutes with the source code and a quick recompile,” his friend used to tell him.

  He fell asleep wondering if he would get what Jerry had wanted.

  ###

  All through the next day Wiz’s mind was boiling. As he chopped wood or worked in the kitchen he was mentally miles away with dictionaries and compiler/interpreters. He didn’t tell Moira because he knew she wouldn’t like the notion. For that matter, he wasn’t sure Shiara would approve. So when they were sitting alone that evening he broached the subject obliquely.

  “Lady, do you have to construct a spell all at once?”

  “I am not sure I know what you mean, Sparrow.”

  “Can’t you put parts of simple spells together to make a bigger one?”

  Shiara frowned. “Well, you can link some spells together, but . . .”

  “No, I mean modularize your spells. Take a part of a spell that produces one effect and couple it to a part of a spell that has another effect and make a bigger spell.”

  “That is not the way spells work, Sparrow.”

  “Why not?” Wiz asked. “I mean couldn’t they work that way?”

  “I have never heard of a spell that did,” the former wizardess said.

  “Wouldn’t it be easier that way?” he persisted.

  “There are no shortcuts in magic. Spells must be won through hard work and discipline.”

  “But you said—”

  “And what I said was true,” Shiara cut him off. “But there are things which cannot be put into words. A spell is one, indivisible. You cannot break it apart and put it back together in a new guise any more than you can take a frog apart and turn it into a bird.”

  “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 two hundred 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 12 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 a
nd 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.

 

‹ Prev