PF2E Playlist
Page 1 of 2 12 Last
  1. #1

    Will FGU ever be updated to use Lua 5.4?

    Will FGU ever be updated to use Lua 5.4? Lua 5.1 was last updated in 2012.

  2. #2
    My suspicion would be probably not, or at least not any time soon.

    Every game system, extension, module, and everything else that has lua scripts in it would probably need to be completely rewritten for 5.4. That is a lot of work.

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    23,928
    Blog Entries
    1
    Moon Wizard did a small test to see the impact and it was considerable.
    At this time there are many items that provide more value on their to do list.
    So... maybe... but dont hold your breath.

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  4. #4
    There was a huge change between Lua 5.1 and 5.2 that breaks the entire way that function environments are defined in Lua. A couple years ago, I tried migrating the engine to Lua 5.3, but the function environment changes blocked that move. Because each object and script is expected to have its own environment in FG (as well as handler registrations), the function environments are required for the FG API to work. Changing that assumption breaks every ruleset and extension ever written. I tried the suggested workarounds I found in various forums and coding sites, but none of them were able to replicate that behavior.

    I may re-assess at some point; but there are not really any pressing must-have enhancements I have seen in the Lua 5.2/5.3/5.4 change notes.

    Regards,
    JPG

  5. #5
    I would mainly wonder about performance improvements?

    From https://lwn.net/Articles/826134/:

    Version 5.4 also brings a new generational garbage collection (GC) mode, which performs better for certain kinds of programs where objects usually have a short lifetime.
    One of the unsung features in 5.4, is a significantly faster interpreter, though the release notes have overlooked it. In a test I did on my 64-bit macOS machine using Gabriel de Quadros Ligneul's Lua Benchmarks suite, I found that version 5.4 was an average of 40% faster than version 5.3 across 11 benchmarks included in the suite:


    From https://eklausmeier.wordpress.com/20...-5-3-5-4-vs-c/

    Code:
        C (no optimization flags): 0.53s
        C: 0.2s
        Lua 5.1: 6.15s
        Lua 5.2: 7.2s
        Lua 5.3: 5.83s
        Lua 5.4: 3.92s
        LuaJIT: 0.58s
        Pallene: 0.32s
        Pallene with compiler optimization flags: 0.31s
    Those who need much higher performance can use Mike Pall's LuaJIT, a just-in-time compiler for Lua 5.1 that is significantly faster than the stock Lua interpreter. However, LuaJIT hasn't added any of Lua's new features since version 5.1 (which was released in 2006).
    At first I assumed that FG would use a JIT compiler and was rather surprised that it uses interpreted language only. So maybe have a look at this: https://luajit.org/
    Last edited by Weissrolf; March 30th, 2021 at 09:44.

  6. #6
    LuaJIT also claims to speed up the interpreted parts:

    For LuaJIT 2.0, the whole VM has been rewritten from the ground up and relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler.
    On the following site you can compare both the LuaJIT JIT compiler and interpreter with the standard Lua 5.1.5 interpreter:

    https://luajit.org/performance_x86.html

    For example: MD5 of LuaJIT compiler is 112 (!) times faster than Lua 5.1.5 and LuaJIT interpreter's MD5 is still 5 (!) times faster than Lua 5.1.5
    Last edited by Weissrolf; March 30th, 2021 at 09:56.

  7. #7
    Last, but not least, LuaJIT uses a MIT license, which seems very permissive on a quick glance.

  8. #8
    Quote Originally Posted by Weissrolf View Post
    Last, but not least, LuaJIT uses a MIT license, which seems very permissive on a quick glance.
    I feel this subject was answered quite succinctly by Moon Wizard a few posts up.

  9. #9
    I think Weissrolf's concern (and mine too tbh) is the missing out of the potential performance gains that an update would benefit from. As it currently stands, FGU's biggest weakness is its poor performance, even before comparing to other VTTs. When you do start comparing it - especially to the newer ones using the newer technologies - FGU is going to end up in a worse and worse place.

    Edit: and my comments on poor performance is regarding the state of things before all of the lighting updates.

    Edit2: One more thing I would like to highlight - I can't see myself ever changing VTT. I love FG, warts and all!
    Last edited by Surge; April 7th, 2021 at 23:05.

  10. #10
    LuaJIT seems to be Lua version 5.1 on steroids. If that's not worthwhile to look at then nothing ever will.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in