Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig for C Programmers (proposal for new chapter) #46

Open
recombinant opened this issue Sep 26, 2020 · 0 comments
Open

Zig for C Programmers (proposal for new chapter) #46

recombinant opened this issue Sep 26, 2020 · 0 comments
Labels

Comments

@recombinant
Copy link

Thanks for writing the site. Excellent.

As an experienced C developer and a Zig newbie I have struggled with the paucity of Zig documention. Members of Discord#zig-help have kindly provided me with answers to questions that search engines couldn't find (Zig is too new).

A chapter on Zig for C Developers would have been helpful. Anecdotes/Cookbook. I can write some content. Currently this would be suggestions on how to implement C preprocessor commands in Zig and using zig translate-c

  • Zig compiler works best on Tier 1
  • check which Tier you are on
  • zig translate-c is your friend
  • what zig translate-c misses and how to
    • #error
    • #ifdef #else #endif usingnamespace if struct{} else struct{}
  • std library and support for Tier 2 Tier 3
  • Zig comptime and why not to worry about apparently extraneous code
  • zig build-obj and
  • extern and why it is not needed
  • code guards and why you don't need them
    • circular references and why they are not a problem (unless you use simlinks)
  • zig's lack of number on error messages (communicating and searching for errors is harder)
  • zig import of file outside package path what's wrong with #include "../../../include/includeme.h" ?
  • #include usingnamespace @import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants