DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻訳待ち
Desktop apps in Zig, with native UI drawn on the GPU or a web frontend.
翻訳待ち
開発ツールZig · JavaScriptGitHub @hunghg255オンライン所有者未確認
Have you tried it? One tap is enough. No sign-in needed.
Buzzing on social · #30 now · 1 sources
Checked 11月13日 21:16 · Scores are copied from each platform at the last check. We don’t copy post bodies or comments, and deleted posts disappear here too.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗Each window shows one of two kinds of interface:
Apps are single binaries. Nothing polls, so an idle app uses no CPU. The
documentation covers all of it; it is also a
VitePress site, which cd docs && npm install && npm run dev serves locally.
myzig was called nanoui. Its module, flags (--myzig-*), page runtime
(window.myzig) and URL scheme (myzig://) are named after it now; the build
still exports the module as nanoui too, for apps that import the old name.
git clone https://github.com/hunghg255/myzig
cd myzig
zig build run-gallery # the native UI tour
zig build run-hello # the webview example
zig build test # unit and widget tests
You need Zig 0.17.0, plus the macOS SDK on a Mac (Xcode or the Command Line Tools). Linux apps need GTK 3 at run time (and WebKitGTK for pages) and nothing at build time; Windows apps need the WebView2 Runtime for pages.
To make an app of your own, build the CLI and run myzig init:
cd cli && zig build -Doptimize=ReleaseSmall # cli/zig-out/bin/myzig
myzig init my-app # native UI; --template web for a page
cd my-app && myzig dev # runs it, rebuilding as you edit
myzig build # the release and its packages
See Getting started, which also tours every example.
The loading gallery, ported from mygo's
6725e0d, shows all 29 loading.dev indicators in native UI. Run
zig build run-loading; its reusable loading plugin
also exposes duration, Ripple direction, Wave origin and Blocks sweep.
zig build test-loading checks the plugin and gallery,
animation, pause/resume and reduced motion offscreen.
const Counter = struct {
n: i64 = 0,
fn view(s: *Counter, c: *ui.Context) void {
const col = ui.div(c).column().sizeFull().center().gap(16);
defer col.end();
ui.textf(c, .{ .size = 56, .weight = .bold }, "{d}", .{s.n});
if (ui.button(c, "Increment", .{ .variant = .primary }).clicked) s.n += 1;
}
};
pub fn main(init: std.process.Init) !void {
const app = try myzig.App.create(init, .{ .name = "Counter" });
defer app.destroy();
var state: Counter = .{};
_ = try app.newWindow(.{ .title = "Counter", .content = .{ .view = .init(&state, Counter.view) } });
try app.run();
}
Views are immediate mode: a function of your state, run on every event. Widgets answer from the previous frame's layout. When an interaction changes state, the frame is built again before it's drawn, so the screen never lags the state.
ui.grid), and right to left.ui.div(c).row().gap(8).bg(...).ui.list), trees, outlines,
sortable tables and grid views, a router, actions and focus groups.:hover does, double
clicks, drag and drop, and pointer tracking for graphs (c.wants_moves).const Greeter = struct {
pub const myzig_params = .{ .greet = .{"name"} };
pub fn greet(_: *Greeter, call: *myzig.Call, name: []const u8) ![]const u8 {
return call.arena.print("Hello, {s}!", .{name});
}
};
const Tick = myzig.Event("tick", struct { uptime: u64 });
// in main:
try app.bind(&greeter);
try app.registerEvent(Tick);
_ = try app.newWindow(.{ .title = "Hello", .content = .{ .page = .{ .url = "/", .assets = &assets } } });
import { Greeter, onTick } from "/myzig.js"; // generated, served by the app
document.body.textContent = await Greeter.greet("Ada");
onTick(({ uptime }) => console.log(uptime));
zig build gen writes myzig.d.ts:
This is the beginning of the README. Read the rest at the original. Read the full README ↗