Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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.



Usually 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-...

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-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: