Library or external programs

  • Thread starter Michael Gebhart
  • Start date
M

Michael Gebhart

Hi,

I wanna write a ruby application. But I also want,
that other applications can use the functionality of my application too.


So I had the idea to write a library in C and a binding for ruby. So
everyone, who wants to use C can use the library and I can use it with
ruby. If someone wants to use it in perl or python, he can write a binding
too. So I started writing the library in C. After maybe 1 hour I was tired
of hacking C. When using ruby for a while, C is very hard. :)

Now my idea was to use ruby for the functionality and to create some
scripts, which can be started by other programmers. Like this:

myprogram --do-something --param1=xy --param2=yz

This is not as hard as writing a library in C :)

But the developers now don´t have as much freedom as with a library
written in C. But on the other hand many languages simply can use the
programs, without writing a binding first.

My question now is: What do you think about this? Is it not a good way
to share functionality? Or is it ok?

Greetings

Mike
 
F

Friday

Michael said:
My question now is: What do you think about this? Is it not a good way
to share functionality? Or is it ok?

Greetings

Mike

You might want to look into the unix way of doing things.

Unix Power Tools is a pretty good book that help people grok the
philophophy.

Pipes, filters, and command-line parameters working together in a very
elegant manner.

There's probably a ruby project that helps ruby get used in this manner.
 
M

Michael Gebhart

Hi,

thanks for your answer. I have also found this:

http://www.approximity.com/rubybuch2/node176.html

This shows, how to use ruby-code in C. But not sure, if this is the wrong
direction. Maybe it is very slow. Well the problem ist, that I want, that
many people have fun and use with my code. That they can reuse it. Maybe
this is with shellscripts very easy. There is no binding needed. On the
other hand, it is not very integrated for other developers. The
possibilities are limited.


Greetings

Mike
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top