
zig note
無料で読める本
zig言語学習帳。 しばらく zig してなかったのだが、また触り始める。 2周め。 `v0.11 dev~` 軌道に乗るまでに手間取りました。 他の言語と違うところ、初見でわかりにくいところのメモなど。 ~`v0.10`
Chapters
zig 紹介
VSCode の設定
zls: LanguageServer
@import
build: build.zig
build system
breaking changes !
その他のエラー
.{} 無名リテラル, デフォルト値, anytype(tuple)
命名規則など
フォーマッター: zig fmt
struct
optional orelse & error catch
関数: 関数仮引数は const
関数: array は struct 扱い
関数: 関数ポインター
単複pointer, slice, array, sentinel, optional
allocator
文字列: []const u8
Runtime polymorphism
型変換
std: ArrayList
std.HashMap
writer
std.log
comptime: TypeInfo
duck typing
std: json
Cとの連携
test
@cImport と zig translate-c
async: suspend, resume
std.zig.parse: ast
Iterator
コマンドライン引き数
meson から クロスコンパイラとして使う
Community
Author
Topics