How to pimp boost-python wrapped library without recompiling it? - boost-python

There is a boost-python wrapped library (written in C++). For performance reasons I would like to write some C++ code to invoke some functions from the C++ library directly.
One way to go would be to create a fork of this library and add the functions I have in mind directly to the C++ code.
Is there a way to achieve the same result without recompiling this library?

Related

Can I create VS Code extensions in Python/C++?

I am totally new to creating extensions in VS Code, and all the official examples of extensions are written in Typescript/Javascript, which I have no experience with. Is it possible to create VS Code extensions in other languages, such as Python or C++?
If so, could anyone point me to any resources to get me started?
It is possible by creating a C++ module for Node.js, which can then be loaded like any other node module. Of course, some glue code written in JS or TS is necessary to register the extension and translate calls to/from vscode.
I've gone this way in my ANTLR4 extension, but gave up eventually, because of the troubles I had due to incompatible dependencies (you have to make sure the extension uses the exact same V8 version, which was used to build the underlying Node.js used by vscode, on all supported platforms).
This situation might have change, I don't know, but with that in the background I don't recommend it.
If you want to add support for a new language in vscode you can also write a separate language server, as is mentioned in the linked SO answer. For other type of work, I'm afraid, you have no alternative to use.
No, as #rioV8 said, since VSCode is an electron app and runs on Javascript.

Use c++ Code in Unity3D

I am using unity3D for the first time to develop a game.I have written a code in c++ using Opencv and the code consist on many files.Now I want to apply the result computed by c++ code to a 3D character.
How i can use my c++ code in unity.Please help me.Remember I am using OpenCV Libraries in my c++ Code.
Thanks!!
You need to write a DLL file and use it within Unity. There is many examples on how to do so.
http://docs.unity3d.com/Manual/Plugins.html
If you have some money you can also purchase the Unity source code that is written in c++ though that seems a bit overkill.
did some googlefu...
C++ is not a scripting language, and can only be used with Unity in the form of plug-ins (in the Pro version). C# is closer in syntax to C++ than Javascript is.
http://answers.unity3d.com/questions/12809/can-i-use-c-as-a-scripting-lanques-for-unity.html
(couldn't find anything that contradicted that)
although these might be of interest:
https://gamedev.stackexchange.com/questions/82518/is-it-possible-to-use-c-with-unity-instead-of-c
http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/

Can protobuf-csharp-port work on webplayer?

We can't call any dll on webplayer, but protobuf-csharp-port uses dll extensions, so seems that it doesn't work on webplayer. Anyone who can solve this problem?
In fact, you can use dlls in the webplayer as long as they contain pure managed c# code. You can't use native dlls written in c++ for example.
These dlls shouldn't use any kind of reflection as it is an excluded sub-assembly in unity webplayer.
I don't know if protobuf-csharp-port matches these constraints but if you are looking for a nice protocol buffer implementation, you can have a look at protobuf-net which is a very nice one, written in pure c#. There is a specific unity-compatible build in the distribution. You can even compile your protobuf serializers in a custom dll so no reflection is used to be webplayer compliant.

Compiled Perl GUI Application

I'm searching for options to make a GUI based application.
Application needs to intact with http servers, database and GUI.
so best option that I know is to have perl.
I'm searching for a way to Compile the code to ensure the security
also easy development of GUI.
I have started the same with Perl/TK but writing each and every lines of GUI is taking lot of time also its really hard to debug.
Is there any option to that the GUI building can be like QT or .NEt so that the GUI controls can be easily dragged and drop.
If I'm using PerlQT, is drag and drop possible?
Is it possible to compile the code in PerlQT?
Whether this will work in both linux and windows?
Is there any other option like PerlGTK or something else?
If you think “compiling” a Perl script will solve any problems, you are likely to face a disappointment.
Usually, the perl interpreter is just bundled with the plain source code and any used modules into one gargantuan executable. The script isn't really compiled. This makes nothing easier. Also, compilation has nothing to do with security, and can provide a bit of obscurity at best.
Otherwise, you could tread the crazy route and use something that serializes the Perl opcodes into C code, and compile that. Do note that while perl compiles the source into opcodes, it already executes parts of it, so that running the opcode serialization is not the same as running the actual program.
On *nix systems, compiling a Perl script is silly, as the interpreter is readily available.
If you want to fuse Perl and foreign code into one program (!= one executable), take a look at the XS language (binds C to Perl), or at the Inline family of modules.
(Perl-)Qt is pretty awesome, but the last time I looked at the recent bindings, that stuff looked undermaintained and experimental. I am sure that you could leverage the QtDesigner somehow for the designing part, and hook up Perl code with that. This should be pretty portable if you have a compiler on every target system. har har.
Other GUI Toolkits you should seriously consider are GTK and Wx. .Net is right out.
Please realize that Perl is a very dynamic language. While compilation isn't likely to be useful, you can use functional programming techniques like anonymous subroutines and metaprogramming techniques like compile time code generation to simplify your GUI coding. If you write Perl like you would write Java, or other fairly static (& compiled) languages, I wouldn't be suprised if Perl seems painful.

References on how to embed python classes/functions in C++ using BoostPython

May I know, if I can refer to some good website references/links that show how I can embed/wrap python classes and functions(methods) in C++(not the other way around). I found how to wrap from C++ to python(like here), but what I'm interested in, is the other way around.
You can call C++ from Python. The tutorial you pointed out contains an introduction to that. Look for the section "Functions - Overloading". It shows how you can create bindings to allow your C++ call pythonic functions. The approach can also be applied to classes.