4 ms·
> - Nim: C/C++ interop is second to none. This is very wrong. There is perfect c interop - you can import c functions using {.importc.} pragma. C++ interop i
by jsjsjsjsjsjs 7y ago
> - Nim: C/C++ interop is second to none.
This is very wrong.
There is perfect c interop - you can import c functions using {.importc.} pragma.
C++ interop is best i have seen so far. You can use c++ template types! Here is the sample: https://github.com/3dicc/Urhonimo/blob/master/modules/container/hashmap.nim https://github.com/3dicc/Urhonimo/blob/master/modules/contai... Of course it is not perfect. For example if you would like to override c++ method you will have to write a bit of c++ code using {.emit.} pragma. I do not know a single language that could map c++ template types into it's own generic types like nim can.
- Leszek 7y ago"second to none" means "best" ("there is no one it is second to, thus it is first")
- jsjsjsjsjsjs 7y agoTIL. Not native english-speaker. My bad.
- totalperspectiv 7y agoYou made my point better though! Nim interop is awesome.
- detaro 7y ago"second to none" means "the best".
- deleted 7y ago[deleted]
- mhh__ 7y agoD's C++ interop looks better at a glance. With a simple extern(C++) you can use templates, classes and vtable's are matched up to single inheritance. There is also some experimental work on catching C++ exceptions but I've never tried to use it.