Coder Social home page Coder Social logo

bakagaijin's People

Contributors

luca-spopo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

godotmisogi

bakagaijin's Issues

debug functions and namespace

Currently, bakaGaijin exposes its debug functions as global variables such as showBaka and bakaGC.
This is polluting the global namespace.
Instead, I propose all debug functions being in a table accessed using bakaGaijin(1337)

For example, bakaGaijin(1337).showBaka

This will not cause any problems, as resources must have string names, and that's all the bakaGaijin function is being used for currently.

There may also be other restrictions on resource names, such as the string not containing ":" or "$". We can use this to allow serverside scripts to call client side objects etc via bakaGaijin("c:resource2") or something similar (If such a functionality is implemented).

garbage collector doesn't tackle cycles

The meta garbage collector network thing was thought not to be able to have cycles, but it can.
Consider this sequence of events:

note: bg = bakaGaijin
A:
	bg.var = {}
B:
	bg.var = {}
A:
	bg(B).var.key = bg.var
	bg.var.key = bg(B).var
	bg.var = nil
B:
	bg.var = nil

Full scripts to reproduce the problem are attached. Delete the 4 lines in myfile.lua marked with "--cycle" if you want to see behavior of the same code when a reference cycle is not formed.

In any case, this demonstrates that reference counting will not be enough, and we need a deeper algorithm to check for cycles in the graph.
myfile.txt
myfile2.txt

getBaka should use loads instead of iterating over ownLookup

Currently, the getBaka function calculates the number of objects locked for a resource by iterating over the ownLookup table.

The function was made before load counting was done by the loads table.

Now that we have a table called loads that counts the number of objects locked for each resource, we should just return that value instead of calculating the loads by iterating.

setmetatable and getmetatable don't work as intended on active tokens

Setting a metatable for an active token will only ruin the active token, not set the metatable for the original object as the caller probably intended.
Getting a metatable for an active token will get the metatable generated by bakaGaijin, not a representation of the original's metatable in the host resource.

setmetatable and getmetatable need to be overridden to fix this behavior.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.