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

Scripting front-end(s) on top of the CEmu IPC #19

Closed
debrouxl opened this issue Feb 5, 2016 · 5 comments
Closed

Scripting front-end(s) on top of the CEmu IPC #19

debrouxl opened this issue Feb 5, 2016 · 5 comments

Comments

@debrouxl
Copy link
Collaborator

debrouxl commented Feb 5, 2016

In issue #17 , alberthdev mentioned Lua scripting for triggering operations on CEmu instances. This is the brainstorming issue for scripting front-ends on top of the IPC (issue #16 ); the technical choices for scripting will depend on (and perhaps slightly influence ?) the choices for the IPC mechanism.

@mateoconlechuga
Copy link
Member

Reopened because brainstorming never hurts :D

@adriweb adriweb modified the milestone: v2.0 target Mar 28, 2016
@adriweb adriweb self-assigned this Oct 27, 2016
@adriweb
Copy link
Member

adriweb commented Oct 27, 2016

Since I work on C++<->Lua integration on a daily basis at work, I feel like I would be inclined to think about some Lua(/LuaJIT) integration into CEmu.
After all, Lua is probably the most fitted language for scripting within that kind of host.
https://github.com/ThePhD/sol2 looks interesting to provide nice C++ wrappers/helpers.

Ideally, the main core functions would be exposed, including debugging-related ones, and of course all of the GUI should be accessible programmatically too.
Once all that is "done", using Lua for scripting would supersede the JSON autotester files, for instance, right now relying on an array of semi-hardcoded actions to do the work (which works, but isn't as nice as it could be with proper scripting APIs built-in)

I'm assigning myself to this task, but oh well, I have no idea when I'm going to work on that. CEmu might reach 3.0 by then :P

Any ideas/suggestions/brainstorming/comments welcome...

@adriweb
Copy link
Member

adriweb commented Nov 12, 2016

For fun, I added a few lines here and there on a with_lua branch to get something to build (just on my machine ; it's very WIP).
The example code from Sol does work:

sol::state lua;
int x = 0;
lua.set_function("beep", [&x]{ ++x; });
lua.script("beep()");
assert(x == 1);

I'll look into how to integrate LuaJIT, apparently it's not so hard to call an external makefile from within the .pro. Then, it would be a static lib to use.

Then of course, the big part will be what/where/how to bind Qt (+ core) methods properly.

@adriweb
Copy link
Member

adriweb commented Nov 15, 2016

As one can see in the with_lua branch, I've started binding just a few things to try it out, and it seems to work okay so far:
A little lua script

@adriweb adriweb modified the milestones: v2.0 target, Any version Jan 12, 2018
@mateoconlechuga mateoconlechuga modified the milestones: Any version, v2.0 - Source-lvl dbg Feb 12, 2018
@adriweb adriweb modified the milestones: v2.0 - Source-lvl dbg, v5.0 - Lua Feb 15, 2018
@adriweb
Copy link
Member

adriweb commented Apr 29, 2019

Let's just close that in favor of #252.
Reopen if needed...

@adriweb adriweb closed this as completed Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants