-
Notifications
You must be signed in to change notification settings - Fork 6
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 Impala-to-Lua Transpiler, Add Lua Math Functions, Re-Enable Unit Tests #58
Conversation
ad2e756
to
44562bf
Compare
44562bf
to
39188c2
Compare
external/CMakeLists.txt
Outdated
message("Enabled Lua lmathx support.") | ||
|
||
if (LUA_VERSION_STRING VERSION_GREATER_EQUAL "5.5") | ||
message(WARNING "You Lua version ${LUA_VERSION_STRING} is newer than the maximum lmathx package version supported (5.4.x). We'll try with the version compatible to 5.4/5.3, but no guarantee on success for that.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Your"?. But what do we suggest the user if their LUA version is greater than 5.5? Just downgrade to 5.4.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, typos. :)
We can suggest a downgrade here.
external/CMakeLists.txt
Outdated
elseif (LUA_VERSION_STRING VERSION_GREATER_EQUAL "5.1") | ||
target_sources(easi PRIVATE lua51/lmathx.c) | ||
else() | ||
message(FATAL_ERROR "You Lua version ${LUA_VERSION_STRING} is older than the minimum lmathx package version supported (5.1).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another typo?
We add a small and quickly-written tokenizer and parser for Impala (akin to what's done over there in the repository, but with a bit more manual labor). Probably it's actually overkill to walk down the Impala ast here, since the Impala/C and Lua syntax are pretty similar in their behavior. Right now, every Impala function gets converted to one Lua function (it may also be easily possible to merge all functions into one (you'd "just" need to track the returns for that and shift code into
else
blocks, if there's areturn
in anif
); but I'm not sure if that's really useful).As a result, ImpalaJIT is no longer required to run a
FunctionMap
; only Lua is.Also, we refactor the Lua function evaluation a tiny bit, and cut down the number of calls by the number of output parameters (so far, a function was executed for each output value again, even though the execution should result in exactly the same result). Would be interesting to think about supporting LuaJIT.
Furthermore, we now by default include the
lmathx
Lua library; thus the whole C math header should be effectively available now (the code for that is under public domain—I've just put it into the repo for now).Also, the unit tests get re-enabled and fixed.