Show HN: Get started modding Factorio in TypeScript
cdaringe.github.io
cdaringe.github.io
4 years ago I was managing a Feed The Beast (A heavily modded and themed Java Minecraft version) server and in that mod packages was OpenComputers (https://ocdoc.cil.li/) which exposed a lua api and in game computers to the players. The OpenComputers Package Manager (https://github.com/MightyPirates/OpenComputers/blob/master-M...) became a limiting factor to my players as they wanted some ability to load from other sources so I converted the program to MoonScript (https://moonscript.org/) and maintained a fork with modifications for them.
MoonScript was certainly more pleasant to write and maintain (compared to Lua), but type safety would've definitely helped squash some of the weirder side effect driven bugs. That said, I still think MoonScript is a great middle ground for things that are written in Lua but need some extra organizational tools.
At what point is the value of type safety offset by the complexity of transpiling scripting languages? TS is a superset of JS, so that is at least a pretty simple conversion... but TS to Lua?
Now, there's a bunch of possible solutions to this problem (I think the best approach is to have the concept of a UI mod which can affect the interface but not the game world. As an added benefit you could allow users to have different sets of UI mods installed and not depend on the server using it), but the engineering effort involved is not so simple as just adding another part to the API (and factorio developers are generally going to try to do something well if they do it).
Some more context:
But just curious, does anyone thing a regex train renamer sounds like a good idea? I'm thinking you can select an area then change all stop, stations and schedules according to a regular expression.