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.
Why start from scratch? Take over an existing, defunct open source
project:
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.
Why start from scratch? Take over an existing, defunct open source
project:
I don’t know what exactly your goal is for this editor,
but if you want it to be great then take a look at
what other great editors is doing.
IMO TextMate is the best editor I have ever tried,
and was the reason I abandoned my own editor
project: http://aeditor.rubyforge.org/
Well TextMate has two important drawbacks: it’s Mac only and it’s not
free. I’ll give the evaluation version a try on my Mac at work to see
if I it can inspire me (hopefully not discourage me if it’s too
good!)…
Thanks for your suggestions Edward, Vince (+others).
However, running a complete text editor application as a ruby script;
wouldn’t that be slow?
The idea of having a C++ skeleton application with lot’s of ruby
plugins seems more appealing to me. It would be faster and still
strongly customizable. However, if you think differently then please
share your insights on this…
I will grant admin if anyone feels like continuing aeditor.
Actually I did the same yesterday with http://ros.rubyforge.org/
after talk in the ros forum.
The reason I stopped working on these things was that
I got a job that took up all my available time.
Only profesional work, no focus on the social side.
So I quit that job and started my own company,
hoping to do it better. I have plenty of time now,
but its allocated for the company beast.
If someone payed food/rent then I would have
been happy working entirely on ruby projects.
The person(s) that has interest in the aeditor project,
is free to do whatever she likes. Change website,
license, code. Write a entirely new aeditor. Add code,
licenses, websites, etc. I don’t mind as long as its
for a good purpose.
I still think an application written entirely in ruby would be slow.
Eclipse is slower than Visual Studio, Azureus is slower than
µTorrent… Higher level languages are slower, even if they use optimal
data structures. I know that this doesn’t have to be this way
theoretically, and that higher-level languages allow more compiler
optimization and all. But still you see that programs written in C/C++
are almost always faster than those written in Java, or other
high-level languages (esp ruby!).
I’m in favor of higher level languages, but wanting to make my
application customizable using external scripts does not mean my
language is too low-level. It just means that I want to make my program
programmable.
However, running a complete text editor application as a ruby script;
wouldn’t that be slow?
The idea of having a C++ skeleton application with lot’s of ruby
plugins seems more appealing to me. It would be faster
You cannot assume that things will be faster just because you use a
low-level language. If this were true, then all 3D games would be
written in straight machine code… forget about assembler!
Efficiency comes primarily from good choice of data structures and
algorithms which are best suited to tackle the problem at hand. Whether
or not the programming language being used is “close to the metal” is,
at best, of secondary importance.
and still strongly customizable.
Good, it seems you are implicitly seeking a higher level language so
that you can better manage complexity. (Google “No Silver Bullet” for
details.)
I don’t know much about Eclipse and VS so I won’t comment on those;
however, uT and Azureus aren’t both trying to be lightweight so, IMO, it
is unfair to compare them like that.
Also, I think you have to remember that you are coding a text editor.
On any modern computer it honestly won’t matter what language you do it
in.
Swig seems to assume that you want to take away the main() method and
treat the C++ code as a shared library. It’s not really the same as
interprocess communication.
The embedding solution also provides one way interaction. The C++
program calls ruby, but not the other way around. There might be ways
around this, using callbacks or so. I’d like to learn more…
I suspect that IPC using XmlRpc is the most powerful solution (and easy
to implement).
Swig seems to assume that you want to take away the main() method and
treat the C++ code as a shared library. It’s not really the same as
interprocess communication.
The embedding solution also provides one way interaction. The C++
program calls ruby, but not the other way around. There might be ways
around this, using callbacks or so. I’d like to learn more…
I suspect that IPC using XmlRpc is the most powerful solution (and easy
to implement).
There is an easier way than having ruby in a separate process and having
to do IPC via RPC. Simply run ruby within a pthread and give it a SWIG
interface to your C++ app.
== Option1
If you cannot allow the Ruby thread to asynchronously use your C++ app,
then you can set up a mutual exclusion scheme where either (1) the C++
app or (2) the Ruby thread is active at a time. You would then have to
provide a way to transfer/relay control between them.
In fact, this is how my Ruby-VPI project works. It embeds a Ruby
interpreter into a C program that runs within a Verilog.
Java is attractive for several reasons. A powerful gui, speed is very
good, and there’s JRuby… But I want to explore new territory. That’s
why I want to choose Qt, because it’s something new for me. Also
because I am a C++ developer I want to improve my cv a bit
Java is attractive for several reasons. A powerful gui, speed is very
good, and there’s JRuby… But I want to explore new territory. That’s
why I want to choose Qt, because it’s something new for me. Also
because I am a C++ developer I want to improve my cv a bit
line-mode ex is scriptable. The TUI that can be started using
‘:visual’ (hence its commonly known name ‘vi’) isn’t. ex’s ancestor
ed is scriptable as well. I sometimes use the latter for shell script
controlled in-place editing of files to avoid unnecessary security
issues resulting from the creation and deletion of temporary files
(that is one of the largest source of harmful security holes known to
authors of shell scripts). It is a pity that many people only know
sed (wich is nothing but a stripped-down version of ed only being
capable to handle streams) because they are doomed to introduce such
problems.