Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@ pub fn build(b: *std.Build) void {
// Cycle 78: Optional tree-sitter integration for VIBEE AST analysis
const enable_treesitter = b.option(bool, "treesitter", "Enable tree-sitter AST analysis for VIBEE (requires libtree-sitter)") orelse false;

// The modules src/trinity.zig lost when 42490a22 moved them out. Declared
// here, before the first use, because three separate targets root that file.
//
// The naming in golden-float is confusing enough to be worth writing down:
// its root exports `bigint`, and that name points at ternary/hybrid.zig,
// while the actual bigint is exported as `ternary_primitives`. The aliases
// below are chosen by what each module CONTAINS -- checked symbol by symbol
// against what src/trinity.zig re-exports -- not by what it is called.
const zig_hdc_dep2 = b.dependency("zig_hdc", .{ .target = target, .optimize = optimize });
const gf_dep = b.dependency("zig_golden_float", .{ .target = target, .optimize = optimize });
const hdc_vsa_mod = zig_hdc_dep2.module("zig-hdc-vsa");
const gf_mod = gf_dep.module("golden-float");

// Library module for imports
const trinity_mod = b.createModule(.{
.root_source_file = b.path("src/trinity.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "hdc_vsa", .module = hdc_vsa_mod },
.{ .name = "golden_float", .module = gf_mod },
},
});

// VIBEEC compiler module — single source of truth from trinity-nexus/lang
Expand All @@ -44,6 +61,10 @@ pub fn build(b: *std.Build) void {
.root_source_file = b.path("src/trinity.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "hdc_vsa", .module = hdc_vsa_mod },
.{ .name = "golden_float", .module = gf_mod },
},
}),
});
b.installArtifact(lib);
Expand Down Expand Up @@ -175,6 +196,10 @@ pub fn build(b: *std.Build) void {
.root_source_file = b.path("src/trinity.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "hdc_vsa", .module = hdc_vsa_mod },
.{ .name = "golden_float", .module = gf_mod },
},
}),
});

Expand Down
4 changes: 4 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
.url = "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/gHashTag/zig-hdc/archive/main.tar.gz",
.hash = "zig_hdc-0.1.0-6NS2Eoy7FgAFWrBY3anapf1nXxhm6TvPApY3NHoSW8MG",
},
.zig_golden_float = .{
.url = "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/gHashTag/zig-golden-float/archive/main.tar.gz",
.hash = "golden_float-2.1.0-h7LKhQ3lCgBfkjryIT9MnOTWleMQrdrgOIxQOhxqzTVu",
},
},
.paths = .{""},
.fingerprint = 0xa9f69745ba7ed82d,
Expand Down
28 changes: 22 additions & 6 deletions src/trinity.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@

const std = @import("std");

// Core modules
pub const bigint = @import("bigint.zig");
pub const packed_trit = @import("packed_trit.zig");
pub const hybrid = @import("hybrid.zig");
pub const vsa = @import("vsa/core.zig");
pub const vsa_agent = @import("vsa/agent.zig");
// Core modules.
//
// Four of these were files in this repository until 42490a22 moved them into
// gHashTag/zig-hdc and gHashTag/zig-golden-float without moving the references,
// which is one of the reasons this build failed from March. They come from
// those packages now.
//
// The aliasing is decided by what each module CONTAINS, checked symbol by
// symbol against the re-exports below, not by what it is called: golden-float
// exports `bigint` and that name points at its ternary/hybrid.zig, while the
// actual big-integer module is exported as `ternary_primitives`.
const golden_float = @import("golden_float");

pub const bigint = golden_float.ternary_primitives;
pub const packed_trit = golden_float.packed_trit;
pub const hybrid = golden_float.bigint;
pub const vsa = @import("hdc_vsa");
pub const vm = @import("vm.zig");

// vsa/agent.zig is not re-exported. Its five parts have never been tracked in
// this repository, and they are not in zig-hdc either -- the facade there was
// withdrawn for the same reason. Nothing below referenced vsa_agent, so this
// removes a name nobody could resolve rather than a capability anybody had.

// SDK modules (high-level API)
pub const sdk = @import("sdk.zig");
pub const science = @import("science.zig");
Expand Down
Loading