[JW Lua] v0.67/Lua 5.4 report from Perfect Layout (the Windows/Luaosutils seems to be a problem)

Robert Patterson robert at robertgpatterson.com
Sat Mar 18 14:04:35 CET 2023


Thank you for your detailed notes, Jan. Here are some comments.

   - There's something more going on with your luaosutils than meets the
   eye. I have been using them both embedded and non-embedded in the Lua 5.4
   version. Every time I launch Finale on my system, a script executes that
   uses the embedded version. Is it possible you requested the embedded
   version in the wrong `plugindef` function? Or that you misspelled
   "LoadLuaOSUtils"? It must be in the top-level script: the one that is
   executed by the menu item. The symptoms you describe sound like it's trying
   to load the external version compiled for 5.2.
   - That's weird about ZeroBraneStudio. I've been using it interchangeably
   between 5.2 and 5.4 without issues. Maybe mine was a newer installation.
   Anyway, the third version numbers (5.4.x) are bug fix releases and should
   not lead to any incompatibilities.
   - Should I investigate the `tonumber` issue? It is listed among the
   backwards compatibility issues on the Lua site. There might be a compiler
   setting for it as well.

Once we get this working, I'll be interested to see if it provides any
improvement or degradation in performance. The big new thing in 5.4 is
improved garbage collection. The `<close>` attribute allows for closing
things like file handles automatically, which might be useful as well. (I
don't think `<close>` is supported on PDK Framework variables.) The
`<const>` attribute prevents reassignment of a local variable after
initialization, which might offer optimization as well.



On Sat, Mar 18, 2023 at 5:30 AM Jan Angermüller <jan at angermueller.com>
wrote:

> Robert,
>
> I have just tested the Lua 5.4/0.67b version with Perfect Layout in Finale
> 27.3/*Windows* 10.
> BTW, since the last update v3.0127 Perfect Layout is also compatible with
> v0.66.
>
> Result: it works, except luaosutils.
>
> In detail:
> First I had to make *ZeroBrane studio* work as it seems to not support
> 5.4.x by default:
> -Download the Win64 lua5.4.*2* (!) binaries.* I haven't found binaries
> for 5.4.4.*
> The LuaBinaries project only goes up to 5.4.*2* (
> https://sourceforge.net/projects/luabinaries/files/ )
> Then:
> -Put lua54.dll/lua54.exe files into \ZeroBraneStudio\bin
> -Add clibs54 folder similar to clibs53 folder to
> \ZeroBraneStudio\bin     (just copy&paste and then rename to 54)
> -Go to ZeroBraneStudio\interpreters and copy&paste luadeb53.lua  and make
> it to luadeb54.lua.
> -Open luadeb54.lua and change 5.3 to 5.4
> -(Re-)Start ZeroBrane Studio and select Lua 5.4 in Project->Lua
> Interpreter.
>
> I had *five error messages* that didn't occcur in previous versions of
> RGP Lua/Lua 5.2 of which four could easily be fixed.
> 1.) there was a problem with a duplicate label name which Lua 5.2 has
> ignored (very weird)
> 2.) the "number of local variables exceeded" error occured (I wonder why
> it didn't occur in previous versions).
> 3.) tonumber(x,10) accepts both number OR string values for x in Lua5.2,
> in Lua5.4 only string values are accepted, otherwise error.
> 4.) the condition local x=0; local n=15; print((n % x)==0)    printed
> "false" in Lua5.2, but gave an error in Lua 5.4   ("Error: attempt to
> perform n%0")
>
> These were all actually problems in Perfect Layout that Lua5.2 has ignored
> and which haven't lead to any problems yet.
> So I am glad I could improve my code here.
>
> However, I wasn't able to fix:
> *osutils=require("luaosutils")   *  --> this immediately lead to an error
> message although finaleplugin.LoadLuaOSUtils=true was in plugindef
> The result info box says: "Error:" No message.
> BTW, this pops up although it says
> finaleplugin.IgnoreReturnValue=true     in the plugindef().
> And I called the uncompiled plug-in code directly - no extra require file
> was used as in the compiled version.
>
>
> So I removed that line completely and used the original JW Lua
> implementation without luaosutils and it, yay!, finally worked.
>
> Could it be that the Windows version of your embedded luaosutils has a
> problem? Haven't tested on macOS.
> Or do I need to change something in the setup?
>
> And finally:
> I have only tested my standard Perfect Layout demo score and another
> (simple) orchestra score.
> When the osutils issue is solved, I will run it in my standard tests where
> it automatically compares the output with v0.66.
> I haven't tested the 5.4 compiled version of Perfect Layout either.
>
> But so far, yes, it seems to work.
> Great job!
>
> Jan
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20230318/59bf5a68/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gD9BTUGf70VvEVL6.png
Type: image/png
Size: 5152 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20230318/59bf5a68/attachment.png>


More information about the JWLua mailing list