Three Ruby language features?

Hello, Ruby folks!

Before I start learning Ruby I want to check for some features. You
don't need to tell me how the following things are done, just
_whether_ they can be done.

Can I do in Ruby:
1.) develop applications that run on my local PC without a server,
just in the shell or desktop environment?
2.) create libraries that can be used by C or C++ programs?
3.) use C or C++ libraries?

Kind regards
Peter Wiehe

Hello, Ruby folks!

Before I start learning Ruby I want to check for some features. You
don't need to tell me how the following things are done, just
_whether_ they can be done.

Can I do in Ruby:
1.) develop applications that run on my local PC without a server,
just in the shell or desktop environment?

Yes, but the ruby interpreter needs to be installed. You can't, afaik, reliably create a standalone executable.

2.) create libraries that can be used by C or C++ programs?

No.

3.) use C or C++ libraries?

Yes. Most libraries use SWIG to create a direct mapping of the C api to the Ruby counterpart.

···

El 06/10/17 a las 20:10, Peter Wiehe escribió:

--
Gonzalo Garramuño

(excuse the formatting, email client was recently upgraded and haven’t fixed formatting)

···

On 10/6/17, 6:10 PM, "ruby-talk on behalf of Peter Wiehe" <ruby-talk-bounces@ruby-lang.org on behalf of peter.wiehe2@gmail.com> wrote:

    Hello, Ruby folks!
    
    Before I start learning Ruby I want to check for some features. You
    don't need to tell me how the following things are done, just
    _whether_ they can be done.
    
    Can I do in Ruby:
    1.) develop applications that run on my local PC without a server,
    just in the shell or desktop environment?

   Absolutely. You can use ruby for web development, server configuration, desktop apps, etc

    2.) create libraries that can be used by C or C++ programs?

   Sure. There are FFI’s that allow C and C++ to interface with ruby methods.

    3.) use C or C++ libraries?

   Sure. There are FFI’s that allow C and C++ to interface with ruby methods.
    
    Kind regards
    Peter Wiehe
    
    Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
    <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

that they can run Ruby scripts as libraries. I've never done this
personally though.

···

On Fri, Oct 6, 2017 at 6:17 PM Gonzalo Garramuño <ggarra13@gmail.com> wrote:

El 06/10/17 a las 20:10, Peter Wiehe escribió:
> 2.) create libraries that can be used by C or C++ programs?
No.

You can, however, embed the Ruby interpreter into those C/C++ programs so

--

-Jeremy