سؤال

I would like to make some quantlib functionalities to be available from web applications, and I have started developing PHP extensions to do it. Obviously the idea is not to make all quantlib api available from PHP but yes to develop some modules with concrete functionalities.

As I have never used SWIG I'd like to know wich are main advantages/disadvantages to do it through SWIG.

Thanks!

هل كانت مفيدة؟

المحلول

The main advantage is that a boatload of functionality is already exposed through SWIG to other languages, so you can just run SWIG on the existing interfaces in PHP mode and you're likely to get something working right away (you might have to patch them in places, but I don't expect big problems). Note that the number of classes exposed can be a disadvantage, too: the resulting wrappers will probably be massive, so you might want to edit the interfaces and comment out what you don't need.

Another disadvantage is that, since SWIG is language-agnostic, the resulting wrappers might not be idiomatic PHP. I'm not familiar with the language, though, so I can't comment on that.

Either way, drop us a line on the mailing list if you want to make the extension available. If you go through SWIG, we can add your patches (if any) to the upstream distribution. If you develop a QuantLib PHP extension in any other way, we can at least link to it from the QuantLib site.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top