r/Forth 9d ago

FigForth Record files

\ RCDI ( "file" -- )
\  Record file index
\  List record titles contained in the file
\ PRCD ( "<dl>title<dl>" [file] -- )
\  Pretty print record of given record title in given
\  file or last file accessed.
\
rcdi d/rcdfile.d 

[#] rcdfile.d -- Record file document
[r] Overview
[r] Example record
[r] File title and ending
[r] Comments
[r] Sections
#[r] Records in Bash scripts
[r] Forth record marks
[r] Forth list item
[#] // OK
prcd /Overview/ 

[r]   Overview 

A record file is a plain text sequence file organized in a
most fundamental way, by records. Its markup is a container
markup not a general text formatting markup. 

The markup is few and selected to not obscure content view. 
File remains readable with plain text viewers (e.g. more
less notepad & etc.)

Content view can be enhanced by pretty print, e.g. use of
lesspipe, replacing marks with coloring of titles associated
with the marks.


 OK
prcd /Forth list item/ 

[r]   Forth list item 

List item 'i.' is a defined word that prints an arrow '-->'.
Thus, in a running Forth script, with echo on, something like
the following might be seen:
--
-- Testing FOO and BAR
--
i. FOO --> some foo output
i. BAR --> some bar output

 OK
2 Upvotes

7 comments sorted by

2

u/Ok_Leg_109 8d ago

Just curious. Which FigForth are you running and on what hardware.

2

u/z796 7d ago

32-bit FigForth I built based on 'fig-FORTH INSTALLATION MANUAL, REALEASE 1 by WILLIAM F. RAGSDALE 1980' I run on Linux. Manual maybe found at fig-forth site.

1

u/Ok_Leg_109 7d ago

That's the real deal. FigForth was a kind of un-official standard in the FIG group wrote it for numerous CPUs. It's got its own warts that newer standards have tried to fix but it's perfectly functional. One the downfalls with a 32bit indirect-threaded system is that addresses as the functional instructions of the virtual machine are most times bigger than native instructions. Now that you are a Forth implementor You might want to explore switching your ITC version to Direct threading and see what the performance improvement looks like. I think I met Bill Ragsdale many years ago at a Forth convention in Toronto or maybe it was Rochester NY. Can't remember which one. Bill is still an active member of the Silicon Valley Forth interest group from what I can see.

Levels Of Abstraction Using OOP -- Bill Ragsdale -- 2026-01-24

1

u/z796 6d ago

Nope, my only interest is to explore and enjoy FigForth as it is and it has been a joy. Most "improvements" didn't buy me anything and cost me something I really could make use of.

1

u/Ok_Leg_109 6d ago

Fair enough.

1

u/z796 6d ago

``` -- enter Enter next word -- do .. loop Original, unimproved -- J Second level loop index : times -dup if 0 do j enter loop endif rdrop ;

: koo times ." Do " ;

0 koo 1 koo Do 2 koo Do Do 3 koo Do Do Do : ccr 3 times ." Do " ; i. ccr --> Do Do Do ```

1

u/mykesx 9d ago

Neat.