Results 1 to 7 of 7

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

  1. #1
    Join Date
    Jan 2007
    Posts
    16,731

    Default 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...

    http://www.phoronix.com/scan.php?pag...eased-Features

  2. #2
    Join Date
    Sep 2008
    Location
    Vilnius, Lithuania
    Posts
    2,837

    Default

    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...

  3. #3
    Join Date
    Sep 2012
    Posts
    111

    Default

    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...)

  4. #4
    Join Date
    Jan 2014
    Posts
    324

    Default

    Quote 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.

  5. #5
    Join Date
    Sep 2011
    Posts
    146

    Default

    Quote 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.

  6. #6
    Join Date
    Jan 2014
    Posts
    324

    Default

    Quote 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.

  7. #7

    Default

    Quote 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.
    http://luajit.org/ext_ffi.html

    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.
    http://bitop.luajit.org/

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •