Comments by "gingerBill" (@GingerGames) on "Developer Voices"
channel.
-
399
-
Thank you for watching the video. With regards to the "automagic C interop", this sounds cool until you realize this is actually pretty much NEVER what you want. In all of the cases you look at what Zig does, the libraries just wrap the automagically imported C calls, which is effectively the same amount of work as just writing the bindings manually, defeating the entire purpose of the automagical stuff. There is also the other issue that people use the C-preprocess as if it was the same language as C. They define constants and many wrapper functions and more, with the preprocessor, which will be missed by the "automagical" stuff.
We are currently working on making an official automatic bindings generator, and because of Odin's amazing `foreign` system stuff, things can have little to no wrappers whatsoever, and still be extremely useful. Odin has tried its best to make binding with foreign code very pleasurable, whilst not requiring wrappers. See things like the attributes `link_prefix` or even `b32` types (for booleans which are not 1-byte) or `u32le` types (endian specific types) or multi-pointers `[^]T`. With a bindings generator, you'll have a lot more control about how you can interface with foreign (e.g. C) code.
13
-
13
-
12
-
12
-
12
-
12
-
7
-
6
-
6
-
6
-
5
-
5
-
5
-
5
-
4
-
4
-
4
-
3
-
3
-
2
-
2
-
2
-
2
-
2
-
1
-
1
-
1
-
1
-
1
-
1