Lua 5.3 #27

Closed
opened 2019-02-28 21:55:33 +00:00 by noncom · 8 comments
noncom commented 2019-02-28 21:55:33 +00:00 (Migrated from github.com)

Would be great to let LuaJ support the 5.3 language specification. As I understand, this is the only reliable and living fork of LuaJ as of now and likely for the rest of the future, so that would make much sense.

I think that besides everything else, implementing 5.3 features is especialy beneficial for a tigher intergation with JVM since it introduces support for 32 bit floats, 64 bit ints, and utf-8 strings. All these aspects should help reduce much of the unnecessary casts when interfacing with Java.

At the same time the there seems to be no breaking or overly complex changes required (though I am not too proficient with interpreters and don't really know everything about how LuaJ works).

Sooner or later this should have come up :) LuaJ could not not have this listed in its issues.

Would be great to let LuaJ support the 5.3 language specification. As I understand, this is the only reliable and living fork of LuaJ as of now and likely for the rest of the future, so that would make much sense. I think that besides everything else, implementing 5.3 features is especialy beneficial for a tigher intergation with JVM since it introduces support for 32 bit floats, 64 bit ints, and utf-8 strings. All these aspects should help reduce much of the unnecessary casts when interfacing with Java. At the same time the there seems to be no breaking or overly complex changes required (though I am not too proficient with interpreters and don't really know everything about how LuaJ works). Sooner or later this should have come up :) LuaJ could not not have this listed in its issues.
Enyby commented 2019-03-01 04:14:12 +00:00 (Migrated from github.com)

Lua 5.2 binary not compatible with Lua 5.3. So you can not run any binary chunk from 5.2 on 5.3.

Lua 5.2 binary not compatible with Lua 5.3. So you can not run any binary chunk from 5.2 on 5.3.
noncom commented 2019-03-01 06:57:11 +00:00 (Migrated from github.com)

Backwards-compatibility can be a problem in some cases, but the Lua world does a great deal of effort to minimize this and almost any library works for both Lua versions, so source-wise there should be no problem. I don't think that anyone uses Lua binaries without having the source to recompile them from?

Could it be possible to retain support for 5.2? There are many classes that deal with the bytecode, that would have to be changed for 5.3. But I don't know the extent to which the bytecodes are different. How do you think, is it possible to blend in 5.3, or this would bloat the code and harm performance so that forking is the only solution?

Some time ago I was thinking about implementing this myself, but I could not find any definitive documents on 5.3 bytecode and how is it different from 5.2, and did not yet get to reverse-engineer both C versions.

Backwards-compatibility can be a problem in some cases, but the Lua world does a great deal of effort to minimize this and almost any library works for both Lua versions, so source-wise there should be no problem. I don't think that anyone uses Lua binaries without having the source to recompile them from? Could it be possible to retain support for 5.2? There are many classes that deal with the bytecode, that would have to be changed for 5.3. But I don't know the extent to which the bytecodes are different. How do you think, is it possible to blend in 5.3, or this would bloat the code and harm performance so that forking is the only solution? Some time ago I was thinking about implementing this myself, but I could not find any definitive documents on 5.3 bytecode and how is it different from 5.2, and did not yet get to reverse-engineer both C versions.
Enyby commented 2019-03-01 15:32:24 +00:00 (Migrated from github.com)

I do not know why lua 5.2 not compatible with lua 5.3 in bytecode. It is possible, but lua do not make it.
5.3 need a lot of work.

I do not know why lua 5.2 not compatible with lua 5.3 in bytecode. It is possible, but lua do not make it. 5.3 need a lot of work.
auge commented 2019-10-16 14:08:14 +00:00 (Migrated from github.com)

+1 for 5.3

one of the biggest differences between 5.2 and 5.3 is the removal of the bitwise operations library since 5.3 introduced integer (sub) data types.
what is missing from 5.3 is the native support of various native bitwise operators (i.e. shift left, right, ...) as this is not supported nor recognized in 5.2

Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio
> a = 4
> print(a << 1)
8
+1 for 5.3 one of the biggest differences between 5.2 and 5.3 is the removal of the bitwise operations library since 5.3 introduced integer (sub) data types. what is missing from 5.3 is the native support of various native bitwise operators (i.e. shift left, right, ...) as this is not supported nor recognized in 5.2 ```lua Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio > a = 4 > print(a << 1) 8 ```
nirenr commented 2019-10-17 12:49:38 +00:00 (Migrated from github.com)

https://github.com/nirenr/luaj Support for bit operations, support for long integers

https://github.com/nirenr/luaj Support for bit operations, support for long integers
vladp commented 2020-02-01 20:57:58 +00:00 (Migrated from github.com)

@nirenr do you think your fork could be merged into here?

@nirenr do you think your fork could be merged into here?
Enyby commented 2020-02-02 17:31:33 +00:00 (Migrated from github.com)

@vladp Of course not. This is not a fork, at all. And not Lua anymore.

@vladp Of course not. This is not a fork, at all. And not Lua anymore.
nirenr commented 2020-02-06 07:53:30 +00:00 (Migrated from github.com)

@vladp 是lua变种,完全兼容原版,增加了64位长整数,位操作和一些其他特性

@vladp 是lua变种,完全兼容原版,增加了64位长整数,位操作和一些其他特性
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#27