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
377 changes: 299 additions & 78 deletions build.zig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/memory.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn main() !void {
var yellow_banana = trinity.bind(&banana, &yellow);

// Bundle into memory
var memory = trinity.bundle2(&red_apple, &yellow_banana, std.heap.page_allocator);
var memory = trinity.bundle2(&red_apple, &yellow_banana);

// Query: "What is red?"
var query = trinity.bind(&memory, &red);
Expand Down
11 changes: 11 additions & 0 deletions src/depin/mod.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! Корень модуля DePIN.
//!
//! network.zig, bootstrap.zig и persistence.zig ссылаются друг на друга,
//! поэтому объявлять каждый отдельным модулем нельзя — Zig сообщает
//! «file exists in modules ... and ...». Один модуль-корень с реэкспортами
//! снимает проблему: все файлы попадают ровно в один модуль.

pub const network = @import("network.zig");
pub const bootstrap = @import("bootstrap.zig");
pub const persistence = @import("persistence.zig");
pub const metrics = @import("metrics.zig");
8 changes: 5 additions & 3 deletions src/depin/network.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
// ═══════════════════════════════════════════════════════════════════════════════

const std = @import("std");
const bootstrap = @import("bootstrap");
const persistence = @import("persistence");
const metrics_mod = @import("metrics");
// Соседние файлы в том же каталоге; как модули они нигде не объявлены,
// поэтому импорт по имени не разрешался. Берём по относительному пути.
const bootstrap = @import("bootstrap.zig");
const persistence = @import("persistence.zig");
const metrics_mod = @import("metrics.zig");

// Forward decls for firebird types (will be imported by build.zig)
pub const NodeStatus = enum {
Expand Down
10 changes: 10 additions & 0 deletions src/hybrid.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Совместимостный слой для перенесённого src/hybrid.zig.
//! Типы HybridBigInt/Trit и константы доступны через фасад `zig-hdc-vsa`.

const hdc = @import("zig-hdc-vsa");

pub const HybridBigInt = hdc.HybridBigInt;
pub const Trit = hdc.Trit;
pub const MAX_TRITS = hdc.MAX_TRITS;
pub const Vec32i8 = hdc.Vec32i8;
pub const SIMD_WIDTH = hdc.SIMD_WIDTH;
Loading
Loading