Jump to content




Thoughts on Lua 5.3


24 replies to this topic

#21 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 02 April 2014 - 03:36 PM

View PostKingdaro, on 31 March 2014 - 01:07 AM, said:

View Postimmibis, on 31 March 2014 - 01:03 AM, said:

How are bitwise operators related to assignment operators, apart from both being operators?
Because the former is something a lot of people I'm sure have wanted as a feature in Lua, and last I checked, minimal syntax was one of Lua's philosophies. Why suddenly break it? What makes bitwise operators so special? Was the bit32 library not enough?
I don't understand that: you're saying one of lua's philosophies is a minimalized syntax, but isn't num >> bitstoshift much more minimalized than calling bit32.brshift(num, bitstoshift)?

#22 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 April 2014 - 09:45 PM

It is, but x += y / x -= y is also more minimalistic then x = x + y / x = x - y: and they're not adding that, apparently. It's a bit odd when you consider that bitshifts aren't a common operation by comparison.

#23 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 02 April 2014 - 10:29 PM

View Postardera, on 02 April 2014 - 03:36 PM, said:

I don't understand that: you're saying one of lua's philosophies is a minimalized syntax, but isn't num >> bitstoshift much more minimalized than calling bit32.brshift(num, bitstoshift)?
Minimalism is not equivalent to less typing. Minimalism is simply using one of lua's provided constructs, a function, instead of hardcoding a syntax into the language, a new construct. It's the same as splitting the table type into an array, a hashmap, and other data structures, which is stupid when a table does the job of all of these nicely.

#24 6677

  • Members
  • 197 posts
  • LocationCambridgeshire, England

Posted 03 April 2014 - 09:01 AM

want a minimal typing bitshift, multiply or divide by a power of 2. Terrible idea normally though, when implemented in hardware a multiply or divide operation takes alot longer than a shift operation, dunno how the lua VM or bit32 libraries would handle this.

#25 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 03 April 2014 - 04:47 PM

View Post6677, on 03 April 2014 - 09:01 AM, said:

want a minimal typing bitshift, multiply or divide by a power of 2. Terrible idea normally though, when implemented in hardware a multiply or divide operation takes alot longer than a shift operation, dunno how the lua VM or bit32 libraries would handle this.
i never use the bshift functions, math is faster 90% of the time
these new operators make bit operatrions faster and the integers make it even faster because there are no float conversions





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users