This project is under active development.
SharpForge is a C# scripting toolchain for Warcraft III: Reforged map development. It lets map authors write selected systems in strongly typed C#, emit plain Lua, bundle that Lua with existing Lua projects, and inject the result into a .w3x map.
- Do one thing and do it well. Each tool has a narrow job: transpile C# to Lua, bundle Lua, inject maps, generate JASS bindings, or orchestrate those tools in the GUI.
- Integrate with your current toolchain. World Editor still owns terrain, object data, and placed units. SharpForge fits beside your editor, source tree, Lua modules, and map build process.
- Do not reinvent the JASS API. SharpForge does not translate platform calls into a fantasy object model.
KillUnit(unit)staysKillUnit(unit), notunit.Kill(). - Migrate incrementally. Existing Lua modules keep working. New C# code can call into Lua, Lua can call generated output, and projects can move one subsystem at a time.
- Emit performant Lua. Generated code is direct Lua with a small helper surface. The bundled C# library is intentionally minimal: usable
List<T>andDictionary<K,V>shapes, not a full clone of every .NET collection interface. - Keep the runtime small. SharpForge provides only the helpers needed by emitted code and interop stubs. It does not ship a broad standard-library translation layer.
https://www.hiveworkshop.com/threads/wip-introducing-sharpforge-a-c-to-lua-toolchain.371979
- CLI - man page for
sf-transpile,sf-build, andsf-jassgen. - GUI - GUI wrapper behavior and fields.
- Generated Lua - emitted Lua shape, root table contract, runtime bias, and build notes.
Complete documentation for every supported language construct and how it lowers to Lua:
- Types — primitives, literals
- Operators — binary, unary, compound assignment
- Strings — interpolation, concatenation, format specifiers
- Control Flow — if/else, while, for, foreach, switch, break, continue
- Arrays — creation, element access, length
- Classes — static/instance, constructors, fields, auto-properties, events
- Inheritance — single inheritance, virtual/override, base(), interfaces
- Structs — field flattening, multi-return, SoA List
- Enums — enum lowering, Flags diagnostic
- Exceptions — try/catch/finally, throw
- Delegates — lambdas, Func<>, operator overloads
- Async — coroutines, Task.Delay, CorRun__/CorWait__
- Collections — List<T> and Dictionary<K,V>
- Regex — Regex.IsMatch subset
- Lua Interop — LuaInterop, LuaObject, [Lua(...)] attributes
- Casting — explicit cast erasure, is/as
- Conditional — ternary ?:, Ternary__ helper
- Diagnostics — [Debugger] probes, DesyncLinter
SharpForge/
src/
Transpiler/ sf-transpile.exe - C# to Lua
Builder/ sf-build.exe - Lua bundler and map injector
JassGen/ sf-jassgen.exe - JASS to C# binding stubs
Gui/ sf-gui.exe - wrapper UI for the tools
tests/
Transpiler.Tests/
assets/
jass/ checked-in common.j/blizzard.j sources
libs/ bundled C# stubs copied into user projects
Requires .NET 10 SDK. The SDK version is pinned by global.json.
dotnet build SharpForge.sln
dotnet test tests\Transpiler.Tests\Transpiler.Tests.csprojPublish framework-dependent single-file executables:
.\publish-all.ps1MIT © 2026 SharpForge contributors.
Significant portions of this codebase were drafted, refactored, and reviewed with AI pair programming in VS Code with GitHub Copilot Chat. All AI-generated changes are reviewed, compiled, and tested by a human before commit. Project conventions, design decisions, and acceptance criteria are owned by the maintainers, not the model.