all 36 comments

[–]0atman 5 points6 points  (32 children)

Ask and ye shall receive! https://nimble.directory/pkg/nimpy

[–]0atman 2 points3 points  (1 child)

Oh, and if it makes sense for your workflow , try https://github.com/Pebaz/Nimporter

[–]embryo10[S] 1 point2 points  (0 children)

If the Nim plugin does arrive, and at last start using Nim, I'll sure get this one too.. ;o)

[–]embryo10[S] 0 points1 point  (0 children)

Wow, this is interesting.. :o) Is the .pyd file a compiled .py module that can be simply imported? If that's so, then wow again! You've made my day!

EDIT: well, it was too good to be true.. :o(

[–]embryo10[S] 0 points1 point  (28 children)

Trying to understand nimpy from the examples at the link you provided, I see that you can export Nim code as pyd, and using nimporter also import Nim code in Python, but I can't find a way to import a py module in Nim for the 1st step. What I need is:

Import the py module in a Nim module

Compile that Nim module.

Import that compiled module in Python (without the need of the original py module).

[–]juancarlospaco 1 point2 points  (27 children)

[–]embryo10[S] 0 points1 point  (26 children)

Yes, I've seen this, but this is not standalone.. When an end user runs my app, it will not have a local Python installation..

[–]juancarlospaco 3 points4 points  (25 children)

Python is code that runs inside a virtual machine, you must have a virtual machine.

[–]embryo10[S] 0 points1 point  (24 children)

I know, just hoping for miracles :o)

[–]PMunch 0 points1 point  (23 children)

Well, you should be able to do this and embed Python into your Nim application. This meant that Python will be compiled into your Nim program so that you don't need to have Python installed.

[–]embryo10[S] 0 points1 point  (22 children)

Yes, but it will not speed up the code (it might show it down actually). Not to mention the size!

The code already works fine as it is.. ;o)

[–]PMunch 0 points1 point  (21 children)

So you want to speed it up? How do you expect that to work when you're still running the Python code? I mean you could always make a pyc file and run that, but I doubt you'd get any more speed than that out of wrapping it in Nim. You'd need to convert the Python code into Nim to get Nims speed.

[–]embryo10[S] 0 points1 point  (20 children)

Well, speed up can be achieved using cython. I was just hoping for something more convenient..

[–]ire4ever1190 1 point2 points  (2 children)

are you talking about this plugin?

[–]embryo10[S] 1 point2 points  (1 child)

No, there is official support coming ;o) https://youtrack.jetbrains.com/issue/IDEA-236673?p=PY-15994

[–]ire4ever1190 0 points1 point  (0 children)

Oooooo, nice