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

Store cat code within external lua file #18

Open
ZackeryRSmith opened this issue Feb 9, 2023 · 2 comments
Open

Store cat code within external lua file #18

ZackeryRSmith opened this issue Feb 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ZackeryRSmith
Copy link
Owner

ZackeryRSmith commented Feb 9, 2023

Cat's are currently pretty hard coded which I'd really like to avoid. Having to compile the whole project (which also means installing quite a few things) shouldn't be required. Especially if you only want to tweak a small thing with how the cat operates.

Why Lua?
There is various reason why I choose Lua to provide the scripting support:

  • Its low footprint and superior speed as compared to other scripting frameworks.
  • In version 2.0, Lua had a major restructuring which had led toward significant performance gains.
  • Lua has a JIT compiler, which is very fast (with a very small footprint).
  • When compared to other popular scripting platforms such as Python, Lua uses a much smaller memory footprint.
  • Lua has a simple, but very efficient, syntax.
  • It has out-of-box support for passing anonymous functions as arguments, map/array as one concept called “table”, meta functions, and meta tables, allowing implementation of various programming paradigms.
  • Lua provides a very low-level C API

I plan on using the LuaCpp library to integrate Lua in this project. As using the Lua low-level C API would require me to learn the internals of the Lua engine before I could even imagine using it in bongocat-plus. LuaCpp addresses this issue; it's a lightweight wrapper for Lua C APIs that provides access to the Lua library.

@ZackeryRSmith ZackeryRSmith added the enhancement New feature or request label Feb 9, 2023
@ZackeryRSmith ZackeryRSmith pinned this issue Jul 4, 2023
@ZackeryRSmith
Copy link
Owner Author

See the refactor branch, and for active dev-logs join the Discord go to #dev-logs and click Bongocat-Plus

@ZackeryRSmith ZackeryRSmith unpinned this issue Jan 11, 2024
@ZackeryRSmith ZackeryRSmith moved this to Todo in Refactor TODO Jan 13, 2024
@ZackeryRSmith ZackeryRSmith moved this from Todo to In Progress in Refactor TODO Jan 13, 2024
@ZackeryRSmith ZackeryRSmith reopened this Dec 20, 2024
@ZackeryRSmith
Copy link
Owner Author

This issue has been reopened to keep as a tracker. Although Lua scripting now has an API and is technically supported. Many things need to be ironed out. To keep this tracker simple, I will close this issue once Bongocat-Plus can do the following:

  • Load Lua scripts from the cat directory
  • Load cat by name in config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant