On 3 April 2012 11:48, Moritz Lenz <mor...@faui2k3.org> wrote: > But this "works": > > @a := [1, 2, 3, 4] > > Note that this will store a ResizablePMCArray in @a, so if you want to know > what kind of methods you can call on it, you have to consult parrot's > documentation of the ResizablePMCArray. You also get the stringification > behavior of a ResizablePMCArray etc. > > If that's not what you want, use Rakudo.
Ok. In practice, I'll use Rakudo. It sounds like NQP just isn't worth the effort. You lose too much of what makes Perl 6 fun to use. >> Parrot has a robust system for interfacing with external native code >> libraries, such as those commonly written in C, C++, Fortran and other >> compiled languages. > > *cough* > Parrot has some limited out-of-the-box support for calling C functions, and > if you have libffi installed (which doesn't work out of the box on Windows), > you get decent support for calling C functions. > > I haven't seen a robust way to call C++ and Fortran functions yet, :-( Oh well. Thanks for clarifying that for me. > mainly > because both use non-standard name mangling schemes at the bytecode level (I > believe that newer Fortran versions have such a standard, but the scientific > computing world seems to be stuck with F77). I don't know anything about bytecode or name mangling, but I do agree with the evils of F77. I personally refuse to learn F77, but I know that most scientific libraries haven't been ported to modern Fortran. Fortran 2003 introduced interoperability with C, so you can call Fortran functions from C and vice versa, but I think it'll be a long time before this is widely used in libraries. > NQP (and thus Rakudo) has its own mechanism for calling C libraries. In > Rakudo, this is available through NativeCall.pm in > https://github.com/jnthn/zavolaj/ > > (Note that currently NativeCall doesn't work together with precompiled > modules; should still work in the latest Rakudo Star release though). Thanks. I'll have a look. Cheers, Daniel. -- I'm not overweight, I'm undertall.