A problem solved in 22 programming languages

In this post I am demonstrating the solutions of a programming problem in 22 different languages: Raku, Python, C++, Perl, Ruby, Scala, C#, Dart, Julia, D, Lisp, C, JavaScript (Node.js), Java, Rust, Pascal, Go, Lua, Fortran, PHP, Kotlin, and Bash.

In this post I am demonstrating the solutions of a programming problem in 22 different languages: Raku, Python, C++, Perl, Ruby, Scala, C#, Dart, Julia, D, Lisp, C, JavaScript (Node.js), Java, Rust, Pascal, Go, Lua, Fortran, PHP, Kotlin, and Bash.

🦋 108. Basic usage of NativeCall in Perl 6

NativeCall is both a module and a technology in Perl 6 that allows you to call C functions from your Perl 6 code. Today, let’s meet the most basic usage. Take the rand() function from the C standard library: #include <stdio.h> #include <stdlib.h> int main() { int r = rand(); printf(“%i\n”, r); return 0; } … Continue reading “🦋 108. Basic usage of NativeCall in Perl 6”