Forth was my first language, 25 years ago. I haven't done anything usefull
with Forth since the late 80s and even didn't stay tuned with it's
evolution. I just found GForth in my Linux package repository lately,
installed it and found myself quite comfortable with it, except I miss an
ANSI or VT100 screen editor for a block in a certain block file. Also I
installed pForth, for which I cannot find such too.
Does anybody still use this kind a editor? Is it obsolete?
Any suggestions?
Many Thanx...
Thomas Braun
PS: Having the old line editing words would also help.
> Hello everybody,
>
> Forth was my first language, 25 years ago. I haven't done anything
> usefull with Forth since the late 80s and even didn't stay tuned with
> it's evolution. I just found GForth in my Linux package repository
> lately, installed it and found myself quite comfortable with it,
> except I miss an ANSI or VT100 screen editor for a block in a certain
> block file. Also I installed pForth, for which I cannot find such too.
>
> Does anybody still use this kind a editor?
Not that I'm aware of it. bigForth has a GUI-based editor, which is
also capable of editing blocks, but it won't work on a simple ANSI
terminal ;-).
> Is it obsolete?
Yes. People use stream files for Forth sources.
> Any suggestions?
>
> Many Thanx...
> Thomas Braun
>
> PS: Having the old line editing words would also help.
Oh, they are available. Just do
use blocked.fb
1 load
and you have a block editor similar to the PolyForth editor (of course,
the block editor is in a block file, the only one in the Gforth
distribution! ;-).
0 l
will give you the help screen. The last line there says
"If you don't like it, write a block editor mode for Emacs!"
and this indeed also has been done - it's part of gforth.el.
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/
[missing editor]
I finally found the line editing words after a...
use blocked.fb
0 list
...as described in GForth's Blocks manual page. ;)
Sorry for the fuzz.
Cheers
[missing editor]
Thank You, Bernd.
> ...
> 0 l
>
> will give you the help screen. The last line there says
>
> "If you don't like it, write a block editor mode for Emacs!"
>
> and this indeed also has been done - it's part of gforth.el.
>
No thanks. I prefer doing everything from inside a running interpreter
if possible, with introspection capabilities (like "see") ;)
Apropos: Do GForth words know their source location?
Best wishes
Thomas
You don't need blocks for that: you can use regular source files and
invoke an external editor from within gforth. I have a simple script if
you want it. These days I usually do it the other way around (invoke
the Forth system from my editor), but I don't recall why I switched...
--Josh
No, but the editor knows (through the TAGS file). Esc-. on a word will get
you to the source in Emacs.
http://en.wikipedia.org/wiki/Ctags
--Josh
Thank You all!
I remember the metacompiled L&P-F83's words having a field keeping the
file number and another field keeping the screen number of their
source location. that made the whole environment truely self
explaining and customizable in a way, that I only knew from Smalltalk.
I somehow expected this feature having survived the last decades ;)
Cheers...
I'm under the vague impression that it has. I'm not at the computer
with the relevant manuals at the moment, but look into the free
evaluation versions of VFX and Swiftforth - I'm pretty sure one (maybe
both) of those have that as part of their integrated development
environment.
>I remember the metacompiled L&P-F83's words having a field keeping the
>file number and another field keeping the screen number of their
>source location. that made the whole environment truely self
>explaining and customizable in a way, that I only knew from Smalltalk.
>I somehow expected this feature having survived the last decades ;)
Most systems provide it - ours certainly do.
Stephen
--
Stephen Pelc, steph...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
Yet simpler. If I use Forth interactively I simply keep all source
files in memory after loading. With a couple of Gbyte to spare...
: INCLUDED GET-FILE EVALUATE ;
>
>--Josh
Groetjes Albert.
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
Certainly SwiftForth and SwifX (our cross-compiler for embedded systems)
have! Since switching from blocks to files, we work with a separate
programmer's editor of your choice. We can link to it (there are
predefined links to about a dozen common editors) such that from our
command window you can easily get to the source for a word. If you
select any word in the command window and right-click, you can:
* disassemble the compiled code (SwiftForth and SwiftX generate
optimized machine code);
* dump the region of memory around it (useful for looking at data objects)
* display its source from the file, with several lines before and after
to provide context;
* switch to your linked editor with the source file open and the cursor
positioned at the definition of the word;
* see a cross-reference showing where it's used in the currently
compiled code;
* execute it (assuming you have previously provided any stack arguments
required).
Cheers,
Elizabeth
--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com
"Forth-based products and Services for real-time
applications since 1973."
==================================================
> Certainly SwiftForth and SwifX (our cross-compiler for embedded systems)
> have! Since switching from blocks to files, we work with a separate
> programmer's editor of your choice. We can link to it (there are
> predefined links to about a dozen common editors) such that from our
> command window you can easily get to the source for a word. If you
> select any word in the command window and right-click, you can:
>
> * disassemble the compiled code (SwiftForth and SwiftX generate
> optimized machine code);
>
> * dump the region of memory around it (useful for looking at data objects)
>
> * display its source from the file, with several lines before and after
> to provide context;
>
> * switch to your linked editor with the source file open and the cursor
> positioned at the definition of the word;
>
> * see a cross-reference showing where it's used in the currently
> compiled code;
>
> * execute it (assuming you have previously provided any stack arguments
> required).
Yes, it was the (evaluation) SwiftForth that I was recalling. I only
played around with it a little, as at the time I was mostly testing to
see that BMW based on Leo Wong's LF ran and loaded without
modification on SwiftForth.
maybe this is what you are looking for:
http://www.schneider-busch.de/dirk/forth/org/downloads/vibe-2.1.f
> Does anybody still use this kind a editor?
I don't hink so.
> Is it obsolete?
Yes ;)
regards
Dirk Busch
Most systems have it. Gforth keeps the location data separate in an
external file, because the idea of Gforth is to be a hosted system,
and that includes working well with other tools.
And, e.g., Emacs (and probably also vi) work better with a tags file
than if the information sits inside the Forth system. Sure, if it
sits in the Forth system, I can say there something like EDIT FOO, and
the Forth system might invoke emacsclient with the appropriate file
and line number information. But once we are in the editor, we may
also want to look up another word; then having to go back to the Forth
system is inconvenient; it's much nicer to just type (in Emacs) M-.,
and be given the word currently under the cursor as default name (if
it fits, just press Return).
Currently you have to create tag files for Gforth explicitly. Maybe
it would be better to make this more automatic.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2009: http://www.euroforth.org/ef09/
Hello Thomas,
below is my version of the Retro Forth Editor for gforth:
------(snip)-----
.( Retro Forth block editor for gForth )
cr
16 constant l/b
: (block) scr @ block ;
: (line) c/l * (block) + ;
: row dup c/l type c/l + cr ;
: .rows l/b 0 do i . row loop ;
: .block ." Block: " scr @ dup . updated? 43 + emit space ;
: +--- ." +---" ;
: :--- ." :---" ;
: x--- +--- :--- +--- :--- ;
: --- space space x--- x--- x--- x--- cr ;
: vb --- scr @ block .rows drop --- ;
: .stack ." Stack: " .s ;
: status .block .stack ;
: v cr vb status ;
: v* update v ;
: s dup scr ! block drop v ;
: ia (line) + >r 10 parse r> swap move v* ;
: i 0 swap ia v* ;
: d (line) c/l bl fill v* ;
: x (block) l/b c/l * bl fill v* ;
: p -1 scr +! v ;
: n 1 scr +! v ;
: e scr @ load ;
cr .( editor loaded ) cr
------(snip)-----
See http://retroforth.com/wiki/?id=REDports
for more information on this editor.
-- Carsten
John Rible and I wrote miniEDIT.
The listing at the end is a full screen block editor.
Without 'extensions' miniEDIT will fit into one block.
miniEDIT uses ANSI cursor control ( AT-XY ), Vim like movement, and
works with gforth on Mac. Probably works with gforth on Win and Linux.
\ ==============================================================
\ include /Users/Bee/Documents/Chuck/e4dist/miniEDIT/miniEDIT.f
\ 20081231 bee gforth-mac Do Not Use: ^c ^o ^q ^s ^z ^\ ^= ^~ ^` ^=
: LL ( line# -- ( List Line )
DUP C/L * SCR @ BLOCK + C/L TYPE S>D <# # # #> TYPE ;
: LIST ( n -- ) DUP SCR ! . ." scr" 0
BEGIN CR DUP LL 1+ DUP 16 = UNTIL DROP ;
( miniEDIT extensions ) DECIMAL
: RE ( -- n ) SCR @ ; : L ( -- ) 0 DUP AT-XY RE LIST ;
: B ( -- ) -1 SCR +! ; : N ( -- ) 1 SCR +! ;
: mx1 ( c i -- c i ( miniEDIT extension 1 )
OVER 127 = IF 1- THEN ( left delete )
OVER 2 = IF B L THEN ( back ^b )
OVER 14 = IF N L THEN ( next ^n ) ;
( miniEDIT full screen overwrite mode ) DECIMAL
: !XY ( i -- i ) 1023 AND DUP C/L /MOD 1+ AT-XY ;
: !CH ( c i -- c i ) 2DUP SCR @ BLOCK + C! UPDATE OVER EMIT ;
: ?CH ( c i -- c i' ( VIM like controls )
OVER BL - 95 U< IF !CH 1+ EXIT THEN ( text )
OVER 8 = IF 1- THEN ( left ^h )
OVER 12 = IF 1+ THEN ( right ^l )
OVER 11 = IF C/L - THEN ( up ^k )
OVER 10 = IF C/L + THEN ( down ^j )
OVER 13 = IF C/L 2DUP MOD - + THEN ( crlf return )
mx1 ( mx2 ( mx3 ( mx4 ( mx5 ( mx6 ) ;
: EDIT ( n -- ) PAGE 0 DUP AT-XY LIST 0
BEGIN !XY KEY SWAP ?CH SWAP 27 = UNTIL DROP L ;
\ ==============================================================
--
Bill Muench
Santa Cruz, California
That would make for a good quick example for using the EKEY>FKEY
extension.
I like this set of Wordstar compatible commands:
No function key works, only control keys.
Normal keys insert/overwrite.
^V Toggle insert/overwrite mode.
^E ^S ^D ^X <Enter> <Tab> : Cursor up left right down. Next line. Tab.
^A ^F : Cursor word left, right.
^G ^T ^Y : Delete char, word, line.
^Z ^U : Undelete word, line.
^W ^P : Undelete word and pop. Undelete line and pop.
^J ^O : Join lines, Open (split) line.
ESC Q / ESC q : quit (abondon edit and do not update.)
ESC x (or whatever, not q): exit editing, save and update.
Word and line deletes stack up at the bottom of the screen.
^P and ^W pop this stack.
In all other case the last deleted item remains available for
multiple undeletes.
The stack of deletions allow to easily reorder 2 or 3 lines,
or words. Or move lines to the next block.
Very convenient for minor and even larger modifications for
a block.
>Bill Muench
Groetjes Albert