pkg/lua: Better Lua-RIOT integration - #9153
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Better integration of the Lua interpreter with RIOT
The main idea behind this PR is that interpreted code should never be allowed to crash the host application. A secondary goal is to cover the majority of use cases in a few simple API calls, to remove the required boilerplate and make it easier to use the Lua package correctly.
setjmp()/longjmp(). Thus, in case of a irrecoverable failure in the interpreter, control returns to the host application (by default, lua callsabort())Note that only 32 bit CPUs will be supported.
Future work
The next PRs will focus on build system integration (i.e. being able to compile
%.luainto an application).About the Lua patches
I'm patching lua, in a way that is perfectly compatible with the unmodified code. I'm running the test suite, and it passes. Patches are still patches, and they will never get merged into upstream lua, simply because the Lua people don't accept outside submissions (check the FAQ for more info). This is a reality we have to accept. Other projects do the same, they apply their own modifications.
Issues/PRs references
Extends: #8847
Depends on: #9090 #9006 #9244