# this is test.cpp file #include #include #include extern "C" int count(std::string String) { return std::count(String.begin(), String.end(), 'a'); } # this is test.raku use NativeCall; sub count(Str $str is encoded('utf8')) returns int32 is native('libtest') { * }; say count("pastepaste")