Выбрать главу

"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 kind 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 Forth-like 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 tht 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."