You might want to look at some of the Inline family of modules. E.g. Inline::C, Inline::Java, etc.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] |
There is currently no Inline::D, but it doesn't mean you can't make one based on the other inline modules :).
| [reply] |
It looks like a rather intimidating task to build an Inline::D module but it would definitely interest me to try it. I've not looked into the guts of the other Inline:: modules but the Inline's documentation says this:
For C (and C++), Inline uses the DynaLoader::bootstrap method to pull your external module into Perl space. Now you can call all of your external functions like Perl subroutines.
Other languages like Python and Java, provide their own loaders.
I must admit I have little clue about loaders like this. I gather from this that I would need a loader for D, which I have no idea whether exists or how to fetch one. :-)
| [reply] [d/l] [select] |
| [reply] |
And how would you call a D function from a C program?
| [reply] |
There is some information on this on the Digital Mars website. I've never used D myself, so I don't know how well it works :)
| [reply] |
| [reply] |