3 ms·
But which scripting language? C++ header are fairly hostile interfaces for wrapping. You end up with either tons of hand-written glue code or littering your h
by chubot 10y ago
But which scripting language? C++ header are fairly hostile interfaces for wrapping. You end up with either tons of hand-written glue code or littering your header files with annotations so they can be sorta wrapped.
Python is not very good as an embedded language (globals and locks). Lua is OK but AFAIK making C++-like classes in Lua is a pain, and the language is a bit annoying for other reasons.
- pjmlp 10y agoIf the API isn't template heavy, a typical solution on Windows is to access C++ via COM, and on Mac OS X via the Objective-C++ runtime. As of Windows 8,it is even easier given the new COM ABI model aka WinRT that all languages that wish to be used must support. You just need the ability to use WinRT projects on the language tools. On mainframes like IBM i, you can take advantage that all languages, including C and C++, compile to a common bytecode to make some wrapper libraries as well.
- _nalply 10y agoWhich reasons?
- chubot 10y agoIIRC, if you make a typo in a var name in Lua, you don't even get an exception like Python -- you just get nil. I'd prefer it to be more strict about errors like that. 1-based indexing. Prototypes rather than classes -- I don't think having to roll your own or research an object system for every project is a good use of time. Lua is a great language implementation, but whenever I try to actually program in it, it feels like an inferior version of Python...
- lmm 10y ago> Python is not very good as an embedded language (globals and locks). Rather than embedding Python in the C++, write the top-level loop in Python and call into the C++ from there.