post: shipping zig libraries with C ABI#84
Conversation
Summary of ChangesHello @xhwanlan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求新增了一篇博客文章,旨在为Zig开发者提供一个全面的指南,说明如何在不公开源代码的情况下,通过C应用二进制接口(ABI)分发Zig库。文章详细介绍了如何利用Zig的 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
|
||
| ```zig | ||
| // lib.zig | ||
| pub const Container = extern struct { |
There was a problem hiding this comment.
container 没必要extern 吧?只是暴露内部字段
There was a problem hiding this comment.
示例有点问题,如果函数有用相关结构,需要用extern保证内存布局符合C。
|
|
||
| 艾达:编译时收集有些困难。不过办法还是有的,如果`exports`在编译时和生成头文件时是不同的函数是不是就可以解决了。接下来就是zig构建系统的事情,我们要利用其module机制。 | ||
|
|
||
| 艾达:首先我们把项目分成四部分,分别是库本身、编译时导出符号模块、运行生成头文件模块和运行生成头文件的主函数。 |
There was a problem hiding this comment.
现在不能正确渲染mermaid,例如2023-09-05-bog-gc-1。
后来想放截图,发现不知道放images文件夹哪。最后只好放渲染后的svg了。
|
Thanks! 期待以后的作品。 |
No description provided.