Open3
zig study log
自分の環境
以下どちらか
- Windows11
- M1 Mac
Install
use scoop install:
scoop bucket add versions
scoop install versions/zig-dev
❯ zig version
0.10.0-dev.3027+0e26c6149
Getting Started
Getting Started ⚡ Zig Programming Language
❯ zig build run
info: All your codebase are belong to us.
❯ zig run src\main.zig
info: All your codebase are belong to us.
tree /F
❯ tree /F
フォルダー パスの一覧: ボリューム Windows
ボリューム シリアル番号は 548D-577A です
C:.
│ build.zig
│
├─src
│ main.zig
│
├─zig-cache
│ ├─h
│ │ 0285d5ef59bceabdfffe05eef6b71817.txt
│ │ 5ee0b4be0be7b1c5e213433b5dac4f5f.txt
│ │ 882fb167aef4f9f0b0f2b6a7cc091fef.txt
│ │ bc7c745002a9ce1576cc70386347c3a6.txt
│ │ c53c4c7059483c1601c43c37e57bfdfe.txt
│ │ timestamp
│ │
│ ├─o
│ │ ├─2b247b6a067377d4d408d086de1b8455
│ │ │ builtin.zig
│ │ │
│ │ ├─2c3a8a43ec751589bb5b8d82ea071c68
│ │ │ builtin.zig
│ │ │
│ │ ├─79254b1804052e6a150604fa9e053cee
│ │ │ hello-world.exe
│ │ │ hello-world.obj
│ │ │ hello-world.pdb
│ │ │
│ │ └─9b9fa711c350ea0f8b30af483bbe9e41
│ │ build.exe
│ │ build.obj
│ │ build.pdb
│ │
│ ├─tmp
│ └─z
│ 7c23bfa112164b267505bf5b833b65d0
│ d8ab0497fb115744633eeaa7368b6e89
│
└─zig-out
└─bin
hello-world.exe
hello-world.pdb
生成された main.zig
const std = @import("std");
pub fn main() anyerror!void {
// Note that info level log messages are by default printed only in Debug
// and ReleaseSafe build modes.
std.log.info("All your codebase are belong to us.", .{});
}
test "basic test" {
try std.testing.expectEqual(10, 3 + 7);
}