RES: Bare-bones Ruby

Discussion in 'Ruby' started by Leiradella, Andre V Matos Da Cunha, Dec 28, 2004.

  1. > After you build ruby you can use just a ruby executable without the
    > standard library if you do not need the functionality it provides. As
    > for built-in classes and modules, such as String, you will not be able
    > to get without them as they are implemented internally in C and other
    > parts of Ruby depend on them heavily.


    Dependencies are dependencies!

    > The book I mentioned has a very good chapter on embedding Ruby.


    Will get a copy if I choose Ruby.

    >> 3) What are the functions that must be called to make Ruby load a
    >> program,
    >> to create an instance of a class defined in Ruby, to call methods with
    >> this
    >> instance etc.? Is this API documented somewhere?

    >
    >I did not quite get the question, but if you mean the API between Ruby
    >and extensions written in C, Pickaxe discusses it in great details too.


    Actually I was referring to the API the other way around, from the C host
    program to Ruby. I need functions to:

    1) Initialize Ruby
    2) Register some native functions written in C
    3) Run some predefined scripts to register classes
    4) Instantiate objects and call their methods
    5) go to 4 while the application is running
    6) De-initialize Ruby

    Regards,

    Andre de Leiradella
     
    Leiradella, Andre V Matos Da Cunha, Dec 28, 2004
    #1
    1. Advertising

  2. Leiradella, Andre V Matos Da Cunha

    rcoder Guest

    Andre,

    There are a number of tutorials about for extending and embedding Ruby,
    but you might try taking a look at the slides I wrote for a
    presentation I gave to our local Perl Mongers meeting earlier this
    year:

    http://rcoder.net/talks/pm_sep04/c_api/index.html

    It covers just the basics of writing C extensions, as well as
    initializing and running the Ruby intepreter from within your own
    application. You should be able to get an idea of how much work is
    required (not much!) for basic integration.

    Lennon
    rcoder.net
     
    rcoder, Dec 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leiradella, Andre V Matos Da Cunha

    Bare-bones Ruby

    Leiradella, Andre V Matos Da Cunha, Dec 27, 2004, in forum: Ruby
    Replies:
    5
    Views:
    146
    Robert Klemme
    Dec 28, 2004
  2. Leiradella, Andre V Matos Da Cunha

    RES: Bare-bones Ruby

    Leiradella, Andre V Matos Da Cunha, Dec 28, 2004, in forum: Ruby
    Replies:
    0
    Views:
    85
    Leiradella, Andre V Matos Da Cunha
    Dec 28, 2004
  3. Leiradella, Andre V Matos Da Cunha

    RES: Bare-bones Ruby

    Leiradella, Andre V Matos Da Cunha, Dec 28, 2004, in forum: Ruby
    Replies:
    0
    Views:
    113
    Leiradella, Andre V Matos Da Cunha
    Dec 28, 2004
  4. Leiradella, Andre V Matos Da Cunha

    RES: RES: Bare-bones Ruby

    Leiradella, Andre V Matos Da Cunha, Dec 29, 2004, in forum: Ruby
    Replies:
    1
    Views:
    302
    Stefan Schmiedl
    Dec 29, 2004
  5. Leiradella, Andre V Matos Da Cunha

    RES: RES: RES: Bare-bones Ruby

    Leiradella, Andre V Matos Da Cunha, Dec 29, 2004, in forum: Ruby
    Replies:
    0
    Views:
    135
    Leiradella, Andre V Matos Da Cunha
    Dec 29, 2004
Loading...

Share This Page