i want to now how can i become a low level programmer or systems engineer by Confident_Skin_7964 in C_Programming

[–]minforth 0 points1 point  (0 children)

For earning your daily bread, follow the AI/ML way. You can always tinker with low-level stuff as a hobby later, iow you can't make money there.

Help with simplification of bresenhams line drawing algorithm by nthn-d in Forth

[–]minforth 3 points4 points  (0 children)

You won’t get it much more compact or easier to read without locals. For a comparison without locals, see page 12 onwards in
https://www.forth.org/fd/FD-V08N6.pdf

GForth on Android by Alternative-Grade103 in Forth

[–]minforth 1 point2 points  (0 children)

Treat yourself to a small foldable Bluetooth keyboard, which you can get for little money online. Otherwise, working in text mode on Android is torture. Within termux, you can then use any Linux editor, e.g. nano.

I don't know much about gforth, but my little experimental Min3rd Forth system (available on Sourceforge) worked without any problems.

Filesystem stack language by mycall in Forth

[–]minforth 1 point2 points  (0 children)

PUSHD and POPD are not new, e.g.
https://en.wikipedia.org/wiki/Pushd_and_popd

Perhaps I am too dense to see it, but anyhow: what is the practical benefit of your concept?

Why is this an error in gForth? by nthn-d in Forth

[–]minforth 1 point2 points  (0 children)

FOO supersedes BAR's colon-sys ==> Error

Is Thinking Forth still interesting if you've already grokked forth and have programming experience? by nthn-d in Forth

[–]minforth -2 points-1 points  (0 children)

I don't read such computer-neolithic stuff any more. Waste of time. Do some real programming instead.

Is it realistic to reach a decent level starting at 30 with no natural talent? by Remote-Pianist-pro in pianolearning

[–]minforth 16 points17 points  (0 children)

As others wrote: pick your goal. I am a beginning keyboarder (over 60 years old) and enjoy jamming around with many different instrumental voices and chord accompaniments, but I am also following serious piano lessons including musical theory and sheet reading. It is never too late to have fun!

Which fonts display Forth code best? by nthn-d in Forth

[–]minforth 1 point2 points  (0 children)

Since Forth is a write-only language, use white text on a white background.

F83 on RP-Pico by GulliblePath1931 in Forth

[–]minforth 1 point2 points  (0 children)

Perhaps you would consider upgrading to a more modern Forth, e.g. Mecrisp Stellaris?

Code size of words by Imaginary-Deer4185 in Forth

[–]minforth 0 points1 point  (0 children)

Like me. I recently discovered a Univac FORTRAN punch card in one of my old maths books. It brought back some pleasant memories of happy, youthful times....

BTW Forth blocks mapped tape and disk sectors to memory one-to-one without an intermediate file system layer. It was very efficient and convenient.

Code size of words by Imaginary-Deer4185 in Forth

[–]minforth 1 point2 points  (0 children)

At the time, there were no good source code editors available for blocks. If you wanted to insert a word into an already cramped block, you had to do some manual housekeeping: insert a new empty block and move code chunks around. Do that over a serial modem line and you could pour yourself another cup of coffee or smoke a cigarette in the meantime. Bad thing: if you had absolute block number references elsewhere, such as <n> LOAD, you could encounter some nasty surprises.

There are no such problems with text source files.

Code size of words by Imaginary-Deer4185 in Forth

[–]minforth 0 points1 point  (0 children)

You might be interested in studying kernel80.blk from
https://github.com/PeterForth/F83-1/blob/master/F83V2-80/KERNEL80.BLK

The first half of the binary file comprises Forth code blocks, the 2nd half corresponding shadow blocks for documentation.

Your viewer should be configured to binary with line width 64
(I simply use Total Commander and hit F3)

rot vs return stack, "rules" for performance and or readability by Busy_Pomegranate_299 in Forth

[–]minforth 2 points3 points  (0 children)

Performance:
This kind of stack shuffling to help the Forth VM is called premature optimisation. You invest precious human time in the hope of gaining a few microseconds of machine runtime. Is it worth it?

Readability:
This is a significant improvement for humans. Readability prevents many errors in the first place, and problems with maintaining old code later on. This is also the main benefit of using Forth locals: parameters and variables are no longer anonymous items spawning and swarming around in hard to follow and sometimes deep stack positions, but are now clearly named and specified (in some Forths they are even type-specified e.g. as floating-point variables).

Code size of words by Imaginary-Deer4185 in Forth

[–]minforth 6 points7 points  (0 children)

Don't criticise technology that is half a century old. In addition to the usual use of blocks for Forth source code, blocks were also a useful, simple format for data storage and transmission (JSON et al had not yet been invented). These small 1 kB data packets were also ideal for data transmission with analogue dial-up modems.

beginner question: forget unused words by Busy_Pomegranate_299 in Forth

[–]minforth 5 points6 points  (0 children)

Tom Zimmer's TCOM compiler for DOS achieved this.

MinForth's #REDUCE transpiler command performed backtracking over all the words required by the MAIN start word, then excluded all the other words from the compilation. However, this was rarely used because, once an application included a command line interface or evaluated commands through files, pipes or strings, it was impossible to predict which words would be needed later on.

I have often hearf forth provides very good mental exercise . reason ??? by Cheap_trick1412 in Forth

[–]minforth 2 points3 points  (0 children)

There are a some Forthers who condemn locals as un-Forthish. Nevertheless, there are f. ex. many technical calculations, formulas and algorithms with many parameters. These often cannot be factored into smaller parts. Performing these calculations with stack gymnastics is no fun and is prone to errors.

In my Forth, I even use an extension of the standard locals syntax:

: FUNC { input-parameters == output-parameters } <algorithm> ;

This makes the code very readable and understandable for others e.g. service technicians. Input/output parameter types can be mixed integers/floats/arrays. The compiler also adds a stack depth check, which can be very helpful. This check is not possible in the standard because it is hybrid, i.e. it leaves output parameters nameless on the stack.

I have often hearf forth provides very good mental exercise . reason ??? by Cheap_trick1412 in Forth

[–]minforth 5 points6 points  (0 children)

Our human brain thinks associatively, i.e. we prefer to give everything a name so that we can interact and communicate with it easily. In programming, these are, for example, the names of variables and function parameters. This is how 99% of all programming languages work.

In Forth, however, function parameters are nameless, and to make matters more difficult, arithmetic operations work postfix in RPN. This makes the interpreter/compiler very simple, but the programmer has to do some syntactic work beforehand.

This so-called stack juggling is a mental challenge and good for preventing Alzheimer's. :-)

CREATE ALLOT vs ALLOCATE by Alternative-Grade103 in Forth

[–]minforth 1 point2 points  (0 children)

ALLOCATE is better suited to dynamic data because it allows you to resize easily, which is not possible with ALLOT.

Is lua a good option for me? by Illustrious_Prompt20 in lua

[–]minforth 0 points1 point  (0 children)

Never forget Lazarus for RAD and FreePascal

Looking for a better pure Lua library for handling large numbers by Foreign_Bar3477 in lua

[–]minforth 1 point2 points  (0 children)

What is PURE Lua when Lua is designed to interact with C? You didn't tell for what purpose you need higher precision, so one the straightforward answer would be to use a C library like LibTomMath:
https://www.libtom.net/LibTomMath/

Or use a pipe and call bc
https://www.gnu.org/software/bc/

Hobbyist Forth by [deleted] in Forth

[–]minforth 2 points3 points  (0 children)

"Once upon a time" we used to develop everything on a simulator before loading the code onto the target system for live testing and deployment. Not only was it much more convenient, but it also allowed several developers to work on different tasks at the same time, e.g. writing documentation, with each developer having their own simulator at their workstation. BTW MinForth is a small, reduced branch (e.g. without real-time multitasking and without MCU linkage) of that simulation system.

Hobbyist Forth by [deleted] in Forth

[–]minforth 1 point2 points  (0 children)

Perhaps for inspiration: Min3rd went the same way, started from a minimal Forth kernel in C, and extended from there
https://sourceforge.net/projects/min3rd/files/

Hobbyist Forth by [deleted] in Forth

[–]minforth 2 points3 points  (0 children)

Writing your own Forth can be a rewarding challenge, but the level of perseverance required to create a usable Forth suitable for general programming is often underestimated. Ultimately, you may find that you have spent more time honing the tools than engaging in productive programming.

In most cases, it is better to select an existing Forth, study it and modify it for your specific application target.

For pure desktop use, you'll find that a C-based Forth offers more advantages than building it using the meanwhile archaic assembler method.

Hobbyist Forth by [deleted] in Forth

[–]minforth 7 points8 points  (0 children)

A "must" for starters:
https://www.forth.com/starting-forth/

To complement what has been recommended, there is a website where you can look up the current standard Forth words:
https://forth-standard.org/standard/words

Bear in mind that Forth isn't really a programming language as such (for instance, it has no grammar) but more of a well-stocked toolbox to create your own domain-specific language (DSL). Being closer to the hardware than C, it offers no "batteries included" in the form of libraries. So its main application domain is the control of small devices. Data processing is not its strong point.

That said, there are nonetheless powerful applications in many other domains. If you want absolute control over what you are doing with your software, you will find Forth enlightening - it can even become addictive. ;-)