2008Q3 Grant Proposal: Libperl++

Category: Grants

Comments (10)


I see this as a valuable project for two reasons: (1) C++ programmers who want to dabble with a bit of Perl to see how it works can do so without really leaving the C++; and (2) programmers who are already experienced in Perl can use it to make their life easier when doing some C++ projects. I'm fairly certain the second reason is better than the first, and farther reaching, but I know that it would help me persuade at least one of my C++ friends to consider Perl.


I have opposite experience - perl has fine embedding API, especially when you're talking about C or C++ (it is written in C, unsurprisingly).

Also there were accepted patches on P5P for building Perl with C++

I, personally, have experience of some 8-10 years ago embedding Perl into C++ application - in my case this was GUI application written in Borland CBuilder - perl was Active-state-built, myself-built (with Borland or MSVC) - all was smooth - and I even have not used SWIG!

I am sure I was not alone in embedding Perl into C++.

Writing yet another library is a waste of effort, IMO.



Well, if you think it is easy I'd like to challenge you to write the small program in my example using the perl API. It is not as simple as you say and it's definitely not as easy as it should be IMO.


you didn't convince me.

I will not take your challenge to embed Perl into your C++ program, although I did quite a lot of miscellaneous embeddings (for example see my CPAN module, but I did much more for my particular tasks)


my experience of Perl embedding for C++ was easy, your embedding was hard

I guess you're trying to solve a task from the wrong end.

Also I could believe that you want to create come C++ classes to solve your particular task, but I fail to see why it is useful for the community - the API is already easy to use, see "perldoc perlembed", "perldoc perlguts", etc.



I really wish I had this right now. I am trying to embed an interpreter in a large commercial monte-carlo C++ simulation system. I would like to use Perl, but it became clear from experimentation that to use it in any remotely encapsulated way (not litter the whole project namespace with perl stuff) I would have to write my own abstraction layer, like this grant proposal.


I would like to add that Python and TCL have Boost.Python and C++/Tcl respectively.

Perl should follow suite and get good C++ bindings.


I would like to support Leon. I did a small embedding project (Perl inside STAF) and I found the experience... challenging. Really had to understand a lot of internal details, memorize a whole pack of functions, and wad through a sea of API.

A normal C++ interface is welcome.

Shmuel.


Seems a sensible enough goal.


Joining in, I say c++ interface would be really help alot; I support this proposal.


Please help me with Libperl++ using. I have a problem. This simple code has errors on linking stage:

#include
#include "perl-glue.hh"

int main(){
wPerl p;
p.eval("$hash = {'a' => 1,'b' => 2, 'c' => 3};foreach $key(keys %$hash){print $hash{$key};}");
return 1;
}

Errors:
Linking...
1>perl+c.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall wPerl::~wPerl(void)" (??1wPerl@@UAE@XZ) referenced in function _main
1>perl+c.obj : error LNK2019: unresolved external symbol "public: __thiscall wPerlScalar::~wPerlScalar(void)" (??1wPerlScalar@@QAE@XZ) referenced in function _main
1>perl+c.obj : error LNK2019: unresolved external symbol "public: class wPerlScalar __thiscall wPerl::eval(char const *)" (?eval@wPerl@@QAE?AVwPerlScalar@@PBD@Z) referenced in function _main
1>perl+c.obj : error LNK2019: unresolved external symbol "public: __thiscall wPerl::wPerl(void)" (??0wPerl@@QAE@XZ) referenced in function _main
1>C:\Users\123\Documents\Visual Studio 2008\Projects\perl+c\Debug\perl+c.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Users\123\Documents\Visual Studio 2008\Projects\perl+c\perl+c\Debug\BuildLog.htm"
1>perl+c - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Please answer me on my email if it is possible to solve this errors.


Sign in to add comment