<div dir="ltr"><div>Thank you for your detailed notes, Jan. Here are some comments.</div><ul><li>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.</li><li>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.</li><li>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.</li></ul><div>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.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 18, 2023 at 5:30 AM Jan Angermüller <<a href="mailto:jan@angermueller.com">jan@angermueller.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
Robert,<br>
<br>
I have just tested the Lua 5.4/0.67b version with Perfect Layout in
Finale 27.3/<b>Windows</b> 10.<br>
BTW, since the last update v3.0127 Perfect Layout is also compatible
with v0.66.<br>
<br>
Result: it works, except luaosutils.<br>
<br>
In detail:<br>
First I had to make <b>ZeroBrane studio</b> work as it seems to not
support 5.4.x by default:<br>
-Download the Win64 lua5.4.<b>2</b> (!) binaries.<b> I haven't found
binaries for 5.4.4.</b><br>
The LuaBinaries project only goes up to 5.4.<b>2</b> (
<a href="https://sourceforge.net/projects/luabinaries/files/" target="_blank">https://sourceforge.net/projects/luabinaries/files/</a> )<br>
Then:<br>
-Put lua54.dll/lua54.exe files into \ZeroBraneStudio\bin<br>
-Add clibs54 folder similar to clibs53 folder to
\ZeroBraneStudio\bin (just copy&paste and then rename to 54)<br>
-Go to ZeroBraneStudio\interpreters and copy&paste luadeb53.lua
and make it to luadeb54.lua. <br>
-Open luadeb54.lua and change 5.3 to 5.4<br>
-(Re-)Start ZeroBrane Studio and select Lua 5.4 in Project->Lua
Interpreter.<br>
<br>
I had <b>five error messages</b> that didn't occcur in previous
versions of RGP Lua/Lua 5.2 of which four could easily be fixed.<br>
1.) there was a problem with a duplicate label name which Lua 5.2
has ignored (very weird)<br>
2.) the "number of local variables exceeded" error occured (I wonder
why it didn't occur in previous versions). <br>
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.<br>
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")<br>
<br>
These were all actually problems in Perfect Layout that Lua5.2 has
ignored and which haven't lead to any problems yet.<br>
So I am glad I could improve my code here.<br>
<br>
However, I wasn't able to fix:<br>
<b>osutils=require("luaosutils") </b> --> this immediately
lead to an error message although finaleplugin.LoadLuaOSUtils=true
was in plugindef<br>
The result info box says: "Error:" No message.<br>
BTW, this pops up although it says
finaleplugin.IgnoreReturnValue=true in the plugindef(). <br>
And I called the uncompiled plug-in code directly - no extra require
file was used as in the compiled version.<br>
<img src="cid:186f494ff772e2079f51" alt=""><br>
<br>
So I removed that line completely and used the original JW Lua
implementation without luaosutils and it, yay!, finally worked.<br>
<br>
Could it be that the Windows version of your embedded luaosutils has
a problem? Haven't tested on macOS.<br>
Or do I need to change something in the setup?<br>
<br>
And finally:<br>
I have only tested my standard Perfect Layout demo score and another
(simple) orchestra score.<br>
When the osutils issue is solved, I will run it in my standard tests
where it automatically compares the output with v0.66.<br>
I haven't tested the 5.4 compiled version of Perfect Layout either.<br>
<br>
But so far, yes, it seems to work. <br>
Great job!<br>
<br>
Jan<br>
</div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>