Orange Forum • View topic - Orange version without Python

Orange version without Python

Discussions about new ideas and features you would like to see in Orange.
(Archived/read-only, please use our ticketing system for your wishes and their discussion.)
Forum rules
(Archived/read-only, please use our ticketing system for your wishes and their discussion.)

Orange version without Python

Postby Guest » Mon Jun 20, 2005 16:35

I suppose there is no version of Orange sources in "pure" C++, meaning WITHOUT Python.
I suppose too you dont plan to provide such version.
So, what do you advice to people wanting to use Orange in real time (during the run time) or simpler who want to use Orange features in their C/C++ binaries ?
Regards and congratulations
AI searcher

Postby Guest » Wed Jun 29, 2005 12:55

It seems that Orange is not for run time C++ usage at all.
To resume Data Mining softs :
- SGI MLC++ is just sort of frontend ;
- Weka is only java ;
- Quinlam C4.5 is only old C code and copyrighted ;
- OC1 is only C.

Is anybody know of any simple library in pure C++ for data mining purpose (tree) ?

AI searcher

Postby Janez » Mon Jul 11, 2005 12:47

The C++ part of Orange is written in two layers, the core layer and the interface to Python. Core is independent of Python, except that it uses Python's garbage collector (it used to have its own, but this was not very practical; I wouldn't revive it).

Orange module is an ordinary shared library (although it's called orange.pyd on windows, it's really a normal dll), which exports the function initorange that is needed for Python, but it also exports practically all Orange's classes and functions, so it can be used from other dll's or applications written in C++.

So, you can (at least in principle - I haven't tried it yet) write a C++ application which uses orange as a dll. After it loads, it would look for (and load) Python.dll, which you'd thus need to distribute with your application. There would be minor technical problems, but nothing that couldn't be solved if I had a week to sacrifice (which I don't).

The other option is to embed Python in your C++ application, together with all the modules. You can, I believe, pack it all into a single file if you want to.

But there's a question of why would you like to do it? Python has been used in real-time applications, if that's your concern. You can also write your own module for Python in C++, which calls Orange directly, as a dll; I'm just about to prepare some documentation on that (we need it for other purposes as well). Turning your C++ code into Python modules is really trivial.

There's one more argument against doing it - using Orange from C++ is far from trivial. Doing it from Python is so much easier.

Return to Wish List