Hi,
I'm wondering how hard/easy it is to use a C++ library from Nimrod. I would like to use http://www.webtoolkit.eu but am not sure I want to dive in C++.
I've read the compiler can generate C++ code for easier interfacing: http://nimrod-code.org/index.html#nimrod-plays-nice-with-others
But I haven't found further details. Anyone having experience with C++ interfacing?
Thanks
Raph
The documentation section you mention is about the nimrod code being generated using either the C, C++ or ObjC backend. Which is mainly useful for making nimrod code available to these languages, so these languages could call nimrod code. What you are likely interested in would be the c2nim utility to create nimrod bindings from the library's headers. Despite its name, it can work with C++ too.
Usually c2nim requires you to slightly mangle the headers, which may be needed anyway if you only need access to a few APIs of the whole library. Once these bindings are generated you should be able to write nimrod code and call the C++ library. Depending on the complexity of the library this could be easy or daunting.
c2nim is mostly useless for C++ code. You likely need to use 'emit' + 'importcpp' like in this example:
http://nimrod-code.org/nimrodc.html#importcpp-pragma
Note that C++ code generation has been broken in 0.9.2 unfortunately, but should work again with the github version of the compiler.
Thanks for the info. It does not seem the way to go though, as the doc mentions "Horrible example..." and "this allows sloppy interfacing...".
I'll keep an eye on Nimrod anyway!
raph
c2nim is mostly useless for C++ code. You likely need to use 'emit' + 'importcpp' like in this example:
http://nimrod-code.org/nimrodc.html#importcpp-pragma
Araq : that page is not exist anymore. Do you know where it hosted now?