Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Lua Debug library called #77

Closed
Wuzzy2 opened this issue Mar 12, 2019 · 3 comments
Closed

Lua Debug library called #77

Wuzzy2 opened this issue Mar 12, 2019 · 3 comments

Comments

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Mar 12, 2019

This mod calls the debug Lua library, which it shouldn't do.

You should exert care when using this library. The functions provided here should be used exclusively for debugging and similar tasks, such as profiling. Please resist the temptation to use them as a usual programming tool: they can be very slow. (…)

https://www.lua.org/manual/5.1/manual.html#5.9

@kilbith
Copy link
Collaborator

kilbith commented Mar 12, 2019

Thanks for the info, but this isn't used in performance-critical code and it is useful for debugging actually.

@kilbith kilbith closed this as completed Mar 12, 2019
@Wuzzy2
Copy link
Contributor Author

Wuzzy2 commented Mar 12, 2019

My point is that debug is called in PRODUCTION code which is a really bad idea. It's not just about performance. Frankly, I trust the Lua developers here more than you. When they say to not use debug, I will not use debug. ;-)

Anyway, looks like you only use it for introspection. So that could be replaced with hardcoded strings.

Anyway, I already removed this in my MCL2 fork.

@kilbith
Copy link
Collaborator

kilbith commented Mar 12, 2019

Some items in everyday life are intended for a sole and specific purpose, yet we can sometimes divert them from their original usecase for other purposes for which they are not originally intended.

Same with the code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants