Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
luac.exe - Compiler parse times — Gideros Forum

luac.exe - Compiler parse times

tpropertproper Member
edited January 2019 in General questions
I'm working on an IDE. One feature is showing syntax mistakes. To do this I'm using the lua compiler in parse mode to quickly go through the file and return errors.

I downloaded a lua compiler from lua.org and it's super fast, but it errors on some things in Gideros's API like this line:

self.torso_head_joint:setLimits(^<-10, ^<10)

The "^" are errors. So instead, I found a lua compiler in Gideros's install directory. I used it and it parses correctly but it's really slow compared to the lua compiler on lua.org. Maybe because Gideros lua has more stuff to look at.

Anyway, I was wondering if anyone had any ideas on increasing the speed of the Gideros compiler. I think if I took all the .lua files inside the project folder and made them one file then used compiler in parse mode it may be quicker but my returned error line numbers will be a little annoying to figure out.

Another idea is to parse files individually as the user saves them and when running the project (where it re-compiles everything) only parse the files that haven't already been parsed. That seems like the best idea so far.

Any ideas?

Comments

  • SinisterSoftSinisterSoft Maintainer
    edited January 2019
    Parse them on a different thread - if the user stops typing for a few seconds. That way if they keep typing you just ignore the results from the 2nd thread, else display them.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Good idea! The threads worked although I have one thing.

    The lua compiler takes a file to compile. Are you suggesting auto-saving every few seconds (after key presses stop) then parsing the file? I'd most likely just write a current_file.lua each time and parse it so the user can save whenever they want. My question is:

    Will writing a file as the user types slow down the IDE? I'm writing the program in Java. What will happen when my lua file becomes really long and I am overwriting it every 3.5 seconds (that's the time I picked)? I'm not sure how fast writing a file is in Java.
  • SinisterSoftSinisterSoft Maintainer
    Accepted Answer
    Copy the text to ram and pipe the data through - I think you can still do that kind of thing in Windows.

    If in java then I'm not sure.

    In any event I'd use a temp location (if not ram) for the temp save.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Alright. I'll look into it. Thanks!
  • keszeghkeszegh Member
    edited January 2019
    saving to a file this often when there are gb's of memory on every pc nowadays seems stupid except if you wanna kill the ssd of the user.
Sign In or Register to comment.