Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scriptable editor

81 views
Skip to first unread message

dott.Piergiorgio

unread,
Feb 15, 2019, 8:52:19 AM2/15/19
to
I need a peculiar animal on Linux: an editor with a scripting language.

the need is only marginally related with CP/M because cycle counting
isn't much used in CP/M, aside very specific instances, but in 8 bit
video game programming IS very critical. And is a work best given to
computer.

The script I have in mind is something that, when I code, say

ANI 20

when I press return, the script change the line into

ANI 20 ; 7 cycles

basically not a difficult script to code, aside typing the cycle database.

Someone can suggest an editor for Linux with script language capable of
this work ?

thanks in advance and

Best regards from Italy,
dott. Piergiorgio.

Udo Munk

unread,
Feb 15, 2019, 8:55:54 AM2/15/19
to
That's what ed and sed are for :)

Neil Thompson

unread,
Feb 15, 2019, 9:19:01 AM2/15/19
to
You'll find "vim" installed as the default editor on most linux distributions. You can use vimscript to do the scripting. You could also use emacs, which is an entire operating system masquerading as a scriptable editor (((if you like LISP, that is )))))))) STOP

Udo Munk

unread,
Feb 15, 2019, 9:24:40 AM2/15/19
to
On Friday, February 15, 2019 at 3:19:01 PM UTC+1, Neil Thompson wrote:

> You'll find "vim" installed as the default editor on most linux
> distributions. You can use vimscript to do the scripting.

Any UNIX vi also comes with ex, which can be scripted with here
documents same as ed, but more powerfull regex.

dott.Piergiorgio

unread,
Feb 15, 2019, 9:33:05 AM2/15/19
to
On 15/02/19 14:55, Udo Munk wrote:
> That's what ed and sed are for :)

I dunno about detail of your work, but editing is by definition an
interactive work, and sed, ed, awk and even perl can do an excellent
work on more or less static data (.ASM files) but isn't pleasant finding
having missed HBLANK or VBLANK by an handful of cycles... aside keeping
track of the differences between PAL and ntsc...

your solution is fine, even excellent, when analysing sources, but add
an IMVHO unnecessary step in the coding-assembling-debugging cycle.

add on top of it that I have always preferred size to speed (I find
gratifying having saved one 128-byte sector in a .COM file...) and I'm
not precisely well-versed in working for speed (being Italian has his
perks, if you have tasted our coffee you will get another reason for the
proverbial Italian "laziness" ;) ) and two or three more minutes of
computing was never an issue for me.

dott.Piergiorgio

unread,
Feb 15, 2019, 9:34:26 AM2/15/19
to
On 15/02/19 15:19, Neil Thompson wrote:
> You'll find "vim" installed as the default editor on most linux distributions. You can use vimscript to do the scripting. You could also use emacs, which is an entire operating system masquerading as a scriptable editor (((if you like LISP, that is )))))))) STOP

Attempt to ignite the classical vi vs. emacs flame noted. :D

Dott. Piergiorgio.

Udo Munk

unread,
Feb 15, 2019, 9:52:17 AM2/15/19
to
On Friday, February 15, 2019 at 3:33:05 PM UTC+1, dott.Piergiorgio wrote:
> On 15/02/19 14:55, Udo Munk wrote:
> > That's what ed and sed are for :)
>
> I dunno about detail of your work, but editing is by definition an
> interactive work, and sed, ed, awk and even perl can do an excellent
> work on more or less static data (.ASM files) but isn't pleasant finding
> having missed HBLANK or VBLANK by an handful of cycles... aside keeping
> track of the differences between PAL and ntsc...

We aren't talking CP/M or DOS ed, these can edit more or less
static data. On UNIX systems the stuff understands regular expressions,
which allows very complicated non static stuff. For example look at
the nroff formatter written in awk and such. And a vi solving
towers of hanoi with some macro script also is not exactely interactive
editing work.

Udo Munk

unread,
Feb 15, 2019, 2:24:40 PM2/15/19
to
For sed here an interesting example about not not more or less static data editing:

https://github.com/bolknote/SedChess

Probably it's more a problem to write a script for your problem than finding an
scriptable editor.

dott.Piergiorgio

unread,
Feb 17, 2019, 8:13:31 AM2/17/19
to
I think it's more tailored for awk, but what computer languages is
appropriate for a problem can be a can of YMMV case ;)

to be more specific, there's one example, if not the prime one, of the
case of keeping track of CPU cycles, hence my pointing that the question
is bordering on OT:

> http://wiki.nesdev.com/w/index.php/Cycle_reference_chart#CPU_cycle_counts

(the CPU involved is a 65xx, but the general concept apply also to 8080s
and Z80s)
0 new messages