Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lua os library section #2671

Merged
merged 4 commits into from
Mar 8, 2024
Merged

Add Lua os library section #2671

merged 4 commits into from
Mar 8, 2024

Conversation

sundb
Copy link
Contributor

@sundb sundb commented Feb 21, 2024

in redis/redis#12971 we expose a new Lua os api os.clock().

Copy link

netlify bot commented Feb 21, 2024

👷 Deploy request for redis-doc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit be65125

@oranagra oranagra added waiting-for-upstream waiting for a redis PR to be merged to-be-merged should probably be merged soon labels Feb 21, 2024
docs/interact/programmability/lua-api.md Outdated Show resolved Hide resolved
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I wonder why the other date and time functions os.date, os.time and os.timediff were not exposed. Apart from those, we now seem to allow all standard library functions except the ones that access the file system and IO. I wasn't involved in the original PR though.

@sundb
Copy link
Contributor Author

sundb commented Mar 8, 2024

@zuiderkwast At first, i wondered whether to expose like o.date and similar non-dangerous Lua api as well.
we should expose a Lua api because it can complement something we can't do, like time escaping, but the
reset of api doesn't, IMHO, i don't think we should expose it just because it exists.

@zuiderkwast
Copy link
Contributor

IMHO, i don't think we should expose it just because it exists

We expose the other standard libraries. For those who know Lua from before, they might assume that all standard library functions are available (except the dangerous ones). But I have no strong opinion.

@zuiderkwast zuiderkwast merged commit 7f18c04 into redis:master Mar 8, 2024
1 check failed
@sundb sundb deleted the lua_elapsed branch March 8, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-be-merged should probably be merged soon waiting-for-upstream waiting for a redis PR to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants