hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
294 stars 24 forks source link

Zig: FFI(C interop) #362

Open hhstore opened 2 years ago

hhstore commented 2 years ago

related:

Zig FFI + Flutter/Dart:

hhstore commented 2 years ago

Zig FFI 教程:

image

教程:

无需 FFI, 直接导入 C 的能力:

Zig 作为 C 编译器使用:

导出 C lib:

For WebAssembly:

我写的 c 调用 zig 示例:

hhstore commented 2 years ago

github search:

keywords:


@cImport(

@cInclude(

ffi cases:

热门 c binding 项目:

libc:

lib 示例:

应用示例:

grpc 示例:

hhstore commented 2 years ago

zig + C 示例:

ffi bindings:

简单示例:

hhstore commented 2 years ago

zig + c 教程:

hhstore commented 2 years ago

zig + iOS/MacOS:

搜索:

iOS:

MacOS:

zig + Android:

hhstore commented 2 years ago

使用 Zig + FFI 配合 Flutter 方案: