SceneGen icon indicating copy to clipboard operation
SceneGen copied to clipboard

Remove SwiftGodotKit dependency by implementing parser directly

Open PadraigK opened this issue 2 years ago • 1 comments

Binary size, build time and execution time could be improved a lot, if it wasn't depending on Godot's parser.

A fun thing to do would be to write something that could pull out the relevant parts of TSCN files, and then we could drop the SwiftGodotKit dependency.

TSCN file format CPP File where Parser is implemented

PadraigK avatar Oct 13 '23 18:10 PadraigK

This might not even be a good idea, since:

  1. The currently parser has been well lived on and is on the critical path for any Godot usage: it's probably very good and has already seen all the edge cases that only show up as you process 1000s of projects.
  2. We are currently guaranteed long term compatibility with Godot, even if they overhaul their formats.

But:

  1. The formats are extremely simple and should not be complicated to parse.
  2. It would be fun to implement 🤔 🤔
  3. Godot 4 migration from 3 is still ongoing and I feel safe in betting that a big transition in storage formats is not something coming anytime soon.
  4. The SwiftGodotKit dependency is heavy and makes it hard to ship SceneGen as a simple executable
  5. SwiftGodotKit currently spits out a lot of debug info on the commandline when we run SceneGen, though this is probably solvable without reimplementing the universe, I just haven't tried yet.

PadraigK avatar Oct 16 '23 21:10 PadraigK