WASM instead of Lua

Post all other topics which do not belong to any other category.
SSkeptix
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 16, 2025 9:20 pm
Contact:

WASM instead of Lua

Post by SSkeptix »

Hi, I didn’t find a better place to ask this question.
I have a short technical question for the developers:
If you had to create the modding system again today, would you prefer to use WASM instead of Lua, or is Lua still the better choice for Factorio
h.q.droid
Fast Inserter
Fast Inserter
Posts: 207
Joined: Mon Nov 18, 2024 12:10 pm
Contact:

Re: WASM instead of Lua

Post by h.q.droid »

Not a Factorio dev, but I won't consider WASM for a modding system:

- Bad development ergonomics. You have to compile something else into WASM, so it would be clunky to run something immediate from the map editor.
- Bad performance. WASM trades high interfacing overhead for computational efficiency. The evidence is WASM being much slower at DOM manipulation than vanilla Javascript. For a mod it's usually counter-productive since modding is mostly interfacing.

Do you have some computation-heavy modding ideas in mind? Maybe they can be implemented using some creative shader passes?
SSkeptix
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 16, 2025 9:20 pm
Contact:

Re: WASM instead of Lua

Post by SSkeptix »

Thanks for the great answer! I hadn’t thought about the performance cost between the WASM and engine boundaries.
No, this question isn’t about any specific modding ideas — I’m a developer (but not a game dev). I'm just curious about how things work in the game development world or maybe I should say performance-optimized world.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16205
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: WASM instead of Lua

Post by Rseding91 »

I would be interested in trying C# as a modding language alternative, but I haven’t looked into the cons of it, and I’m unsure if it supports running on non-windows.
If you want to get ahold of me I'm almost always on Discord.
Tertius
Smart Inserter
Smart Inserter
Posts: 1448
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: WASM instead of Lua

Post by Tertius »

Rimworld modding is C# based, however as far as I understand Rimworld itself is programmed in C# (Unity engine) and the modding "API" is just a hook into the class and object structure directly. It's directly patching the game, not going through a well defined modding api. A different concept than Factorio. And also as far as I know, mods are supported on all the platforms Rimworld is running on: Windows, Mac, Linux. Consoles are supported as well, but I don't know about mods for these.
Post Reply

Return to “General discussion”