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
Native support of mruby-cli in mruby build system. #3956
base: master
Are you sure you want to change the base?
Conversation
381b00e
to
8b02ffe
Compare
I am not sure the benefit of the proposed change. I try to read the diffs but they are huge. Besides that, this pull-request introduces 3 global variables. It's against our basic rule to avoid global variables. |
@@ -89,6 +89,11 @@ void mrb_gc_mark_mt(mrb_state*, struct RClass*); | |||
size_t mrb_gc_mark_mt_size(mrb_state*, struct RClass*); | |||
void mrb_gc_free_mt(mrb_state*, struct RClass*); | |||
|
|||
extern mrb_int |
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.
Ah, sorry these corresponds to those in CRuby:
https://github.com/ruby/ruby/blob/421a73f51a39ff6829f9715b423a928782ec8ec3/vm.c#L339-L341
And it should be mrb_state
specific.
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.
Maybe this should be optional like VM hooks.
@matz
I want to know:
We need to know this feature works and all knows it's useful. |
The proposed change sounds reasonable. It is OK to change the build system and writing command line tools in mruby. But I don't want to add members to |
Just for a proof of concept I've rewritten
mruby-bin-strip
only with ruby script formruby-cli
feature.For
mrb_irep
section modifications,MRubyVM
(subset ofRubyVM
in CRuby) is implemented too.Since mruby-cli isn't catching up with recent mruby releases, we should support this with mrbgem build system.
~~ This is not complete because I need to add minimal dependency
mrb_open
for better testings too. Symbol likemrb_open_cli
must be generated. ~~Now implemented: 34a3939
See #1676 for implementation detail.