With respect to the coding and debugging aspect, there are
currently many "folding" and "workspace" based editors available
(my editor of choice can't do "folding" yet). Is there experience
with using such features advantageously for Forth?
I am thinking of introducing *.finc (forth include) files
alongside the existing *.frt ones.
It is also possible to write a plugin for Visual Studio (or maybe
an exiting one is good enough for Forth). It will be vast overkill
and some may frown on the MS dependency. Are there equivalent open
source projects that I should consider?
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs. These
global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also prevent me
from documenting sub-tools, and giving such tools their own help words ...
I have seen some of my students use folding for Forth code in VS Code.
I found it annoying to have to ask the students to unfold the folded
parts, but that may just be the presentation situation. Emacs (my
favourite editor) supports folding, but I have not used it. I don't
miss it, but I did not miss the Forth-GUI stuff (LOCATE etc.) before
we had it and I used it, so maybe I would find it useful after using
it for a while.
I am thinking of introducing *.finc (forth include) files
alongside the existing *.frt ones.
Standard Forth has INCLUDED, INCLUDE, REQUIRED and REQUIRE intended to include Forth source code. What's the difference between .finc and
..frt (or .4th)?
Do I understand correctly that you have not used INCLUDED etc. inside
Forth source files?
It is also possible to write a plugin for Visual Studio (or maybe
an exiting one is good enough for Forth). It will be vast overkill
and some may frown on the MS dependency. Are there equivalent open
source projects that I should consider?
Visual Studio Code is open source; Wikipedia says that its developer
is Microsoft, so some may frown.
As mentioned, I use Emacs (free), some students use vi/vim;
On 3/23/24 04:30, mhx wrote:...
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
I've used the modular programming[1] approach successfully to write and maintain Forth applications which are composed of thousands of lines of
Forth source, but each module is logically separate, and, in a few
instances, relies on externally declared global data.
--
Krishna
Ref.
1.
https://github.com/mynenik/kForth-Win32/blob/master/doc/modular-forth.pdf
On 23/03/2024 8:30 pm, mhx wrote:
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs. These global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also prevent me from documenting sub-tools, and giving such tools their own help words [ The main application now has lots of help
text that is not relevant for a user interested in working with
only one of the specific tools. ]
I recall Elizabeth saying that (circumstances allowing) Chuck would write
as many as three versions of an application, each successively better.
So when are you going to start Version 2?
On 23-03-2024 10:30, mhx wrote:
My current project has 13,938 lines of code (and documentation).I can't feel with you, since my largest programs are 2 KLOC. Still, I
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs. These
global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also prevent me
from documenting sub-tools, and giving such tools their own help words [
The main application now has lots of help
text that is not relevant for a user interested in working with
only one of the specific tools. ]
With respect to the coding and debugging aspect, there are
currently many "folding" and "workspace" based editors available
(my editor of choice can't do "folding" yet). Is there experience
with using such features advantageously for Forth?
have no problem managing them.
Although I don't particularly like OOP, in this case such an approach
might be the way. Arrange your program along certain modules and only
take up the interaction between these modules in your main program - or >arrange them in a way you can separate those dependencies.
I know this might be hard to establish afterward.. But it helped me in
the past. When I added strings to uBasic/4tH I designed that entire
module in separation (all variables included) so it was just a "drop in" >module. I could still lift it out without any problems, I guess.
But 13,938 lines - that's a hellovalot of code..
Hans Bezemer
On 3/23/24 04:30, mhx wrote:
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs. These
global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also prevent me
from documenting sub-tools, and giving such tools their own help words ...
Without seeing the code, I probably can't say much about how to separate
it into multiple files, each a logical unit.
Global data by itself shouldn't prevent you from separating the code
into multiple files. The files have external data dependency which can
be documented at the top of the code.
I've used the modular programming[1] approach successfully to write and >maintain Forth applications which are composed of thousands of lines of
Forth source, but each module is logically separate, and, in a few
instances, relies on externally declared global data.
--
Krishna
Ref.
1. https://github.com/mynenik/kForth-Win32/blob/master/doc/modular-forth.pdf
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs.
These global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also
prevent me from documenting sub-tools, and giving such tools
their own help words [ The main application now has lots of help
text that is not relevant for a user interested in working with
only one of the specific tools. ]
With respect to the coding and debugging aspect, there are
currently many "folding" and "workspace" based editors available
(my editor of choice can't do "folding" yet). Is there experience
with using such features advantageously for Forth?
I am thinking of introducing *.finc (forth include) files
alongside the existing *.frt ones. One of them will hold
all (?) the variables needed by all (?) of the subtools.
This will waste data space in some cases. A *.finc file is
loaded at an arbitrary spot inside the calling subtool(s).
I remember that long ago people were developing project management
tool in Win32forth ('Scintilla?') Did this go anywhere? Win32forth
seems to be as dead as a doornail and I am not even sure where to
get a decent source distribution of its tools?
It is also possible to write a plugin for Visual Studio (or maybe
an exiting one is good enough for Forth). It will be vast overkill
and some may frown on the MS dependency. Are there equivalent open
source projects that I should consider?
On 23/03/2024 8:30 pm, mhx wrote:
My current project has 13,938 lines of code (and documentation).
That is too large to keep every detail of it in my head.
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs. These global variables prevent me from dividing the application
up into smaller programs that can run standalone. They also prevent me from documenting sub-tools, and giving such tools their own help words [ The main application now has lots of help
text that is not relevant for a user interested in working with
only one of the specific tools. ]
I recall Elizabeth saying that (circumstances allowing) Chuck would write
as many as three versions of an application, each successively better.
So when are you going to start Version 2?
On 23 Mar 2024 at 10:30:31 CET, "mhx" <mhx> wrote:<SNIP>
1) Make the problem repeatable. This usually involves(-; I worked in train software. Repeating train crashes is not
finding out which inputs cause the problem.
2) Gather data about the problem. Observation is crucial,This is vital is the problem occurs once in a blue moon.
so take this stage slowly and carefully. I have seen people
immediately dismiss exception displays and crash-dumps
which contain vital clues.
Programmers are very rarely taught how to debug. The
problems they face are almost always in their source code.
So why don't they read it more carefully? In particular, why
don't they write a line or two describing the whats and whys
of of a routine before they write the code? The poor relation
who maintains your code for the next 10 years costs your
employer a fortune because you could not be bothered.
As a sidenote to this potential rant, my company has been
using literate programming for 10 years and we believe
that it has increased the quality of our code. Whenever
we incorporate third-pary code into our code bases we
document it to our house standards. This process nearly
always reveals bugs. To produce stable software the golden
rule is to fix the bugs first.
Sorry, that turned into something of a diatribe, but the importance
of project management and debugging is one of my buttons.
Stephen--
My current project has 13,938 lines of code (and documentation).
The reason to not factor it in a number of smaller files is that
there are many (unavoidable) global variables and data blobs.
These global variables prevent me from dividing the application up
into smaller programs that can run standalone.
With respect to the coding and debugging aspect, there are
currently many "folding" and "workspace" based editors available
I remember that long ago people were developing project management
tool in Win32forth ('Scintilla?')
It is also possible to write a plugin for Visual Studio (or maybe
an exiting one is good enough for Forth). It will be vast overkill
and some may frown on the MS dependency.
On 25/03/2024 9:07 am, Paul Rubin wrote:
mhx@iae.nl (mhx) writes:
...
I remember that long ago people were developing project management
tool in Win32forth ('Scintilla?')
Project management, what does that even mean? Everyone uses github
these days, even though it is in many ways terrible.
I'd never use github. It's 'reality show' for programmers :)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 24:47:09 |
Calls: | 9,488 |
Calls today: | 7 |
Files: | 13,617 |
Messages: | 6,121,109 |