wiremod / wirebox

Wire for S&Box. Early WIP.
MIT License
37 stars 8 forks source link

Suggestion: Implement Expression2-like language via Wren #3

Open BlindfoldedHuman opened 3 years ago

BlindfoldedHuman commented 3 years ago

Wren is a very minimalistic and performant scripting language, which uses classes instead of all that abstract table mud. It would be a perfect fit for creating more advanced code for contraptions in S&box. You could maybe even branch off your own language, which improves upon Wren's functionality, making it more specific to your needs. And then have it be transpiled to Wren, and understood by parser written in C#, so that it can set the chip up.

Or, well, do whatever you want to. I'm just suggesting.

Divran commented 3 years ago

Personally I'd prefer to use sandboxed C# (so it'd be like the rest of the game), or Lua (because Lua is great). But that's just personal preference.

In any case, which is used would depend on how well it can be sandboxed. Gmod has the problem where you can't really sandbox anything properly. If an ingame scripting language is added, we would want to be able to limit the amount of ram and cpu time each script is allowed to use, no matter what they do.

thegrb93 commented 3 years ago

Wren looks nice. Similar to lua in a lot of ways.

The Lua version is being developed here https://github.com/thegrb93/StarfallSBox . Sandboxed C# won't be possible.

Divran commented 3 years ago

wait why won't sandboxing be possible

thegrb93 commented 3 years ago

There's no way to compile the C# right? You can only use the .NET functions allowed in the access-list.