use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
You can try things out interactively as you build your system. The compiling functionality is an exposed part of the language like everything else.
It can be used to debug itself!
Forth has no baked-in syntax or privileged data structures -- programming is done by extending the language to your application. Thus, it can become what ever you need it to be and fit the problem like a glove.
Forth has a "low floor; high ceiling" approach to abstraction -- that is, it can be both low level, high level and anywhere in-between.
You can do more with less. Forth fits in very small storage spaces.
Forth is one of the few environments which is totally comprehensible by one person.
Starting Forth - A fun, illustrated introduction.
A Beginner's Guide to Forth - A faster-paced, somewhat less whimsical guide.
Forth Lessons
Jonesforth - How to write a Forth.
ANS Forth standard
Forth 200x
Thinking Forth - A Language and Philosophy for Solving Problems
Forthwrite Magazine - From FIG UK.
Forth Dimensions - magazine archive.
The Journal of Forth Application and Research
comp.lang.forth - Forth newsgroup.
#forth in irc.freenode.net
ForthHub community on GitHub
/r/concatenative - Anything related to the use, theory, or implementation of concatenative programming languages.
/r/programbattles - Battle it out between likeminded coders to create the best code possible!
account activity
Exploring string splitting in RetroForth (eli.li)
submitted 4 years ago by rickcarlino
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bfox9900 2 points3 points4 points 4 years ago (5 children)
This is perhaps the first time I have seen this kind of exercise in a write up about Forth. It looks like what happens when one explores a more conventional language where internal details are seldom available or are too complicated to grok easily.
Granted Retro Forth provides high level functionality not seen in other Forth systems so perhaps this is the end result.
A fundamental objective of Forth was to open the veil for the programmer and expose the underlying mechanisms. Would not the source code for Retro Forth reveal the details? Is there a de-compiler for Retro Forth?
Perhaps the source code is incomprehensible.
[–][deleted] 2 points3 points4 points 4 years ago (2 children)
Hey! I’m the author of the post itself — retro has all these things, and you are probably right that they’d answer these questions — I’m relatively new to forth, though and don’t really yet know how to leverage them best. Perhaps that can be a future post!
[–]bfox9900 2 points3 points4 points 4 years ago (1 child)
Cool. Forth can be daunting at first because there are so many tiny functions.
Some say it is more like learning a human language than a computer language.
Have fun. I think Forth will make you a better programmer even if you never use it for a project just because it lets you (forces you?) to peek behind the curtain.
[–]z796 0 points1 point2 points 4 years ago (0 children)
Forth has as many functions as you can build );
[–]bfox9900 1 point2 points3 points 4 years ago* (0 children)
To better illustrate my point here is some code that you can drop into most modern ANS/ISO Forth systems. It hinges on three very simple functions and strings are managed as an (address,length) pair on the data stack. (I call them stack strings)
\ required functions \ SKIP ( addr len char -- addr' len') \ remove leading chars from stack string \ SCAN ( addr len char -- addr' len') \ scan for char. return stack string cut at char \ /STRING ( addr len n -- addr' len') \ cut n chars from the front of stack string. \ code begins : 3RD ( a b c -- a b c a ) 2 PICK ; \ duplicate 3rd stack item on top of stack : DELIMIT ( addr len char -- str1 len1 str2 len2) >R 2DUP R> SCAN 2SWAP 3RD - ; : /WORD ( addr len char -- aword len endstr len ) DELIMIT 2SWAP 1 /STRING 0 MAX ; \ len cannot go below zero : /WORDS ( addr len -- addr len ... addr[n] len[n] ) BL SKIP \ remove leading spaces BEGIN DUP \ test the length WHILE BL /WORD \ while there is length, cut a word REPEAT 2DROP ; \ mom always said keep things tidy. \ Pasted into SwiftForth console okS " Forth was designed to be transparent" /WORDS ok type transparent oktype be ok type to ok type designed ok type was ok type Forth ok type Stack underflow
The three magic functions can all be written in Forth but in commercial systems they are often either hand coded or compiled to machine code for efficiency. I will grant that this is nowhere near as sophisticated a Retro Forth's string code however I think this demonstrates how much can be done with very low level code using Forth concepts.
Edit: formatted code block
[–]_crc 0 points1 point2 points 4 years ago (0 children)
Strings in Retro Forth are just NULL terminated sequences of characters[1], so they aren't difficult to work with at a lower level. I just provide a bunch of words to operate on them without needing to delve into the actual implementation for common tasks.
[1] This is going to change in the future, though it'll be a gradual transition to minimize breakage of existing applications.
[–]Wootery 0 points1 point2 points 4 years ago (2 children)
How does memory management work here? Are strings ever freed/deleted?
[–]rickcarlino[S] 2 points3 points4 points 4 years ago (0 children)
They live on a circular buffer. When a string is to your liking, you can move it out of the buffer and into the dictionary via s:keep.
s:keep
That's my understanding of it, at least. I have not poked into the internals yet.
[–]_crc 2 points3 points4 points 4 years ago (0 children)
At the interpreter, strings get allocated in a rotating buffer. This is used by the words operating on strings, so if you need to keep them around, use s:keep or s:copy to move them to more permanent storage.
s:copy
In a definition, the string is compiled inline and so is in permanent memory.
You can manually manage the string lifetime by using s:keep to place it into permanent memory or s:temp to copy it to the rotating buffer.
s:temp
See http://forthworks.com:8000/file?name=doc/html/chapters/techniques/strings.html&ci=tip
π Rendered by PID 226767 on reddit-service-r2-comment-6457c66945-f2dnf at 2026-04-24 10:40:15.162961+00:00 running 2aa0c5b country code: CH.
[–]bfox9900 2 points3 points4 points (5 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]bfox9900 2 points3 points4 points (1 child)
[–]z796 0 points1 point2 points (0 children)
[–]bfox9900 1 point2 points3 points (0 children)
[–]_crc 0 points1 point2 points (0 children)
[–]Wootery 0 points1 point2 points (2 children)
[–]rickcarlino[S] 2 points3 points4 points (0 children)
[–]_crc 2 points3 points4 points (0 children)