Ethosa / nodesnim

The Nim GUI/2D framework, based on OpenGL and SDL2.
https://ethosa.github.io/nodesnim/nodesnim.html
MIT License
133 stars 6 forks source link

Add scripting support #29

Open Ethosa opened 2 years ago

Ethosa commented 2 years ago

Maybe it will be a good feature to use Python as a scripting language for scenes. 🤔

quantimnot commented 2 years ago

What? Why not Nim? Are you yanking our (project lurkers) chain? Some other projects have used the VM for live scene and creative programming if that's your intention.

If you're looking at broader project adoption, then maybe just export the interface through something like https://github.com/treeform/genny?

Ethosa commented 2 years ago

@quantimnot, I came across it: nimscript

And it: image

Maybe this would be a good option?

quantimnot commented 2 years ago

nimscript is a module that just uses the Nim VM and implements stuff for actual file scripting and building convenience. I'm referring to using the VM directly in the same manner as this cool project by @dsrw: https://github.com/dsrw/enu/blob/main/src/engine/engine.nim. Here is a presentation he gave for NimConf 2021: https://youtu.be/ECJsq7BeZ8w

Ethosa commented 2 years ago

@quantimnot, I tried to do something similar, it seems to work...

https://github.com/Ethosa/nodesnim/commit/4bd60100a290d624e60c9a1824b17b11a573ff25#diff-fa731b6fc0fcf751f578c8847de7d08d29c674bc1dcf9bb70e2dbe173c61daee

quantimnot commented 2 years ago

Excellent!

There is another game library that I watch called paranim by @oakes. He created an opengl-rendered embedded Vim module that he uses for an editor: https://github.com/paranim/paravim Maybe you could use that.

You may want to checkout his clever rule engine too: https://github.com/paranim/pararules

Ethosa commented 2 years ago

The problem with the interaction of Nodesnim objects in scripts: Error: undeclared identifier: 'Vector2Obj'