Dolazy wrote:
Hi all!
Vim and emacs are text editor that can be scripted using internal
script languages. I'm thinking of writing a platform independent text
editor myself that uses the ruby language for executing scripts. The
host application would be written in C++ (+Qt) and it would somehow be
able to interact with ruby.
Well, given QtRuby, you probably don't really need C++ at all -- you could do it all in Ruby. But I'm not sure what the most recent status of QtRuby is, and there is always the licensing gotcha -- you have to use Qt 4 for open source Windows projects. If you use another GUI toolkit, there are a number with Ruby bindings. For that matter, most of them have some kind of text editor widget built in, which makes life even easier.
I think there are basically two ways of implementing this interaction:
- using IPC
- command line interaction (host executes the ruby script with
parameters and catches the output)
IPC is the most powerful I think, but then again I have various options
to achieve this communication:
- TCP
- XmlRpc
- shared memory
I'm very new to the concept of inter-process-communication and I would
greatly appreciate your insights on how I would best proceed to achieve
this interaction.
Or maybe there is a more obvious and straightforward approach that I
overlooked?
Two comments:
1. As a number of folks have pointed out, "vim" has an excellent Ruby scripting facility already.
2. Rather than delving into issues of low-level implementation, interprocess communication vs. shelling out to a command like vs. whatever, I'd recommend a more agile and pragmatic approach. Pick a toolkit, find a Windows user, a Mac user and a Linux user, set up a project on RubyForge and start building the thing!
···
--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/
If God had meant for carrots to be eaten cooked, He would have given rabbits fire.