Announcement

Collapse
No announcement yet.

Lua 5.3 Brings Support For Integers & UTF-8 Support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lua 5.3 Brings Support For Integers & UTF-8 Support

    Phoronix: Lua 5.3 Brings Support For Integers & UTF-8 Support

    Lua 5.3 was released today with a variety of new features for this lightweight scripting language...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Oh dear. LuaD currently supports only Lua 5.1. On the flip side, maybe newer version support will now be given priority...

    Also, kind of odd how the big changes are all low-level features. Wasn't Lua intentionally made to be a high-level language...

    Comment


    • #3
      64 bit integers! Wow! We can now make OS-interfaces that really get far without overhead using userdata.
      Consider for instance the inode number. There is no better way than store it as 8 bytes. But having native support for that.
      Or simple things like IPv6....
      The real world regards IPv6 as 64 bits of network address and 64 bits of host address on that network.
      So working with IPv6 involves comparing 64 bits.
      Bitwise operators are handy for setting and getting bits on foreign structures.

      So to be clear: lua is a very good high level language, and now has upped the interfacing to the outside world.
      You still do not care if your ipv6 is complete userdata or whatever it's implementation, but the interfacing side is now "acceptable": you don't have to fall back to userdata that often.

      As for the language itself: a float 2 now prints as 2.0. On assignment a number is an integer unless it is a float (. or E+).
      Kinda like perl that also did not have integers (and probably still doesn't).

      All in all a very nice update. I need it now! (Due to the 64 bit...)

      Comment


      • #4
        Originally posted by GreatEmerald View Post
        Oh dear. LuaD currently supports only Lua 5.1. On the flip side, maybe newer version support will now be given priority...

        Also, kind of odd how the big changes are all low-level features. Wasn't Lua intentionally made to be a high-level language...
        Isn't D a toy language? I don't understand the need for a C++ clone. It seems C++ 11, 14 and 17 pretty much cover all the "innovations" the D author collects from C++.moderated newsgroups ? I find it extremely funny that he goes there advertising D, yet the major features in D are just from C++ drafts and slightly cleaned up syntax which C++ can't do due to compatibility concerns.

        Comment


        • #5
          Originally posted by caligula View Post
          Isn't D a toy language? I don't understand the need for a C++ clone. It seems C++ 11, 14 and 17 pretty much cover all the "innovations" the D author collects from C++.moderated newsgroups ? I find it extremely funny that he goes there advertising D, yet the major features in D are just from C++ drafts and slightly cleaned up syntax which C++ can't do due to compatibility concerns.
          Do some read on D and then come back.
          Just have a look at the syntax, especially templates are way more readable (less noise). Freaking awesome are compile time string operations (builtin), pair it with mixins Garbage collector (you can turn it off if you want). Also function safety adds quite some trust on code. And there is way more that makes D interesting.

          Comment


          • #6
            Originally posted by schmalzler View Post
            Do some read on D and then come back.
            Just have a look at the syntax, especially templates are way more readable (less noise). Freaking awesome are compile time string operations (builtin), pair it with mixins Garbage collector (you can turn it off if you want). Also function safety adds quite some trust on code. And there is way more that makes D interesting.
            Go read about Haskell and Rust and maybe reconsider. I have been following c++.moderated newsgroup and it's quite obvious that D's author, Walter Bright, often copies ideas presented there. The long time C++ veterans try to come up with improved versions of C++ in co-operation, but the committee work has some bureaucracy so it takes time. D authors don't have this problem. They can change syntax without worrying about industrial users. Consider trigraphs. IBM has always been against removing them. It's the same with all fancy 1980s syntax. But syntax is quite irrelevant anyways. The D garbage collector isn't as good as e.g. Sun Java 8 GC. D's design by contract is runtime, not compile time. Compare that with dependent types.

            Comment


            • #7
              Originally posted by Ardje View Post
              64 bit integers! Wow! We can now make OS-interfaces that really get far without overhead using userdata.
              Consider for instance the inode number. There is no better way than store it as 8 bytes. But having native support for that.
              Or simple things like IPv6....
              The real world regards IPv6 as 64 bits of network address and 64 bits of host address on that network.
              So working with IPv6 involves comparing 64 bits.
              Bitwise operators are handy for setting and getting bits on foreign structures.

              So to be clear: lua is a very good high level language, and now has upped the interfacing to the outside world.
              You still do not care if your ipv6 is complete userdata or whatever it's implementation, but the interfacing side is now "acceptable": you don't have to fall back to userdata that often.

              As for the language itself: a float 2 now prints as 2.0. On assignment a number is an integer unless it is a float (. or E+).
              Kinda like perl that also did not have integers (and probably still doesn't).

              All in all a very nice update. I need it now! (Due to the 64 bit...)
              You should try LuaJIT, it is a drop-in replacement for Lua 5.1 and it has a lot of great features and exceptionally good speed for a dynamic language implementation thanks to the JIT compiler.

              LuaJIT's FFI is amazing, the calls to C get inlined by the JIT compiler making C calls very fast.


              Code:
              local ffi = require("ffi")
              local n = ffi.new("int64_t") -- create 64 bit integer
              LuaJIT also has a bit library that gets optimized by the JIT as well. Calls to bit functions will get optimized out by the JIT compiler and make bitwise operations very fast.


              IMO Lua with LuaJIT is one of the best, if not best, dynamic language implementations currently available.

              Comment

              Working...
              X