|
Post by Bit on Apr 25, 2017 21:21:22 GMT
<LOG> THE BYTECODE WARNING: THIS CHALLENGE HAS BEEN CONSIDERATED TOO HARD FOR PRACTICALLY EVERYONE ASKED; ONLY TRY IT IF YOU REALLY WANT TO SUFFER OR HAVE SOME BRAGGING RIGHTS.Make a Lua bytecode interpreter... in Lua 5.1. If you'd like, in RBX.Lua. No loadstring(Bytecode) replies! EDIT: To clarify, you must make a function capable of loading any (working, properly written) Lua 5.1 bytecode passed to it as an argument. </LOG>
|
|
|
Post by Bit on Apr 26, 2017 22:18:07 GMT
Anybody? Please? No? Seriously?
|
|
|
Post by cntkillme on Apr 27, 2017 22:24:20 GMT
I'm already half way done. Wrote a chunk decoder (that is, from bytecode -> Lua header and top-level prototype which contain all the user-defined prototypes) so all I have to do is just write a few hundred lines of code and keep a state (the program counter, a stack, blah blah) and since we're writing the interpreter in Lua 5.1, it's a one-to-one correspondence to implement everything so it'll be even easier than doing it in any other language.
Although why waste the time since NecroBumpist already made one anyways?
|
|
|
Post by Bit on Apr 27, 2017 22:25:33 GMT
cntkillme NecroBumpist's isn't too bad, but hey, it's a challenge. Not really any purpose as I am already using one.
|
|