PixelToast 5 Posted March 31, 2014 Share Posted March 31, 2014 Lua 5.3 is still in the "what the hell do we add" stage but you can find the source here: http://www.lua.org/work/or windows binaries made with MinGW: https://dl.dropboxus.../lua53work2.zipIt is almost identical to 5.2 but has some major things we have all wanted like integers, bitwise operators, and utf8 supportthe list is small but here are the changes from 5.2: http://www.lua.org/work/doc/#changesMain changes: support for integers (64-bit by default) better support for small architectures ("Small Lua" with 32-bit numbers) bitwise operators basic utf-8 library utf-8 escapes in literal strings functions for packing/unpacking numbers userdata can have any Lua value as uservalue strip option in lua_dump/string.dump Lua standalone interpreter: Can be used as calculator; no need to prefix with '=' i can probably compile this for OC, give me a bit. Quote Link to post Share on other sites
Symmetryc 0 Posted March 31, 2014 Share Posted March 31, 2014 [22:46] <ping> http://oc.cil.li/index.php?/topic/35-thoughts-on-lua-53/ no replies yet? You now have a reply. Be happy. Quote Link to post Share on other sites
Wobbo 8 Posted March 31, 2014 Share Posted March 31, 2014 I don't know. I don't dislike it, let me start with that, but I hope they won't break compatibility again. And apart from the bitwise operators, it doesn't really add that much. Unless I misunderstand the pack/unpack functions for numbers. What I would like to see are macros, those would be nice. And a __type metafield. Quote Link to post Share on other sites
Sangar 92 Posted March 31, 2014 Share Posted March 31, 2014 i can probably compile this for OC, give me a bit.If you're really serious about this, I'd recommend looking into making an addon mod for OC that provides a Lua 5.3 computer. You'd need: The compiled Lua 5.3 library, of course. Glue code to access it from Java (pretty sure JNLua won't work). Register an Architecture with OC. In your TileEntity/Environment create a machine using that architecture. Simple case: provide the machine node as the TileEntity's node (this is what the built-in computer cases do). Call the machine's update() from the TileEntity's updateEntity(). And quite possibly provide a customized ROM. Which seems like a lot of work for a work-in-progress version of the same language, that doesn't provide *that* many new features, yet. But I wanted to raise awareness of this functionality being in the OC API, hoping that somebody will be crazy enough to mess with it at some point Quote Link to post Share on other sites
PixelToast 5 Posted April 1, 2014 Author Share Posted April 1, 2014 Here is how the integer system works: numbers are ints if they dont have a decimal point, otherwise they are floats this isnt compatability breaking though, the math operators automatically convert them there is also the new // operator which does division on ints, basically math.floor(a/b) the reason for this is that we can now divide huge numbers, ones that are too big for floats also, all numbers are 64 bit, even when compiled 32 bit here are all the new bitwise operators: band: a & b bor: a | b bxor: a ~ b bnot ~ a -- not sure how this one works blshift: a << b -- same as a*(2^ brshift a >> b -- same as a//(2^ i hope they add a+=b, a++, etc Quote Link to post Share on other sites
PixelToast 5 Posted April 1, 2014 Author Share Posted April 1, 2014 work3 was just released and guess what they added?thats right i am loving the new syntax, it takes so much less time converting code from other languages Quote Link to post Share on other sites
Techokami 2 Posted April 4, 2014 Share Posted April 4, 2014 0 + 1 - 1 - 1 + 1 = ...1? Either a+=1 is not doing what I think it should be doing (add 1 to a) or the new syntax has some math issues. Quote Link to post Share on other sites
PixelToast 5 Posted April 4, 2014 Author Share Posted April 4, 2014 0 + 1 - 1 - 1 + 1 = ...1? Either a+=1 is not doing what I think it should be doing (add 1 to a) or the new syntax has some math issues. was april fools, work3 hasnt come out yet Quote Link to post Share on other sites
Techokami 2 Posted April 4, 2014 Share Posted April 4, 2014 Well that showed me, hiding post times unless you hover over them :| Quote Link to post Share on other sites
ghostrider2539 1 Posted August 20, 2014 Share Posted August 20, 2014 I Think that lua is hard to understand and maybe they can make a simpler program if you ask me Quote Link to post Share on other sites