generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why does roblox generate so much bytecode?

Previous Thread :: Next Thread 
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
19 Nov 2011 08:26 AM
Roblox: 97 characters
Lua 5.1: 67 characters
Lua 5.2: 71 characters
Lua JIT: 30 characters

Using code: print(#string.dump(function() end))
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
19 Nov 2011 08:30 AM
New code: print(#string.dump(function() print(0) end))

Roblox: 53 character increase
Lua JIT: 21 character increase
Lua 5.2: 44 character increase
Lua 5.1: 44 character increase
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
19 Nov 2011 08:31 AM
Maybe because Roblox can be stupid at times?
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
19 Nov 2011 08:33 AM
Try this:

 print(#string.dump(function() print(math.huge) end))


It increased even more.
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
19 Nov 2011 08:35 AM
Myrco, that's because you're indexing the `math` table with the string `huge` to get the result.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Nov 2011 09:26 AM
I noticed that too. I hate how it generates so much bytecode, probably for no reason.

Tell me.. if you compiled your code using LuaJIT, would it still run without problems on normal Lua and on ROBLOX? I suppose it would run without problems on normal Lua, but what about ROBLOX? If you use things that don't exist in normal Lua (like the variable 'game' or creating instances with Instance.new) in the code and then compile it with LuaJIT, will it still work in ROBLOX?
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
19 Nov 2011 09:34 AM
@Julien

I've tried before with normal lua, and it didn't work. :/
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Nov 2011 09:43 AM
Yet, I remember obfuscating some of my scripts with luac in the past and using them on ROBLOX and it worked.
However, I also remember doing the exact same thing and it didn't work.

I never was really sure whether it works or not, so right now, I just obfuscate them on ROBLOX.

But if there was a way to obfuscate it with normal Lua or with LuaJIT, I would do so.
Report Abuse
Payphone21 is not online. Payphone21
Joined: 27 Jun 2011
Total Posts: 963
19 Nov 2011 10:32 AM
Try These Codes For Scripting



edit/1/local
edit/2/local
ban/user/59742/exit
1/local/disaster-scripts/6281



Report Abuse
Varp is not online. Varp
Joined: 18 Nov 2009
Total Posts: 5333
19 Nov 2011 10:46 AM
string.dump saves the function's source too. It's possible to remove the source and still have it work.
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
19 Nov 2011 10:54 AM
@Payphone: That's just sad.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Nov 2011 11:04 AM
"string.dump saves the function's source too. It's possible to remove the source and still have it work."

We all know that. But ROBLOX still generates more bytecode. Even when we set the chunk's name to "".
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
19 Nov 2011 11:59 AM
Because Roblox likes wasting data.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
19 Nov 2011 12:32 PM
"We all know that. But ROBLOX still generates more bytecode. Even when we set the chunk's name to ""."

No it doesn't. Crack open ChunkSpy or my Lua bytecode tools and use it on the Roblox generated chunk. The added source of the script entirely accounts for the different size of the Roblox chunks.
Report Abuse
NecroBumpist is not online. NecroBumpist
Joined: 12 Sep 2010
Total Posts: 4198
19 Nov 2011 02:03 PM
LuaJIT uses a different bytecode format, and thereby doesn't really belong in this discussion.

The problem with ROBLOX is that it adds ALL of the source code to the Name field of the main chunk if I remember right.

I would recommend using a function I made a while back for this, however, I appear to have lost it, and I'll remake it later. Anyway, if you're going to dump files either use `luac` or a standard Lua implementation.
Report Abuse
grandtheftauto00 is not online. grandtheftauto00
Joined: 20 Sep 2009
Total Posts: 18
19 Nov 2011 02:13 PM
ya roblox wastes alot of data and i mean alot i mean it is about 7GB each day now that is a whole lot
Report Abuse
aboy5643a is not online. aboy5643a
Joined: 20 Nov 2010
Total Posts: 2785
19 Nov 2011 02:14 PM
ya thats a lot, a lot, a whole lot, a lot, its a lot, a whole lot. That's a lot. Like 7GB, a lot. A lot.




A lot.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Nov 2011 02:29 PM
"The problem with ROBLOX is that it adds ALL of the source code to the Name field of the main chunk if I remember right.

I would recommend using a function I made a while back for this, however, I appear to have lost it, and I'll remake it later. Anyway, if you're going to dump files either use `luac` or a standard Lua implementation."

Actually, Lua does the same. It also adds all the source code to the name of the chunk.

However, you just need to set the chunk's name to "".

Here's how I do it:

local bytecode = string.dump(loadstring(source, "")) -- Compiles the source to bytecode.
bytecode = bytecode:gsub('.', function(char) return '\\' .. char:byte() end) -- Replaces every character by its binary representation.
print("loadstring(\"" .. bytecode .. "\")()") -- Prints an executable version of the source.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
19 Nov 2011 02:35 PM
"ya roblox wastes alot of data and i mean alot i mean it is about 7GB each day now that is a whole lot"

[citation needed]
Report Abuse
LPGhatguy is online. LPGhatguy
Forum Moderator
Joined: 27 Jun 2008
Total Posts: 4725
19 Nov 2011 02:36 PM
@blocco
xkcd 978
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
19 Nov 2011 02:39 PM
Oh, Citogenesis, how I love thee.
Report Abuse
MarshaLikezPie is not online. MarshaLikezPie
Joined: 15 Apr 2011
Total Posts: 4054
19 Nov 2011 10:52 PM
@Blocco 7GB might not seem liek much but try doing that daily for probally the 10+ more years ROBLOX will be on, maybe the GB's might even increese daily. for 10yrs thats like 25k GB's
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
19 Nov 2011 10:56 PM
Marsha... The data gets DELETED...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image