NokiMo
Douglas Miller
Douglas Miller

patreon


MiP B2 Chapter 25: A New Language

<< First | < Previous | Next >

Amber yawned, but shook her head and determinedly held on to wakefulness. She straightened her back and rubbed a little sand out of her eyes, then turned to face Carlos, who was sitting crosslegged next to her in their tent. She reached out to him mentally, through their shared bond with Purple. [Alright, we've both finished building your "integrated development environment" idea. Now show me what's so amazing about it.]

Carlos shook off a yawn of his own and looked back at her. [Are you sure you want to do this tonight? We're both very tired.]

[I've waited long enough already. I admit we don't have the energy to really get into it in depth right now, but I want to at least get my first glimpse of it.]

[Okay. Give me a minute.] Carlos concentrated on something for a long moment. Just when Amber was starting to worry that he might have fallen asleep, he finally stirred again. [There. It's borrowing rather heavily from the languages I'm most familiar with, not adjusted much for the use cases of incantations, and I'm sure it's incomplete and will need a lot of refinement, but it's done. I made a preliminary version of my new spell design language and copied it to Purple's knowledge store. See if you can get your spell language database to accept it.]

Amber reached for Purple's knowledge repository and examined the new… thing in it. [Uh. Just looking at that, I really can't make much sense of it. It feels like… I guess a tangled knot of… memories? Experiences? Wordless concepts? It's all pretty tightly woven, and I can't pick out any single thing in it clearly.]

Carlos sent a feeling of sheepish embarrassment over the link. [Yeah, sorry. I kind of just… shoved my intuitive understanding of what I want into a language definition and massaged it until it worked. It's the only way to do it quickly enough for tonight. I'd prefer to put everything in explicit words, examining and considering every detail, but that would take a lot more time. Nowhere near as long as it would take to make an incantation version of the IDE, but still too long.]

Amber cocked her head and blinked. [Wait, you think you could make an incantation to duplicate what we devoted 13 soul structures to?]

[Not easily, not quickly, and only 12 of them at most. As far as I know, the spell database must be a soul structure. But the editor, transpiler, optimizer, and all the rest? Given unlimited time to work on it? Yes. It would take me multiple decades, or even a century, but I could eventually do it. Earth's software engineers did it for computers without soul structures, and incantations have the necessary capabilities for it to be possible.]

Amber sat in stunned silence, contemplating the idea of a spell that would help design and create whatever other spells you wanted. After perhaps a minute, she tentatively ventured a question. [And whoever did it didn't keep it to themselves?]

Carlos laughed loudly, a single time, then cut himself off. [Sorry, sorry, it's an entirely reasonable question in light of your background. It's just that Earth's situation is so very different that the idea of not selling it on Earth seems ridiculous. The personal benefits of such a thing are much smaller than here. In this world, we might be able to use it to develop our personal power to unprecedented heights, and anyone selfish would never even consider sharing such a powerful advantage for any ordinary price. On Earth, the only way for the creators of an IDE to gain significant personal benefit from it is to sell it - and not just to one person, or a few, but to as many buyers as they can possibly find. Millions of people, for the most popular ones. Oh, and there are several different ones, all made by teams of people working together.]

He shook his head and let out a long, slow breath. [But enough of that side track. That bundle isn't meant to be understood directly; it's meant to be put into your spell language database, and from there to be used by all the other structures. So, see if you can get your database to accept a copy of it as a spell language definition.]

[Alright.] Amber mentally touched the weird tangled knot of knowledge and willed the copying to happen. Her own language database rejected it at first, as it didn't exactly fit what she'd originally had in mind as how a spell language should be defined, but she altered the database to make it accept this form of a definition. The alteration took some time to find the right solution and settle, but then information began to flow. Concepts, rules, and connections flew past her mind faster than she could even glimpse most of them. Just seconds later, it was done. [Okay, now what?]

Carlos grinned at her. [I say always start out learning a new language with the basics. So, let's go back to the very first spell we ever learned: Light. Use your detranspiler to convert the… 12 lines of that incantation into this language, and see what it's like.]

Amber could feel anticipation practically radiating from Carlos as he watched. She smiled uncertainly, then brought the Light spell to mind. [Alright, let's see what I get.] She focused on her spell editor and commanded it to invoke the detranspiler and show her the result. A section of text appeared in her mind's eye, and she almost did a double take at it. [Did something go wrong? It's so small!]

spell <mana = 0.1> {
  do {
    glow(color: white, shape: sphere, direction: all, intensity: 0.01, location: target);
  } while (true);
}();

[Wait…] Amber read through the contents of it, identifying the parts that corresponded to each part of the original incantation. [Never mind, it's all there. Just a lot shorter.]

Carlos's delight bubbled over as he nodded with a beaming smile. [Actually, let me make a small tweak to the language… There, get that update and try again.]

[Alright.] Amber touched Purple's knowledge store again, and found it only took a moment to take in just the difference for the new version.

spell <mana = 0.1> {
  continuous {
    glow(color: white, shape: sphere, direction: all, intensity: 0.01, location: target);
  }
}();

[Huh. Okay, that does make it a little easier to understand. But why are the effects indented, and why did you make this language require indenting like that? And how the hell are people supposed to speak indentation? Timed pauses of just the right length before each line?]

Carlos answered with the firmest conviction Amber had ever seen him show. [Because the first and most important trait of good code is that it must be readable - easy for others to understand - and proper indentation like that makes the structural context of sections of code instantly obvious at a glance, when it would otherwise require considerable extra reading and analysis to figure out. As for speaking, this language is not meant to be spoken. It doesn't need to be spoken, because it won't be used in actually casting anything.]

Amber blinked and gave Carlos a long look. [Why do you feel so strongly about that?]

Carlos let out a dry, humorless laugh. [Try teaching two dozen novices who don't understand why readability matters, let them use a language that doesn't enforce proper indentation, and give them work to do something non-trivial. When you see the unreadable abominations some of them come up with, you'll understand.] He shuddered. [But for something more immediate, how about we take a look at how the Find Path spell Trinlen showed us looks in this language.]

Amber nodded. [That will double as a test that the detranspiler can work with just the words of an incantation, too, since we haven't actually learned that spell yet.]

spell <mana = pool, limit = 50% capacity> {
  Location destination = displaceLocation(location: target, east: 2134.2, south: 788.6, down: 46.9);
  Distance distance = distance(firstLocation: target, secondLocation: destination);
  Integer detourLimit = 1000;
  label restart:
  Location current = target;
  List<Location> path = makeList();
  path.append(current);
  Integer length = 1;
  List<Location> reached = makeList();
  reached.append(current);
  do {
    foreach (Location neighbor in listNeighbors(location: current, distance: 0.5, directions: cardinals, orderCriterion: proximity, proximalLocation: destination)) {
      Distance firstDistance = distance(firstLocation: neighbor, secondLocation: target);
      Distance secondDistance = distance(firstLocation: neighbor, secondLocation: destination);
      if (firstDistance + secondDistance - distance > detourLimit) goto nextNeighbor;
      foreach (Location reachedLocation in reached) {
        if (neighbor == reachedLocation) goto nextNeighbor;
      }
      Line connection = lineSegment(firstLocation: current, secondLocation: neighbor, width: 0.5);
      if (scanDensity(region: connection) > 120) goto nextNeighbor;
      if (scanCohesionStrength(region: connection) > 80) goto nextNeighbor;
      if (distanceOfSupportSurface(location: neighbor, direction: down, weight: 300) > 5) goto nextNeighbor;
      path.append(neighbor);
      reached.append(neighbor);
      current = neighbor;
      length += 1;
      goto continue;
      label nextNeighbor:
    }
    path.removeLastElement();
    current = path.getLastElement();
    length -= 1;
    if (length != 0) goto continue;
    detourLimit *= 2;
    goto restart;
    label continue:
  } while (current notNear destination);
  …
}

Amber didn't bother even skimming the parts of the spell that took the found path, which was often something atrocious, and found ways to improve it to be more reasonable. [What was it that you called the later parts of this spell, again? A "rotten pile of" something about kludges and monkeys?]

Carlos chuckled. [I believe I called it "a rotting pile of every kludge but the kitchen sink, taped together at random by monkeys until they found a combination that, for reasons no one could possibly comprehend, somehow works." Anyway, what do you think of the initial part? It's still far from what I would consider actually good, but compared to the original incantation language?]

[Oh, is that why the linter and optimizer are almost yelling at me?] Amber yawned again, then shook her head. [It's definitely shorter.] She tried to read through it in more detail, but even with the text all being presented directly to her mind by a soul structure, it all seemed blurry. She tried to focus one more time, but soon gave up and let her fatigue pull her head down onto Carlos's shoulder beside her. [Too tired. I'll think about it tomorrow.]

[That's fair. What we told Ressara about not pushing herself too hard really should go for us too.]

Amber was only dimly aware of Carlos gently lowering her head onto a pillow, and fell asleep soon after.

___

The next morning, both of them woke up late and felt much better rested. Crown Mage Felton was openly waiting for them when they came out of their tent. He had a complete suit of the sabotaged armor set up on an armor stand in a nearby clear spot outside the collection of tents, and he was standing beside it, tapping his foot impatiently. He even scowled a little when Carlos and Amber went to eat a quick breakfast first, but did not protest.

Carlos called Trinlen to join them and took the lead, walking confidently up to the suit of armor and focusing on it even as he spoke to the royal mage. "Alright, Felton, how do you want to start this collaboration?"

Felton gave a nod of acknowledgement. "Lord Carlos. Lady Amber. I take it you want your employee to share in any lessons I give."

Carlos nodded. "That would be appreciated, but my main reason to include him is that his unusual creativity might help solve the sabotage mystery."

Felton gave Trinlen a hard look, but soon shrugged and addressed Carlos again. "Very well. You have made your version of Ressara's defense against attention diversion, correct? We can begin with seeing what you can determine with that and your mana sense, as things stand now. I expect little or no immediate results, but it will serve as a starting point to assess your capabilities and what shortcomings I might need to teach you to rectify."

"That sounds reasonable. Let me see…" Carlos inspected the armor's enchantments carefully while slowly walking a circle around it. Amber stood in place and just leaned a bit closer while doing her examination. Examined from outside without using its self-reporting features, the whole thing was still inscrutably complex and too dense for him to make out any truly meaningful details, but the texture it formed in his senses was finer-grained than it used to be. Something else new stuck out much more strongly to him, however.

"Okay, I can tell you that the attention diversion wards in this thing apparently react to any attempt to examine the enchantments, regardless of how much or how little details the senses they're reacting to can detect. And they are really, really tiny. I felt a lot of tugs on my attention, trying to push me away from noticing one thing and instead notice something else that was so nearby that I couldn't otherwise even sense that the two things were separate."

Felton nodded gravely. "That makes sense for the subtlety and sophistication of the known effect of it. It also strengthens my suspicion that it was built in by the armor's original creator. Lady Amber?"

Amber looked up briefly from her continued probing of the enchantments. "I felt the same effect. We'll need to refine our mana sense to get any useful details."

Felton waved a hand dismissively. "That will certainly help, but it is a matter of soul structures and long practice, not something I can teach. I gather that it is part of your plans for tomorrow, when you reach Level 19 and your Tier 8 merge." He paused for a moment, and Carlos and Amber both nodded. "Good, but that will be of limited benefit without knowledge of runic enchantments to go with it."

His mana poked something specific in the armor's gauntlets, and each gauntlet's armored plates started peeling back. Felton paused for a moment. "Oh, but before I begin the lessons, I should ask: in what ways do your house secrets change the best way to teach you?"

<< First | < Previous | Next >

Comments

Or Welcome to the Club. Instead of a County we'll have to find you an area for a Kingdom all for yourself.

Heiko

Honestly, I'm amused that Carlos is going full belt-and-braces (no pun intended) by requiring *both* indentation and braces. With as long as this world has lived with unstructured programming, they could use a language that enforces best practices. I love when fantasy wizards have Strong Opinions on How To Do Magic Right.

Josh

You still alive?

viperfan7

Been a while, hope you’re okay

Dale

The Crown's reaction: "I'm not even mad, thats amazing"

viperfan7

I thought so, but it would be an interesting power move to adopt a Crown Mage. (it might get out that they can re-write soul structures though)

Connor Mcharg

I meant trinlen lol

viperfan7

Seems like something that could be handled with a reasonably clever soul structure or two. Look at the macro scale schematics, activate the shrinkiphier structure, and that result goes through the synergy to an engraver structure to actually carve it in.

George

I've binged twice, and i've only noticed the RPG stats-sheet come up once, very early in the story. More info please so we can get an idea on how compression changes stats?

D S

Casting with thought alone was something that in the chapter it was originally mentioned was mentioned as something that some legendary mages did. Which would hint that it would be possible with a specific soul structure with it and impossible without. And having that functional would be a pre-requisite for multicasting. The main idea of reference casting structure, is avoidance of difference between two different words about knowing. Just going through list of possible words takes days and still not being able to do it, but if they need to spend time in meditating deeper meaning of all the words they want to use in a spell that time would accumulate to staggering numbers. It's more about getting rapidly new words to use in spells and rapid prototyping, and alteration of existing spells by being able to use spellwords that they haven't spent meditating upon. But it would be useful if they could use Libraries and frameworks without needing to speak everytime the compiled version of library function but instead could just active it everytime. edit: On a second thought, the KNOWING part of that structure isn't actually needed because multiple minds. It's kind of a background task, that can happen when doing something else on the foreground. But the idea of casting library functions and framework functions without needing to cast every compiled thing included in that function would be insanely beneficial if possible.

Jouni Osmala

“See, Trinlen? That’s how you teach a High Noble Mage!” …also, they’re probably going to be two of the easiest to teach students Felton will ever have - he can just show them a word, and they’ll learn it (assuming they somehow don’t already know it), the moment one of them grasps a concept, the other will almost instantly learn it (almost as if they’re directly sharing their knowledge), and High Lord Carlos seems to already have vast amounts of almost-relevant knowledge anyway.

Connor Mcharg

Casting with a thought and multimind casting both got re-attempted last chapter (Amber tried to silently long-form cast two levitates simultaniously, failed, and found she could at least silently activate pre-cast spells) - it’s just a matter of a few more levels by the sound of it. The reference documentation just has words, not spells, and those words either aren’t effects, or need you to set parameters before they can do anything (you can’t cause a glow without saying where, among other things). Direct-from-editor casting does sound helpful, but I suspect it’d be more useful to just have a structure that rapidly converts from editor to soul structure and then cast as normal - possibly with something to speed up cast times. …the final two just sound useful, no notes.

Connor Mcharg

We’re getting live hot fixes for a fictional code language. “We’re through the looking glass now lad”.

Markell

Casting structure ideas... Casting with just thought, like mentioned in the book1. Multiple minds able to cast at the same time. Ability to cast anything in reference documentation. Ability to cast quickly anything that's in the editor. Targeting helper.... Ability to execute a spell with breakpoints and stepping forward line by line in the editor.

Jouni Osmala

The thing is the indents should matter for linting, but not actually running the code.(unless your language uses indents instead of {} and the like.

ShadeByTheSea

TYFTC! Wow that spell was definitely something, and will probably be easier for a complete rewrite rather than a refactor. I have a feeling that many spells will be used as inspiration and rewritten instead of refactored. I do wonder how much this will speed up their learning both sin the short term and long term.

Ben Bass

Fixed. Thank you.

Douglas Miller

…do you mean Crown Mage Felton, or Trinlen, trickster advisor to High House Carlos?

Connor Mcharg

Saw a double colon in your code

Kef

Yes, it was. Making this code actually good - within what the constraint of not changing its conceptual logic flow allows - would require some significant refactoring, not just translation from one language to another.

Douglas Miller

Oh no, was the nested combination of do-while loop, foreach loop and a goto-label loop always there in the original? Yeah, you shouldn't support that in a new language!

Sid_Cypher

5 bucks said that whoever made those really tiny spells used a version of our worlds photolithography steppers. —For the uninitiated, you coat the surface of whatever you’re trying to make a tiny image on in a layer of photoresist, then set up a microscope lens over the top where you want the image. Then take a projector lens and flip it so that when you shine a light down rather than the image getting blown up it shrinks down into eyehole of the magnifying glass. Next, place a photo negative on top of projector lens and shine a big powerful light down your series of lenses; you will see that a very, very tiny tiny version of the photo negative is projected on the photoresist. The parts that are exposed become hard while the areas covered by the negatives shadow remain solvent. Develop the photoresist so that the unwanted photoresist is removed and only the image negative remains. Finally dip your object in an acid solution and boom! Tiny spells chemically etched into place. (You can then use acetone to remove the no longer needed photoresist). Either that, or the crafter has very tiny gnomes at work. Edit; spelling -on phone.

Markell

Why do we indent? Because of the endless number of hours we’ve all spent looking for that missing/extra semicolon or parentheses. Also, five imaginary dollars says that the secret to reading their shiny new spellbook is finding the Greek question mark that he snuck in to replace a semicolon.

Michael Wilson

what

Test Patron Plz Ignore

Really just using this account to prevent the inevitable oncoming of the "first" comment, aren't you?

Jambles

Wonder if I can expense this patreon now that it has code in it? :)

Joppest

Felton should just be adopted at this point

viperfan7

Magical Python, here we go

daavko

This is why syntax highlighting is a thing

Carl Gherardi

Fuck yeah!!!

Justin Drake

FIRST

Test Patron Plz Ignore


Related Creators