3 ms·
That's one of the things that draws me to Nim in general: it works as advertised, and the documentation, while sometimes terse, is clear and complete.
by JasonFruit 12y ago
That's one of the things that draws me to Nim in general: it works as advertised, and the documentation, while sometimes terse, is clear and complete.
- k__ 12y agoI found it a bit frustrating. They talk about C interopt, but I didn't find any nice explanation about how to create something like a struct, that C APIs often require as their data input.
- def- 12y agoUsually you don't create a struct yourself, but use c2nim to wrap it, like I did here: http://hookrace.net/blog/what-makes-nim-practical/#wrapping-libraries-with-c2nim http://hookrace.net/blog/what-makes-nim-practical/#wrapping-... When you look at the resulting Nim wrapper, here's what a C struct got turned into: https://github.com/def-/nim-bpg/blob/master/src/bpg.nim#L61-L65 https://github.com/def-/nim-bpg/blob/master/src/bpg.nim#L61-...