Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: Cweed4v04

116 views
Skip to first unread message

Howerd Oakford

unread,
Jan 14, 2022, 1:53:48 PM1/14/22
to
Hi Forthers,

I have just updated Cweed4 to V4.04 available here :

https://www.inventio.co.uk/Cweedexe.htm

Enjoy
Howerd :-)

Rick C

unread,
Jan 14, 2022, 8:20:09 PM1/14/22
to
How is this different from the many pretty print programs around? Or do I not understand what it is doing?

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

dxforth

unread,
Jan 15, 2022, 12:40:17 AM1/15/22
to
On 15/01/2022 12:20, Rick C wrote:
> On Friday, January 14, 2022 at 1:53:48 PM UTC-5, Howerd wrote:
>> Hi Forthers,
>>
>> I have just updated Cweed4 to V4.04 available here :
>>
>> https://www.inventio.co.uk/Cweedexe.htm
>>
>> Enjoy
>> Howerd :-)
>
> How is this different from the many pretty print programs around? Or do I not understand what it is doing?
>

It would have been Forth source formatter had there been a standard for that :)

Jurgen Pitaske

unread,
Jan 15, 2022, 2:35:11 AM1/15/22
to
Cweed4.exe
Cweed4 is a C source file weeder for Windows, written in Win32Forth.
It only changes whitespace (formatting) and does not otherwise change the content of the file.
This is analogous to weeding a garden, where the plants are left untouched but the bits between (weeds) may be seriously modified.
Cweed is an experiment in specifying a coding standard in the form of an executable program.
cweed4v04.7z 2022 Jan 14
To run Cweed4, download the 7z file, unzip it and run go.bat or Cweed4.exe
It is designed only to modify whitespace, but please make a backup before using.
https://www.inventio.co.uk/Cweedexe.htm

Howerd Oakford

unread,
Jan 17, 2022, 3:55:12 AM1/17/22
to
Am 15/01/2022 um 02:20 schrieb Rick C:
> On Friday, January 14, 2022 at 1:53:48 PM UTC-5, Howerd wrote:
>> Hi Forthers,
>>
>> I have just updated Cweed4 to V4.04 available here :
>>
>> https://www.inventio.co.uk/Cweedexe.htm
>>
>> Enjoy
>> Howerd :-)
>
> How is this different from the many pretty print programs around? Or do I not understand what it is doing?
>
Hi Rick,

I think it is the only one written in Forth.

The other differences are probably (i.e. without looking at all the
other Open Source ones available) :
1. Programmable by a run-time loaded Forth script file.
2. Supports Barr 2018 Coding standard white space rules (not 100%, but
to a useful extent).
3. Checks for Lint command violations.
4. Creates a report of violations and information in all sub-folders.
5. Converts and old-school Forth Block file into text file (ctrlR).
6. Displays the CRC32 MD5 and NumName for each file.

The "NumName" is a pair of English words derived from 30 bits of the MD5
hash of the file. NumName is a horribly ugly creation, but I find it too
useful to delete it and pretend it never happened. It is ugly because it
produces two English words while completely ignoring their meaning. YMMV.

Basically, Cweed4 is an experiment in specifying a coding standard as an
executable program.
The history is that every time I have a needed to modify a C/C++ file,
or folder of files, according to some coding standard (every company
seems to have their own) I tack some more code on to Cweed4.

The Cweed4 distribution comes complete with Win32Forth V6.03H (the
latest anti-virus-friendly version), including *all* source files, so
you can modify and rebuild *everything* (although the Kernel requires VS
2006 to rebuild it).

Cweed4 is also great if you want to understand the C language syntax.

Cheers,
Howerd




Howerd Oakford

unread,
Jan 17, 2022, 3:59:43 AM1/17/22
to
Hi dxforth,

You can use Cweed4 on a Forth file to convert tabs to spaces, removing
trailing whitespace etc. etc.
Not sure that Barr 2018 and Lint would be very useful though, and the
formatting could be interesting...

Stephen Pelc has created an MPE coding standard for Forth -
I did think about doing an Fweed4, but colorForth has already solved
that problem ;-)

Cheers,
Howerd

dxforth

unread,
Jan 17, 2022, 5:31:43 AM1/17/22
to
It went downhill for Forth once it was decided the comment line could
occupy the body of a definition. It equates to putting adverts in the
middle of TV program. Does wonders for the continuity. Forth hard to
read? Let's make it harder :)

Howerd Oakford

unread,
Jan 18, 2022, 11:40:26 AM1/18/22
to
Hi dxforth,

That is an interesting take on comments in the body of a definition - I
think I agree.

In my regular job at the moment, we are adding a comment line before
almost every line of C code - something like :
// add one to the variable x
x++;
This is so when the code is converted to a flow chart the comment lines
appear in the boxes.

I always liked the shadow block approach - 'Q' or '*' to toggle between
the two. This makes it simple to either read the code, or read the
comments. Is this what you mean?

Cheers,
Howerd


0 new messages