KSP-KOS/KOS — pull request #236 by Dunbaratu (2014-09-13 00:23:00+00:00)
Title: Store compiled file

THIS IS NOT READY TO PULL YET. I intend to push more changes to the branch first.

I just needed a place to discuss things about it that wasn't attached to one commit or another, so I started the pull request to have a location to mention things and allow comments.

TODO List:

* Documentation in the md file is a bit behind because of a few last changes I had to do to get things working. Go back and fix it.
* As of right now there's no way in kOS to specify filename extensions. ALL files for commands like RUN, COPY, DELETE, and so on require your filename to be a kOS Identifier, and don't let you put periods in the name, and assume all files end in *.txt. This may need changing to allow people to do things like have "myprogram.txt" and "myprogram.kxe" for compiled versions of it. At the moment I've been testing by compiling myprogram to myprogram_o and then doing RUN MYPROGRAM_O.
* As of right now you explicitly say which file you are running, and it runs the text version if you give it a text filename or the exe version if you give it a KEXE file. It examines the contents of the file to figure out if it's a kEXE file and if so then it loads it that way. I'd rather have a system where you say "run myprogram" and without an extension it will try a kEXE first and then try a TXT after that if there's no kEXE - so you don't have to re-write scripts to use compiled versions of programs.
* The compiling is currently still very slow and clunky. I suspect this is because it is copying buffers all over the place and appending them togther, having to do a LOT of memcpy and brk operations behind the scenes. I'd like to go back and change it to use one common byte writer buffer and not constantly have to recopy byte[] arrays all over the place. (at the moment it's so bad that it freezes animation for about 7 seconds to compile a 10k source file). The execution, on the other hand, is very fast.