This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
snoble2022's profile picture

Lua to Bytecode?

Started by snoble2022, 30 December 2012 - 02:01 PM
snoble2022 #1
Posted 30 December 2012 - 03:01 PM
how do I compile cc Lua to bytecode? and please don't tell me it's not a good idea
Kingdaro #2
Posted 30 December 2012 - 03:09 PM
I think luac comes with the default windows binaries, you can use that.

If you're not on windows, it probably comes with whatever binaries are for your OS.
snoble2022 #3
Posted 30 December 2012 - 04:22 PM
i mean with something inside of computercraft. I'm making a program compiler
Lyqyd #4
Posted 30 December 2012 - 04:30 PM
loadstring, string.dump.
snoble2022 #5
Posted 30 December 2012 - 04:51 PM
How do I run those files. I tried dofile and loadfile but they just return an error; parrallel:20:java heap space
Lyqyd #6
Posted 30 December 2012 - 05:57 PM
I have no idea what's causing problems with it for you. You just loadstring() whatever code you want to "compile" and then string.dump the resulting function. Then, you loadstring the dumped string again to have an executable function.
snoble2022 #7
Posted 31 December 2012 - 08:59 AM
So for my null-basic language i'm going to have to have an interpreter?