hello,
did anyone have wrote a specific document about optimization & good
practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I >wonder continue my learning :) & rewrite a better way my current
trainning codes.
I'm also interested if you have such references as books too :) even I
have already many beginners books.
regards.
hello,
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
hello,
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
regards.
gobli...@gmail.com schrieb am Samstag, 5. August 2023 um 11:11:11 UTC+2:
hello,
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
I guess you have gone through Leo Brodie's two classic books.
Thereafter it really depends on your optimisation goal. For instance
- execution speed
- least memory footprint
- least burnt milliwatts embedded
- most concise source code
- ease of maintenance in a team
For the first three: know your hardware!
This does not answer your question, but might explain why there are not
many generic reference papers around. Although not for Forth, but for assembler and C,
I found Agner Fog's papers on optimization very helpful: https://www.agner.org/optimize/
On 6/08/2023 12:07 am, minforth wrote:
gobli...@gmail.com schrieb am Samstag, 5. August 2023 um 11:11:11 UTC+2:
hello,
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
I guess you have gone through Leo Brodie's two classic books.
Thereafter it really depends on your optimisation goal. For instance
- execution speed
- least memory footprint
- least burnt milliwatts embedded
- most concise source code
- ease of maintenance in a team
For the first three: know your hardware!
This does not answer your question, but might explain why there are not many generic reference papers around. Although not for Forth, but for assembler and C,Following that link I found myself at the MASM website browsing the following page:
I found Agner Fog's papers on optimization very helpful: https://www.agner.org/optimize/
https://www.masm32.com/why.htm
Reading the third paragraph and substituting each occurrence of "MASM" with "FORTH",
it struck me as something Moore might say. His 'no compromise' stance is legend.
MASM users knowing what they're about simply say 'not for the faint hearted'. No
mention of ease of maintenance in a team as a goal at all. Perhaps it's Forth that
has lost its way.
dxforth schrieb am Samstag, 5. August 2023 um 19:20:48 UTC+2:
On 6/08/2023 12:07 am, minforth wrote:
gobli...@gmail.com schrieb am Samstag, 5. August 2023 um 11:11:11 UTC+2: >>>> hello,Following that link I found myself at the MASM website browsing the following page:
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
I guess you have gone through Leo Brodie's two classic books.
Thereafter it really depends on your optimisation goal. For instance
- execution speed
- least memory footprint
- least burnt milliwatts embedded
- most concise source code
- ease of maintenance in a team
For the first three: know your hardware!
This does not answer your question, but might explain why there are not
many generic reference papers around. Although not for Forth, but for assembler and C,
I found Agner Fog's papers on optimization very helpful:
https://www.agner.org/optimize/
https://www.masm32.com/why.htm
Reading the third paragraph and substituting each occurrence of "MASM" with "FORTH",
it struck me as something Moore might say. His 'no compromise' stance is legend.
MASM users knowing what they're about simply say 'not for the faint hearted'. No
mention of ease of maintenance in a team as a goal at all. Perhaps it's Forth that
has lost its way.
You are right in that "ease of maintenance" is of little importance in one-man software
shows, eg like Forth hobbyist projects, or for assembly trick programming nerds.
For industrial applications "ease of maintenance" has a quite different impact. Imagine
MCUs running for years somewhere on the globe. The paying customer wants some software troubleshooting or update with minimal downtime. Now put yourself in the shoes
of the service engineer who has to go there...
On Saturday, August 5, 2023 at 5:11:11 AM UTC-4, gobli...@gmail.com wrote:
hello,
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
regards.
Not sure what you mean by optimizing. It could mean an optimizing compiler but it could also
mean how to write more efficient Forth code.
On the latter issue there is a strange aspect of Forth that is more akin to a CPU instruction set.
By that I mean there are hundreds of these little code snippets and they can be used in ways
that are not always obvious.
did anyone have wrote a specific document about optimization & good practice or tips in forth ? or have good links about that to provide ?
I'm still learning & have access to I think all "well known" sites but I wonder continue my learning :) & rewrite a better way my current trainning codes.
I'm also interested if you have such references as books too :) even I have already many beginners books.
regards.
On 6/08/2023 5:02 am, minforth wrote:
On Saturday, August 5, 2023 at 11:42:07 PM UTC-5, dxforth wrote:
On 6/08/2023 5:02 am, minforth wrote:
Never was an optimizing Nazi but always pursued
tricks of the trade e.g. xor register to itself
instead of moving zero into it. But after Hans
remark about bad style using flag as a mask and
previous comments of Albert about 'premature
optimization' it finally sunk in. Old habits
are too ingrained to completely give but now
strive to write straight code rather than some
peep-hole optimization. Just assume if someone
wants it optimized, they can run it through some
one's optimizing compiler. Or if in a speed bind
somewhere then sure attack it.
In any code one writes there will be opportunities to optimize.
On Monday, August 7, 2023 at 5:23:06 AM UTC-5, dxforth wrote:
In any code one writes there will be opportunities to optimize.
Optimized for which processor? A general optimization
perhaps, but wouldn't that be "premature".
Some months back someone published a nice math library.
All the code was straight Forth code, most words
short and sweet. There were no "AND TRUE"s to avoid
IF statements or other such common Forth idiosyncrasy.
I thought it good clear logic; no need to muddle with
optimization until optimization is needed.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (3 / 13) |
Uptime: | 42:50:51 |
Calls: | 6,709 |
Calls today: | 2 |
Files: | 12,243 |
Messages: | 5,353,935 |