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:
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.
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.
If in java then I'm not sure.
In any event I'd use a temp location (if not ram) for the temp save.
Fragmenter - animated loop machine and IKONOMIKON - the memory game