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

Integrate MoonScript with LuaJIT? #400

Closed
VinnyVicious opened this issue Sep 17, 2019 · 4 comments
Closed

Integrate MoonScript with LuaJIT? #400

VinnyVicious opened this issue Sep 17, 2019 · 4 comments

Comments

@VinnyVicious
Copy link

I have a very small project that uses LuaJIT along with my C++ application for scripting. I would love to integrate MoonScript directly with it, so I don't need any pre-compilation step and LuaJIT just parses MoonScript files as if they were Lua files. Is there anyway of doing this, or is the CLI tool and compilation step absolutely necessary?

@refi64
Copy link

refi64 commented Sep 18, 2019

Howl does this, it can compile MoonScript either ahead of time (for built-in files) or at runtime (for user added bundles). I think most of the relevant code is in init.lua.

@johnae
Copy link

johnae commented Sep 18, 2019

spook does this as well.
See https://github.com/johnae/spook/blob/b407ea5b96d50d0ff1f2878c40be39e64ab68ff8/init.moon#L64
and
https://github.com/johnae/spook/blob/b407ea5b96d50d0ff1f2878c40be39e64ab68ff8/init.moon#L154.

Spook, when compiled, becomes a single executable capable of running either lua or moonscript directly which sounds like what you're after.

@VinnyVicious
Copy link
Author

Precisely what I was looking for. Thanks for the links, guys. I was looking for a solution in C++, but I get what you're doing in Lua and it's pretty clever.

@leafo
Copy link
Owner

leafo commented Sep 26, 2019

Closing this then. Not that this issue is a problem, but if you'd like to chat with other moonscript users we have a discord: https://discord.gg/Y75ZXrD

@leafo leafo closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants