Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RE: VI in Perl

by Dominus (Parson)
on Nov 16, 2000 at 01:36 UTC ( [id://41893]=note: print w/replies, xml ) Need Help??


in reply to VI in Perl

This is a really impressive project. I was just thinking yesterday that if someone wrote an editor in Perl, and designed the internals properly, it would be trivial to use Perl as an extension language for it. Are you planning to do something like that?

Replies are listed 'Best First'.
RE: RE: VI in Perl
by gharris (Beadle) on Nov 16, 2000 at 01:56 UTC
    There is a project (called Perlmacs) to make add support for Perl embedded in Emacs. You can find details about it here.

    When I first heard about it, I thought it was the Holy Grail I have been searching for, but... like Emacs, as much as I love the extensibility, it just seems clunky and resistant to use.

    I'm still looking for a 'really good editor'.

    --Glenn

      There's this editor that's not emacs and you can embed Perl in it already =)

      As if I needed *reasons* for being on one side or the other =)

RE: RE: VI in Perl
by dmitri (Priest) on Nov 16, 2000 at 02:15 UTC
    It will hopefully be extensible... right now

    :s/foo/bar/g

    is implemented internally using eval(). There is also a way to specify perl code from command line, i.e.:

    :.,+10 {$_=reverse}

    to reverse 11 lines.

    This project of mine is far from complete, and the code is messy and unoptimized. However I hope that it will be a good learning experience (it already has), and maybe in a couple of weeks I will use vip to develop vip. :)

    Next big things on my list are recovery and a cache to optimize the linked list access (right now it is pretty slow, look for /_get_reference_to_number/ in v_list.

    - Dmitri.

      When I was looking through the code, I found myself wondering why you had used linked lists at all, instead of Perl arrays. Wouldn't that have been faster and simpler?

        Good point.

        However, I think that when the cache is implemented, and I type '250dd' in the middle of a 3000-line file, linked list will not be much slower than splice(), or maybe even faster (or maybe I am just fooling myself).

        I think the implementation is such because back when I was contemplating this program, back in July, I was convinced by some people and some programming literature that all editors are written using linked lists. I did not want to swim against the stream. We'll see how it pans out, I guess, I can always rewrite v_list using arrays.

        Thank God for OO! :)

        - Dmitri.

        Having trouble getting the dimitri's web site. Anybody know where I could get a copy of vip, his VI editor written in perl. Thanks. I have been working on one using Perl/Tk to insert in some perl programs I have that need an editor. Has any one ever tried using Vim form perl. I have used the Win32::OLE to interface. vim has a VisVim.dll for use with Visual Studio. I'm not a C programmer, so I havent tried to get Perl to call VisVim. Anybody got any ideas? Thanks Mike W.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://41893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-29 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found