Re: Is mruby the future of Ruby language?

Jason Long <[email protected]> Thu, 27 Jun 2019 19:07:37 +0000 (UTC)
Newsgroups gmane.comp.lang.ruby.general
Message-ID <[email protected]>
Thank you so much for your good information.You and your team using "mruby" because it is lightweight? Can Ruby embedded in other languages? I mean is that can Ruby offer the mruby features? 
Sent from Yahoo Mail on Android 
 
  On Thu, Jun 27, 2019 at 6:59 PM, Marvin Gülker<[email protected]> wrote:   Am 27. Juni 2019 um 12:43 Uhr +0000 schrieb Jason Long:
> What does "Embedded" mean? For example, mruby program can implemented
> in a program that written in other language.

Exactly. mruby exposes a C API. If you have a programme in C or in any
language that can talk to C APIs (which are quite a lot, most notably
including C++) you can "embed" mruby into the programme.

This is usually used to allow the user complex configurations that
cannot easily be described using configuration files. The game I work on
and I mentioned earlier (which is written in C++) for example uses this
feature in order to allow level creators to specify dynamic behaviours
in a level. For instance, the level creator can use this to connect a
switch with arbitrary behaviour, like generating enemies or moving
around platforms. It is not possible for us as the game designers to
foresee all the possibilities level creators might want, so instead we
give them the tools to implement the specific feature themselves.

By the way, if anyone feels like contributing to the game, please join
our mailinglist and ask! https://secretchronicles.org/en/community/

-- 
Blog: https://mg.guelker.eu

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Untitled (text/plain, 1.3 KB)
Am 27. Juni 2019 um 12:43 Uhr +0000 schrieb Jason Long:
> What does "Embedded" mean? For example, mruby program can implemented
> in a program that written in other language.

Exactly. mruby exposes a C API. If you have a programme in C or in any
language that can talk to C APIs (which are quite a lot, most notably
including C++) you can "embed" mruby into the programme.

This is usually used to allow the user complex configurations that
cannot easily be described using configuration files. The game I work on
and I mentioned earlier (which is written in C++) for example uses this
feature in order to allow level creators to specify dynamic behaviours
in a level. For instance, the level creator can use this to connect a
switch with arbitrary behaviour, like generating enemies or moving
around platforms. It is not possible for us as the game designers to
foresee all the possibilities level creators might want, so instead we
give them the tools to implement the specific feature themselves.

By the way, if anyone feels like contributing to the game, please join
our mailinglist and ask! https://secretchronicles.org/en/community/

-- 
Blog: https://mg.guelker.eu

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>