-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gvasm v3 ideas #43
Comments
Thinking more deeply about package management. I don't like how Rust differentiates between libraries and binaries. I like the idea of a package consisting of exported symbols, available for import by another package, and multiple entry points. These entry points are what become individual ROM files. This allows for multiple ROMs to be built from the same package (good for tests, demos, debug builds, etc). The package manager solves a lot of UX problems, but one core problem I think it solves is flattening the dependencies. If A depends on B and C, and both B and C depend on D, then only one copy of D is needed. It would be stupid to install two copies of D for each B and C. Here's what I would like to do: $ gvasm new MyGame This creates a
Inside [package]
name = "MyGame"
gvasm = "3.0.0"
[header]
title = "MyGame"
initials = "My"
maker = "77"
version = 0x00
region = "E"
code = "C"
[lib]
name = "somename"
path = "src/lib.gvasm"
# default dependencies
[dependencies]
gvsong = "https://raw.githubusercontent.com/velipso/gvsong/v1.2.0/gvsong.toml"
# default defines
[def]
A = 1
B = 2
[[bin]]
name = "main"
path = "src/main.gvasm"
# example
[[bin]]
name = "debug"
path = "src/debug.gvasm"
[bin.header] # overrides default header
title = "Debug"
[bin.def] # overrides default defines
A = 3
[bin.dependencies] # overrides default dependencies
gvsong = false # remove a dependency |
I don't like the toml idea because:
That being said, the There is something nice and simple about gvasm v1. It's a single pass. It just goes from top to bottom. It's easy to understand. For gvasm v2, things had to get complicated to support incremental building. That extra complication is probably required..? For gvasm v3, I feel like I'm making it even more complicated. It's annoying. I don't like it. Installing a library should just be extracting a zip file in a directory in your repo. The library should be checked into the repo. The install instructions should literally be: download this zip, unzip it somewhere, and I feel annoyed at trying to add all these "features". Every feature is a concession. Really, the only problem that I would like to solve is flattening dependencies, if possible. And I'm not entirely sure I need to solve that. Deno/node solves the issue by having complicated library resolution logic. I don't want that. C solves issues by having a global namespace. I might want the same, for some things. Incremental building is done one "translation unit" (pretty much one file) at a time, into a .lib file. I like not having a global namespace because then you have to be explicit about your dependencies, instead of implicit. I think just supporting some sort of import mapping is good enough... like:
Then when There might even be a simpler way to do that. I guess the overall problem is that importing is pulling from a shared resource. So there needs to be a contract about how a package is resolved. And once you do that, you define how a hypothetical package manager would work. I think it needs to be slightly more complicated than downloading zip files. It should be capable of being automated. I like how nimble relies on git/hg repos, and specifies a format for tags so they can be parsed as semver. I think the "lock file" should be implemented as submodules. More to think about... |
I think I should just pick a directory for all libraries, and be done with it (like I think Then there should probably be a I think that can basically be it? There will need to be some complex wiring during import to make sure everything grabs the right file, but I think that's doable. The rest of the build can be almost entirely ignorant of the package manager. It just needs a single function that translates an import/include path into a full path, and then base everything else off of that. |
I think I will pull this back even further. Let's do the bare minimum for third-party support, which is As for package management, let's just simply not do that. Get the |
The big feature for v3 should be a system for distributing libraries (sharing code).
I should be able to pull in a music library, or a saving library, and everything should be able to work easily.
One big element of that is
iwram
/ewram
allocation. Specifically:.base
entirely.I would also like to have bug-free dependency management. That could mean a few specific things:
Looking at the Inky source code, only
main.gvasm
has.include
statements. This might need to be required going forward. Specifically, I'm imagining everything is a "library" except the main file. The main file has global config, GBA header, and include order. Then, all libraries can access the global config, or something like that.So maybe main cannot import, and can only include. Kind of like main is
package.json
, and wires up packages and configuration, along with the ability to output some code so that short single-file ROMs can be made.Maybe
.gvmain
(entry point) and.gvasm
(libraries) or something.This doesn't seem entirely correct... need to think through what it means when a library depends on another library, and how to wire up those versions correctly.
The text was updated successfully, but these errors were encountered: