open-goal-jak-project/scripts
Tyler Wilding d1ece445d4
Dependency graph work - Part 1 - Preliminary work (#3505)
Relates to #1353 

This adds no new functionality or overhead to the compiler, yet. This is
the preliminary work that has:
- added code to the compiler in several spots to flag when something is
used without being properly required/imported/whatever (disabled by
default)
- that was used to generate project wide file dependencies (some
circulars were manually fixed)
- then that graph underwent a transitive reduction and the result was
written to all `jak1` source files.

The next step will be making this actually produce and use a dependency
graph. Some of the reasons why I'm working on this:
- eliminates more `game.gp` boilerplate. This includes the `.gd` files
to some extent (`*-ag` files and `tpage` files will still need to be
handled) this is the point of the new `bundles` form. This should make
it even easier to add a new file into the source tree.
- a build order that is actually informed from something real and
compiler warnings that tell you when you are using something that won't
be available at build time.
- narrows the search space for doing LSP actions -- like searching for
references. Since it would be way too much work to store in the compiler
every location where every symbol/function/etc is used, I have to do
ad-hoc searches. By having a dependency graph i can significantly reduce
that search space.
- opens the doors for common shared code with a legitimate pattern.
Right now jak 2 shares code from the jak 1 folder. This is basically a
hack -- but by having an explicit require syntax, it would be possible
to reference arbitrary file paths, such as a `common` folder.

Some stats:
- Jak 1 has about 2500 edges between files, including transitives
- With transitives reduced at the source code level, each file seems to
have a modest amount of explicit requirements.

Known issues:
- Tracking the location for where `defmacro`s and virtual state
definitions were defined (and therefore the file) is still problematic.
Because those forms are in a macro environment, the reader does not
track them. I'm wondering if a workaround could be to search the
reader's text_db by not just the `goos::Object` but by the text
position. But for the purposes of finishing this work, I just statically
analyzed and searched the code with throwaway python code.
2024-05-12 12:37:59 -04:00
..
batch [jak3] implement pckernel (#3472) 2024-04-15 19:26:48 +01:00
ci scripts: new linter script to detect goal_src files with trailing whitespace (#3387) 2024-02-24 14:27:56 -05:00
cpp formatter: add tree-sitter dependency and commit early draft work on a proper code formatter (#2536) 2023-04-24 23:46:55 -04:00
emacs [goalc] add a build system (#704) 2021-07-15 21:37:15 -04:00
examples scripts: Add a (hopefully) better goal_src updating script (#1769) 2022-08-19 11:30:07 -04:00
gsrc Dependency graph work - Part 1 - Preliminary work (#3505) 2024-05-12 12:37:59 -04:00
shell decompiler: some hacks to allow running decompiler on jak 3 v5 code files, improve `all-types` generation (#2526) 2023-10-07 22:14:12 +02:00
sublime_text [decomp] load boundaries (#922) 2021-10-20 19:49:32 -04:00
tasks formatter: Format `deftype` correctly (#3391) 2024-02-27 20:12:44 -05:00
analyze_build_time.py Try to speed up the build (#106) 2020-10-29 21:27:52 -04:00
combine_all_imports.py [jak2] use art constants (#2097) 2023-01-07 10:32:03 -05:00
decomp_progress.py decomp3: some engine files (#3319) 2024-01-20 10:42:51 -05:00
gen-dgo-txt.py jak2: add `.gd` files and level info for some ps3 test levels (#2776) 2023-06-27 23:52:19 +02:00
gen-test-cases.py Improved test namings for multi-operations, added new ones, still a few failures (#190) 2021-01-10 15:46:46 -05:00
memory-dump-p2s.py random fixes + support `clang-cl` on visual studio (#1129) 2022-02-07 19:15:37 -05:00
setup_art_group_imports.py [decomp] add `import` statements for art groups (#1372) 2022-05-23 18:53:02 -04:00
subtitle2_gen.py Jak 2 pc subtitle support (#2672) 2023-06-08 01:04:16 +01:00
update_decomp_reference.py [decomp] fix up debug menu rendering, add a few others (#1892) 2022-09-16 20:42:33 -04:00