CyclopsMC / IntegratedDynamics

A Minecraft mod to take full and automated control of your appliances.
http://cyclopsmc.github.io/IntegratedDynamics/
MIT License
132 stars 62 forks source link

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

Open Hiranus opened 3 years ago

Hiranus commented 3 years ago

Issue type:


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.

rubensworks commented 3 years ago

Thanks for the suggestion!

rubensworks commented 3 years ago

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.

Hiranus commented 3 years ago

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?

rubensworks commented 3 years ago

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.

Hiranus commented 3 years ago

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

rubensworks commented 3 years ago

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

LihrhaWolfe commented 3 years ago

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

Hiranus commented 3 years ago

I would say that lua is fairly straightforward.

JoshuaVandaele commented 3 years ago

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

george-steel commented 2 years ago

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.

bangplaysgames commented 2 years ago

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

walksanatora commented 1 year ago

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!