feat: implement standard library (std) management and import system #269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the foundational infrastructure for the Wave Standard Library (
std). It includes a dedicated management system for installing and updating the library via the CLI, a revamped import resolution mechanism for namespaced modules, and a lightweight custom JSON parser to handle metadata without adding external dependencies.Key Changes
1. Standard Library Management CLI
wavec install stdandwavec update std./stddirectory from the official repository.~/.wave/lib/wave/std.gitand ensures theHOMEenvironment variable is correctly set before proceeding.2. Namespaced Import System
std::Prefix Support: Refactored the import resolver to recognize thestd::namespace (e.g.,import("std::io::format")).~/.waveinstallation directory.import("./local_file")) remain unchanged, maintaining backward compatibility.parse_wave_fileto eliminate redundant logic across the parser.3. Lightweight Internal JSON Parser
utils::json, a custom-built JSON parser designed to read standard library manifests.serde_jsonfor simple configuration tasks.4. CLI & Error Handling
CliErrorvariants for specific failures, such as installation errors, missing Git binaries, and manifest validation failures.5. Initial Std Content & Testing
std/manifest.jsonand a placeholderstd/io/format.wavemodule.test/test75.waveto verify complex string manipulation logic and struct usage within the context of the new import system.