🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.comp.lang.forth
Article #1

hybrid c/Forth program

#1
From: albert albert
Date: Tue, 23 May 2023 10:57
31 lines
2041 bytes
I have an programmable editor that could benefit of rewritten in Forth.
At present it is written in c.
Coupling a function to <ESC>A]  is remembering the key in a structure
and a word that is defined as example
   cup cup cup cup
that moves the cursor up 4 times.
It is almost
: <ESC>A] cup cup cup cup ;

The idea is to couple a Forth with it and migrate piecemeal functions
to Forth with it.
Forth would have to known only a few  datastructures and then be able to
perform already a lot of functions.
For example knowing the descriptor structure of a file to be edited
it could move the cursor up by
: cup     -1 CURRENTFILE @ files[] @ ->currentline +! ;
where CURRENTFILE files are imported from c.

As soon as all functions pertaining to e.g. CURRENTFILE are moved,
CURRENTFILE is defined within the forth area and deleted from c.
In the end only coupling to an X-system library remains, and migrated
to dynamic library calls.

Has this been done or tried before? Any ideas whether this is feasible?

Groetjes Albert
-- 
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning.            - the Wise from Antrim -
Technical Details
Message-ID: <nnd$0f9a89c9$29870a6f@aad474fe67b6304d>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <nnd$0f9a89c9$29870a6f@aad474fe67b6304d>
Subject: hybrid c/Forth program
Date: Tue, 23 May 2023 12:57:05 +0200
From: albert@cherry.(none) (albert)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
Newsgroups: fj.comp.lang.forth
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: albert@cherry.(none) (albert)
Organization: KPN B.V.
Lines: 32
Injection-Date: Tue, 23 May 2023 12:57:05 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1876