WattleScript / wattlescript

WattleScript C# scripting engine.
https://wattlescript.github.io
Other
58 stars 3 forks source link

In Lua mode, missing fields in package compared to PUC Lua #66

Open alysbrooks opened 1 year ago

alysbrooks commented 1 year ago

WattleScript's Lua mode is missing some fields in package that "standard" Lua (PUC Lua) has. In particular, the lack of package.preload, package.path, and package.searchers prevents Fennel from working.

I'm not sure whether this is partly a case of missing functionality or if the functionality is essentially all there and just needs to be exposed via package. I'm hoping it is all there because I don't see anything on the list of differences that would suggest this is a piece of functionality that's missing. I would like to submit a PR to address this, but am not sure I could add substantial functionality to the Lua mode's package functionality.

You can also read the original issue filed against MoonSharp.

CallumDev commented 1 year ago

This is something covered in an old PDF: https://www.moonsharp.org/MoonSharpStdLib.pdf .

Essentially, the package library is replaced by providing .NET-side script loader implementations in both MoonSharp and WattleScript. However, it may be worth investigating if the standard script loader provided by WattleScript can make use of some of these package fields in an emulation mode.

Happy to review a PR on it