In some fantasy, I guess lay lines, dolmens, stone circles and the like are kinda infrastructure for magic? Totally agree about the programming = magic, and in a “fantasy” world I worked on for a game the twist was that all the ‘magic’ was just programming and hacking the old advanced tech computer / satellite network.
The “mages” had some augmented reality type implant that allowed them to call up minority report style screens they could interact with, and give verbal commands. But to everyone else they’re just waving their hands through the air in strange patterns and saying gibberish words “sayday spayis slash eih tay say slash”.
The wizards had no real idea what they were doing, and researching new “spells” was basically the same as a noob trying get some feature working on a remote Linux server with only two partial and contradictory walk-throughs for an earlier version of the distro. So even if they got stuff working, they rarely understood how or why it worked.
I think it’s really interesting to think about how even though computing is generally objective / logical, if you stripped away all background knowledge and added in a bunch of uncertainty (it’s hard to communicate with the server and sometimes your commands get scrambled, so even the same command might not always work) then you’d end up in a situation quite like ancient / medieval science where people hyothosise about principles and make systems that are helpful, but don’t actually align to what’s really happening.
Must make turning corners, parking and dealing with hazards a wild experience.