Scriptable text editor with Ruby?

D

Dolazy

Simon said:
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!)..
btw: Know your enemy (maybe I should this one day)
http://en.wikipedia.org/wiki/The_Art_of_War

Hah, thanks ;)
 
S

Simon Strandgaard

+1

Simon?

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.
 
D

Dolazy

That's attractive of course. I will check out this editor thoroughly
and let you know something.
 
D

Dolazy

Qt provides lots of functionality for free that you had to implement in
your editor. I think I will continue on my own path.
 
S

Suraj Kurapati

Dolazy said:
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.)
 
D

Dolazy

I still think an application written entirely in ruby would be slow.
Eclipse is slower than Visual Studio, Azureus is slower than
=B5Torrent.. 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.
 
D

Daniel Finnie

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.

dan
 
D

Dolazy

Yeah, you could be right..

I didn't want to go off-topic, but I couldn't resist writing my
previous post. I hope I didn't open pandora's box now.

Francis
 
D

Dolazy

I have taken a look at embedding and Swig.

Hmm... I'm very unsure about them.

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).

I am eager to learn your (anyone's) insights.
 
S

Suraj Kurapati

Dolazy said:
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.

http://ruby-vpi.rubyforge.org


== Option2

If that's not the kind of interaction you want, then see:

http://metaeditor.sourceforge.net/embed/
 
D

Dolazy

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 ;)

Francis
 
A

Alder Green


As you probably already told by numerous people, Vim does that already.

Emacs is supposed to have something like that as well, but it hardly works.

Whereas I managed to get Vim's Ruby support running out of the box on
several flavours of Linux and even freaking Windows...! Respect.

-Alder
 
P

Paulus Esterhazy

Dolazy said:
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 ;)

Francis

Be sure to look at http://software.jessies.org/Evergreen/ for some
insipiration. (Also remember, Java isn't evil anymore now!)

Paulus
 
S

SonOfLilit

When embedding, you can add an extention that implements a ruby API to
your editor and thus the communication will be both ways.
 
J

Josef 'Jupp' Schugt

--------------enigBC9C1947D91C34920FFD6450
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

* Gregory Brown, 01/03/2007 06:17 PM:
but vi *must* run everywhere (According to POSIX). :)

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.

Jupp

--=20
Happy 10. birthday, HAL.


--------------enigBC9C1947D91C34920FFD6450
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFqXflrhv7B2zGV08RAvpCAJwPGu+EhqMXdbeA5bYuLsy/4fwkVwCfa6v/
jk/5IHgKDTXKRbPqW2QN/WM=
=syko
-----END PGP SIGNATURE-----

--------------enigBC9C1947D91C34920FFD6450--
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top