Patrefans
Douglas Miller from patreon
Douglas Miller patreon

MiP B2 Chapter 15: Spellcraft Analysis

🕑 Added 2024-07-16 17:02:18 +0000 UTC

Comments

John

TYFTC

Pheonixarcher

Is it wrong that I want him to build a projectable interface for working on this stuff? Like he builds a test environment for spells. Basically builds an interface, interacts with code, and a testing space he can play with spells in. This sound like a blank unreal engine world or something

Pheonixarcher

I just want him to complain that he knew people who could make something that took a day to run he could optimize it to take less than a second. Just reminds me of those guys on youtube who optimize code to make it 1,000,000% faster.

Mark Nelson

The Memory Leak is likely handled outside of the spell itself. When a spell stops being processed or runs out of mana. The shaped mana containing the data of the spell likely dissolves. Also mana does not seem to care about density of itself.

Chase

Feel like a crackhead, keep lookin for the new post.

David Ellis

I was actually past that phase when Gentoo got big. I wrote modelines by hand for my dad's analog projection wide-screen TV for Red Hat 9.0 (not RHEL, just Red Hat) in the late 90s. By the point Gentoo was a meme I was 50/50 Ubuntu and OS X (home and work, respectively).

Maurice Brown

He hurts us because he loves us…

Maurice Brown

…you did a lot of Gentoo ahem optimization didn’t you..

Hilton Janfield

First step to an MMO where you have to cast magic by writing functions :)

Hilton Janfield

Search SWAG for some old Pascal pathfinding code optimized with ASM. It'll probably look a lot like what you wrote with a mix of low-level ASM inline functions for speed and high-level Pascal code for things like list management. Once upon a time we wrote things to optimize for speed. Today is all bloat. It's libraries all the way down... As far as UI response and general use, my 486/33 and P75 felt faster than my Core i7 does.

Ben Bass

TYFTC! I love how Carlos is critiquing the spell as it is being cast. It will be very interesting what his programming skills can bring to the table without a full IDE, and what his debugging structure will help him do with these completely unoptimized spells.

Neshura

I think it's hard to not make decent changes to this garbled mess

Neshura

same, I have no experience in writing compilers (or in this case interpreters) but I'm absolutely tempted to try, if anything only to see these horrid code fragments in 'action'

pfreya

Oh man, I’d absolutely be down to contribute to an open source implementation of this magic language and a VM to run it if that ever became a thing

Sid_Cypher

The program does remind me of Shenzhen I/O, though.

Josh

> I aimed to make it function correctly, while being plausible as the product of someone reasonably smart but without the accumulated knowledge base of a major industry to build upon. It also feels plausible as being what someone who is dealing with a language closer to assembly than a high-level language would write. When you have the benefit of a high-level language, it's much easier to consider writing something more complex. When you're writing in a very low-level language, and one that probably has no debugging tools either, you sometimes want to do the simplest thing that can possibly work, unless you absolutely *have* to optimize it.

Josh

> Carlos snorted in amusement. Special parameter options for ordering the list by proximity to somewhere are not an immediately obvious and natural design choice for that. I bet one of the system designers got frustrated with having to include code for sorting the list in their incantations, and abused their system access to make an invokable utility function for the sorting the only way they knew how to. Eh, that one seems perfectly reasonable. Depending on how the universe is organized and what data structures the magical system substrate uses, it may genuinely be more efficient to return the list in sorted order rather than sorting it afterwards.

David Ellis

I half expected that you wrote a shitty search algorithm, compiled to assembly with `-funroll-all-loops`and then translated that into a weird quasi-Javascript and finally replaced some things to make it magical (plus converting one loop into a statement because you got tired of the inanity)

ShadeByTheSea

Likely because with magic you have to actually supply the water(mana).

Petr Pavelka

There is nothing wrong with goto statements if you follow certain patterns. Some low level or older languages have only goto statements. Any higher language control structures are technically converted to jump instructions during compilation because cpu only understands jumps or conditional jumps. I am bit surprised that author of that algorithm did not inspire himself in nature. For example imagine a labyrinth and infinite source of water, you pour water into it until it reaches destination and every second you track which intersection/split already has water in it and where the water came from to it first. It eliminates problem of loops and finds the shortest path. It is easy to imagine and therefore easy to build a functional algorithm using that idea. The main downside is that it would be memory intensive.

viperfan7

I bet notepad yelled at you then crashed when you tried to save it

Maurice Brown

[laughing in O-notation]

Douglas Miller

While I was writing it, I struggled to not cringe. 🤣

viperfan7

Why would you hurt me like that. You are a truly evil person

Marconi H Gonçalves

I don't think I'll have any excuses to learn a programming language, even a layman like me of current languages, this compilation is worse than the Basic and Fortran that I learned...

Connor Mcharg

Thanks, I hate it, and now I’m going to get a good night’s sleep, re-read it, and try to run it manually for testing reasons.

Ben Riker

My man. Everything compiles on paper. That said if you ever want to mock up your own language it would be an awesome project.

Logos

In another world, in another time. Edsger Dijkstra suddenly stops pacing back and forth in his office. "Goto statements!" he seethes quietly, before continuing his pacing.

Olli Erinko

As a developer myself, this chapter was especially painful to read. I hope the camp optimizations are decent :D

Test Patron Plz Ignore

First!


More Creators