beef331 / website

Code for the official Nim programming language website
https://nim-lang.org
18 stars 1 forks source link

Nimjl #16

Closed Clonkk closed 3 years ago

Clonkk commented 3 years ago

Name: Nimjl

Author: Regis Caillaud (@Clonkk)

Posting:

Nimjl is a bridge to call Julia code from Nim. It is to Julia what Nimpy is to Python.

Useful to leverage Julia's powerful ecosystem in Numerical computing. Practical for integrating Julia code in Nim application without rewriting everything.

And for those who prefers code to word here's a small example of sorting a Nim sequence using Julia's sort function !

import nimjl
import random
import sequtils
import sugar

jlVmInit() 
var seqRand: seq[int64] = newSeqWith(12, rand(100)).map(x => x.int64)
echo seqRand
discard jlCall("sort!", seqRand)
echo seqRand
jlVmExit() 

Did that pique your curiosity ? You can check-it out here or read more examples !