#1
Posted 28 February 2015 - 12:34 AM
Anyways, can't distrib that jar because of the source rules. I'd love some input from dan200 on this.
#2
Posted 28 February 2015 - 12:37 AM
EDIT: I probably should have posted something more constructive than two words haha
This is also in the wrong place!
Edited by ashnwill, 28 February 2015 - 12:41 AM.
#3
Posted 28 February 2015 - 01:13 AM
I guess I'll move this to Suggestions, but your question doesn't fit particularly well anywhere.
#4
Posted 28 February 2015 - 01:26 AM
Lyqyd, on 28 February 2015 - 01:13 AM, said:
I guess I'll move this to Suggestions, but your question doesn't fit particularly well anywhere.
I really didn't, sure a bit of messing with dans code but not much..
#5
Posted 28 February 2015 - 01:29 AM
#6
Posted 28 February 2015 - 09:09 AM
Quote
And the first LuaJ 3.0 release was in late 2012. You can't blame Dan200 for not using LuaJ 3.0!
I haven't looked at the source of LuaJ 3.0, but looking at Lua 5.2's incompatibilities I'm surprised there aren't more issues. The key ones are that getfenv/setfenv have been removed which would disrupt pretty so much code. It would be possible to write a 'compatability' layer - table.unpack and unpack are the same, etc...
There are some benefits to LuaJ 3.0 - you can run more than one computer at once, and obviously the string bug is fixed. However the 5.1/2 issue would have to be addressed. If we are going to go all this effort though, it might be fun to update to Lua 5.3 (I know a version for LuaJ doesn't exist this is just wishful thinking), those bitwise operators look good.
Edited by SquidDev, 28 February 2015 - 09:14 AM.
#7
Posted 28 February 2015 - 12:40 PM
#9
Posted 28 February 2015 - 01:10 PM
And it's not just the general usage of sandboxing. The problem extends beyond keeping programs out of _G by default. LuaLua, for example, depends heavily on being able to set function environments. Otherwise it wouldn't be possible for instance methods and properties to work the way they do. There are countless applications to function environments and losing them makes it very difficult for me to accept leaving 5.1 behind.
#10
Posted 28 February 2015 - 02:52 PM
I understand that running two sets of lua inside of java could be an issue.
Another possibility is to make a backwards compatibility patch, and emulate the old system with the new one. But that may be not that much better than using both.
#11
Posted 28 February 2015 - 03:41 PM
It would be possible to implement an alternative to get/setfenv on the Java side.
Personally I would like to see an entire re-write of LuaJ optimised to use LuaJC, the current version works pretty much perfectly though just feels slightly too hacky. However unless CC goes open source I don't think this is likely to happen, Dan has more important things on his plate.
#12
Posted 28 February 2015 - 04:11 PM
If CC goes open source and with lua being open source, we could make a version of lua optimised for computercraft.
#13
Posted 28 February 2015 - 05:18 PM
ElvishJerricco, on 28 February 2015 - 01:10 PM, said:
And it's not just the general usage of sandboxing. The problem extends beyond keeping programs out of _G by default. LuaLua, for example, depends heavily on being able to set function environments. Otherwise it wouldn't be possible for instance methods and properties to work the way they do. There are countless applications to function environments and losing them makes it very difficult for me to accept leaving 5.1 behind.
What makes this worse is that the bios itself uses setfenv. However, if LuaJ 3.0 still provides the function on the Java side, it shouldn't be too hard to add it back in.
#14
Posted 28 February 2015 - 10:48 PM
wieselkatze, on 28 February 2015 - 12:56 PM, said:
I'd be happy to see an update happening
Er, no, it'd be quite the opposite.
Instead of having one system tying down all of ComputerCraft, malicious users would be able to build multiple systems and have them tie down the whole MineCraft server.
#15
Posted 01 March 2015 - 04:37 AM
Lignum, on 28 February 2015 - 05:18 PM, said:
Unfortunately, I believe that environments are so fundamentally different int 5.2 that the concept of setfenv simply isn't possible.
#16
Posted 01 March 2015 - 05:05 PM
Bomb Bloke, on 28 February 2015 - 10:48 PM, said:
wieselkatze, on 28 February 2015 - 12:56 PM, said:
I'd be happy to see an update happening
Er, no, it'd be quite the opposite.
Instead of having one system tying down all of ComputerCraft, malicious users would be able to build multiple systems and have them tie down the whole MineCraft server.
As there is a timer on the Java side to terminate those programs if they take too long that shouldn't be the problem.
The thing is - if a computer is taking too long it wouldn't have to affect other computers, because they would be executing normally. Then the other computer would get killed.
Also I don't see 3 or 4 computers tying down the whole server as 1 computer doesn't produce any load on my CPU ( not yielding, but computing ) - server CPUs do have a lot more performance.
#17
Posted 01 March 2015 - 06:40 PM
wieselkatze, on 01 March 2015 - 05:05 PM, said:
The thing is - if a computer is taking too long it wouldn't have to affect other computers, because they would be executing normally. Then the other computer would get killed.
Also I don't see 3 or 4 computers tying down the whole server as 1 computer doesn't produce any load on my CPU ( not yielding, but computing ) - server CPUs do have a lot more performance.
And what about people who like to make an underground base full of computers (from 20 to 60) which are all running some piece of software all the time? Seriously, I've seen these things on every CC server I've been on. Imagine a server handling 100+ instances of LuaVM. Oh, and it would either have to create one for every new computer placed or whenever you'd opened up a computer. Though, there was a solution to this proposed somewhere on the subforum: have a few threads (LuaVMs) which would be running, lets say, 30 computers each.
I think with Lua 5.2 and it's environments they've made a big mistake. Function environments, how they worked previously (Lua 5.1), IMO were a lot better and more flexible. Now, what they did was adding "magic" to Lua. I'm talking about the _ENV table, it uses a local variable "magic". I'm not a fan of those "magical" powers a language may have. It seems like that kind of thing was already possible (kind of) with the debug library. Well, at least it is still possible to recreate [set|get]fenv with the debug library in Lua 5.2+. But if CC would update to Lua 5.2/5.3 then I think adding backwards compatibility would actually be nice, keeping in mind that we cannot use the debug library.
#18
Posted 02 March 2015 - 12:46 AM
#19
Posted 02 March 2015 - 12:48 AM
#20
Posted 02 March 2015 - 05:44 AM
https://github.com/O...terCraft/opencc
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











