IntegratedDynamics icon indicating copy to clipboard operation
IntegratedDynamics copied to clipboard

Integrated LUA - addon that solves patreon goal "Integrated Scripting"

Open Hiranus opened this issue 3 years ago • 12 comments

Issue type:

  • :heavy_plus_sign: Feature request

Short description:

Scripting in Integrated Dynamics can be achieved by language really easy for general audience - LUA imagine computercraft like UI with slot for empty variable card. LUA that you write will be saved on this variable card, but there are some requirements: -function eval() - this function will be launched when variable will be "evaluated". Any parameters that you might write for this function will have to be piped/applied to this "lua variable card". -eval() returns only one thing (it will have to be ID type "Any"), and if nil is returned we have error.

This will allow people to write really complex code easily, and shouldn't be too crazy to implement, as you don't have to create your own language.

Example: function eval(a,b) return {a,b} end Will turn out to be Lua variable card that takes 2 inputs and creates list from them.

Hiranus avatar Sep 19 '21 10:09 Hiranus

Thanks for the suggestion!

rubensworks avatar Sep 19 '21 10:09 rubensworks

Lua is probably not going to happen. There are much better, and more widely known languages that would be much better suited. But we'll see that when we get there.

rubensworks avatar Sep 19 '21 14:09 rubensworks

Lua is probably not going to happen. There are much better, and more widely known languages that would be much better suited. But we'll see that when we get there.

@rubensworks Can you tell what languages are you talking about?

Hiranus avatar Sep 20 '21 10:09 Hiranus

Currently considering JavaScript, as it is very flexible and the most widely known language. Might also open up some interesting venues when combined with TypeScript typings for ID.

rubensworks avatar Sep 20 '21 10:09 rubensworks

Those 2 are also good choices. I was afraid you would say haskell.

Hiranus avatar Sep 20 '21 10:09 Hiranus

No, don't worry, I think Haskell is even more obscure than Lua 😛

rubensworks avatar Sep 20 '21 10:09 rubensworks

Don’t know if this will add anything to this other than a stupid joke, but if this becomes a conversation about obscure languages, go look at FORTH. XD

patc4 avatar Sep 24 '21 14:09 patc4

I would say that lua is fairly straightforward.

Hiranus avatar Sep 24 '21 17:09 Hiranus

Lua is known to be good for performance as an embeddable language and pretty easy to implement

JoshuaVandaele avatar Oct 16 '21 20:10 JoshuaVandaele

Might I suggest going with elm since it's fairly lightweight and is very similar to the core ID language. After all, ID is basically first-order FRP.

george-steel avatar Nov 23 '21 01:11 george-steel

I personally like c# for scripting, but I don't know how well it would perform embedded into Java.

bangplaysgames avatar Nov 06 '22 17:11 bangplaysgames

this just in: Integrated Scripting in the works for those who aren't on the discord/patreon

Based on the voting that was concluded yesterday, the Integrated Scripting mod came out as the unanimous winner! Thanks to everyone who participated in the vote.

This means that I'll start working on this new add-on to Integrated Dynamics. The mod will allow operators to be created using a scripting language, which will simplify the handling of complex logic, but also enable sharing of operators across different game instances. My current plan is to use JavaScript as the scripting language, given that it is well-known, simple, and well-supported in the JVM. I'm also considering a plugin architecture to make it possible to inject other scripting languages as well.

I have no clear timeline yet, as I still have to design the mod to determine its precise functionalities and architecture. However, my goal is to share regular updates on the progress here on Patreon and Twitter. So make sure to watch this space!

walksanatora avatar Aug 11 '23 18:08 walksanatora