Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some doco typos, non-updated stuff and add clarity #36

Closed
RigTig opened this issue Jun 16, 2017 · 4 comments
Closed

Clean up some doco typos, non-updated stuff and add clarity #36

RigTig opened this issue Jun 16, 2017 · 4 comments
Assignees

Comments

@RigTig
Copy link
Collaborator

RigTig commented Jun 16, 2017

In working through the forth.asm, I have found numerous comments and bits of documentation that are useful and relevant. Occasionally, I found some to have typographical errors, and some comments to be not very helpful. None of the following save any bytes, nor runtime, but they might just save a user or reader a little angst trying to figure it out.

  1. In forth.asm and in each globinf.inc, the line regarding WORDS_LINKCHAR needs to have the following two words added: PAD $"
  2. In forth.asm and in each globinf.inc, the line regarding WORDS_LINKMISC, is better to drop mention of words SEE DUMP WORDS, so the comment reads '; Link composing words >CHAR _TYPE dm+ .ID >NAME
  3. In forth.asm and in each globinf.inc, the line regarding WORDS_LINKRUNTI needs to have the following three words added: (+loop) $"| ."|
  4. In forth.asm and in each globinf.inc, the line regarding WORDS_LINKCOMP needs to have the following three words removed: last $"| ."| and the following two words added: ?UNIQUE $COMPILE
  5. In forth.asm and in each globinf.inc, the line regarding WORDS_LINKINTER needs to have the following five words removed: tmp eval NAME> INTER? $COMPILE and the following eight words added: 'eval TIB 'PROMPT EXTRACT PARSE CUPPER NAME? ^h. Since the list is so long, I suggest sorting into alphabetical sequence.
  6. In forth.asm and in each globinf.inc, the line regarding WORDS_EXTRADEBUG needs to have the following word removed: SEE and the following word added: >NAME
  7. In forth.asm and in each globinf.inc, the line regarding WORDS_EXTRACORE needs to have the typo =0 changed to 0=
  8. For ACCEPT, it is not obvious that the buffer is a line buffer rather than a stream buffer. Recommend change description comment to:
;       Accept one line of characters to input
;       buffer. Return with actual count.

You can confirm the line buffer nature of TIB by looking at the behaviour of such words as \ . Knowing what kind of buffer is important to us for dumping stuff into that buffer other than by serial character input.
9. For QUERY, it is not obvious that the buffer is a line buffer rather than a stream buffer. Recommend change description comment to:

;       Accept one line from input stream to
;       terminal input buffer.

End of list for now. These have been found over the past couple of weeks. If I find more, than I'll raise as new issue.

@TG9541 TG9541 self-assigned this Jun 16, 2017
@TG9541
Copy link
Owner

TG9541 commented Jun 16, 2017

For sure there are many typos in comments and docs, and I'm happy that native English speakers now provide corrections (or as some of my Indian colleagues would say: "please do the needful").
As for the costs of copy-and-paste, I'd like to propose removing the word lists from all globconf.inc files (the lists in forth.asm are easier to track).

TG9541 added a commit that referenced this issue Jun 16, 2017
@TG9541
Copy link
Owner

TG9541 commented Jun 16, 2017

I just committed changes to forth.asm.

Sorting a list of words can be done with the following line:

cat | gawk 'BEGIN {RS=" "} 1' | sort | uniq -u | gawk '{a = a " " $0} END {print a}'

I'm looking into how to best clean up the globconf.inc mess.

TG9541 added a commit that referenced this issue Jun 16, 2017
TG9541 added a commit that referenced this issue Jun 16, 2017
@TG9541 TG9541 mentioned this issue Jun 16, 2017
@RigTig
Copy link
Collaborator Author

RigTig commented Jun 16, 2017

Cutting and dicing the forth.asm cake with the increasing number of platforms and options is becoming a bit of a nightmare. I was (and still am) impressed that so many variations on a theme could be handled at all. My suggestion at this time is to leave the hardware-specific options in the current globinf.inc files and have all the 'personal preference' options either only in forth.asm, or in a .inc file in the topmost folder with forth.asm. My preference is another .inc file, so that changes to forth.asm are for corrections, updates, etc.

I suggest that we need to look at reducing the number of options. One way I can think of is to put the changes in as eForth code, even allowing for redefinitions. Most of the time, the extra space taken up is not a project-breaker issue. If it does get to be critical for space, perhaps that is the time to just cut back to core, and add what the project needs. Or, the developer can edit the forth.asm to get just what they need at flash time.

Even Dr. Ting has typos, and transcription errors are a part of normal life for programmers and documenters. I am pleased that I can help at all. I still reckon it is fun when I get that 'Aha' moment when clarity appears in the mist of confusion.

I must sadly admit that I have only one language, and that comes with Australian idioms. For example, in one earlier comment, I found that I had written that I was 'dragging the chain' before I edited it out. It means being slow and lacking energy, and derives from the practice that convicts with a ball and chain were supposed to carry their ball and chain when they were on the move, but a tired and worn-out prisoner might just let the chain drag on the ground.

@TG9541
Copy link
Owner

TG9541 commented Jun 16, 2017

I guess you're right: the forth core, and higher words should be split in at least two files. A criteria might be "what can be done in barebones.fs isn't core" but OR is where I draw the line ;-). I think that this also would facilitate an ITC implementation .

Selecting features on a "per project" basis is a good idea. I've been thinking of writing an automated "Build-a-Forth" service. With the help of Docker containers the security aspects should be manageable.

And finally (off topic): learning languages is a life-long journey for 2nd language speakers, and sometimes it does strange things to your first language.It's an experience I wouldn't want to miss (it actually has some similarities to learning Forth).

hexagon5un pushed a commit to hexagon5un/stm8ef that referenced this issue Jul 6, 2017
* upstream/master: (30 commits)
  Glossary updated, prepare release
  >NAME was included by default
  Optimize STC code of M* and M/MOD, see comment to c4f64b6
  issue TG9541#36: comments in forth.asm
  issue TG9541#36: comments in forth.asm
  New option BOOTSTRAP, corrections BAREBONES and UNLINKCORE
  Create forth.asm
  fixes TG9541#27 COMPILE handles CALLR incorrectly
  remove $¨| (even in the eForth source it's unclear what it does)
  fixes TG9541#34 incorrect description in glossary
  Use relative addressing some more (tested with MAXDEV)
  make USE_CALLDOLIT less broken (it still is)
  Move barebones files into own directory
  remove bad/unused words; updates 4 barebones
  Catch up with changes in TG9541/master
  Another tool moved into tools folder
  Put useful tool into tools folder
  First cut at TCP-based file loader
  issue TG9541#32: start building  infrastructure
  for headerless mode use UNLINKCORE instead of BAREBONES
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants