Introduction - chung-leong/zigar GitHub Wiki
What is Zig?
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. Its powerful metaprogramming model allows it to interoperate easily with other languages, including dynamic ones like JavaScript.
const std = @import("std");
pub fn main() void {
std.debug.print("Hello world!", .{});
}
What is Zigar?
Zigar is a toolkit for running Zig code in a JavaScript environment. It lets you use Zig in web apps, server-side apps, and desktop apps. It consists of a runtime for accessing Zig data structures, adapters that perform call marshalling, and a module managing the compilation process.
import { main } from './hello.zig';
main();
Hello world!
What can I do with Zigar?
Zigar allows you to:
- Create cross-platform desktop applications with full access to system resources and a UI powered by popular web tech like React and Svelte
- Create server-side applications with full access to system resources
- Create high-performance WebAssembly code for data-intensive operations in the web browser