Finally, a Forth course!! Thank you. I'm new to this fascinating language but have made a start and have begun experimenting with mecrisp Forth on the "Blue pill" board.
Nice job demonstrating some simple calculations. I look forward to seeing more complex follow-up videos. I'm having a hard time imagining how this language could be of any practical use, but Chuck Moore said in the Edinburgh interview that he used it for astronomical telescopes, commercial (business) applications, databases (pre-SQL), and even Hollywood (a camera tracker for special effects compositing with accuracy to one pixel). He even used it to create a program for designing carpets - in black and white. I have a difficult time understanding how one gets from such a simple interface to those kind of applications but I long ago learned there are people way smarter than me.
pemdas / bodmas. P Parentheses first E Exponents (ie Powers and Square Roots, etc.) MD Multiplication and Division (left-to-right) AS Addition and Subtraction (left-to-right)
unfortunately, these mnemonics are not general purpose, and worse, quite a lot of mathematical notation is not well specified at all, and people apply it differently and don't agree on how. For instance, coefficient multipliers have higher precedence than exponentiation. This often leads to translation errors when writing multiplicative formulas to languages without coefficient multipliers; basically every single programming language ever. 5xy^5 is not 5 * x * y ^ 5. its (5 * x * y) ^ 5.
I know you wrote this 4 years ago. I so happens I implemented forth in machine code in 1982, and as you say, it is a very fast programming language, and it was a good training for me an my friends who studied computer science at the time. I assume it no longer has your interest and instruction times.
Hi, I would like to know if Forth also uses commands for graphics to be able to make 2d games. Is there any documentation? Thank you! Greetings from Italy
Yes, it does. RetroForth, in particular, has built-in WebGL functionality. In general, Forth can also bind with C, so you can use game engines/libraries like SDL to make games in Forth. I have a video on setting that up: ua-cam.com/video/FOnECIhAOMI/v-deo.html Thanks for the comment!
I haven’t used qFORTH, and couldn’t find any documentation on it online, but seeing it is from the Apple II era, I suspect it would be similar to most other Forth implementations.
It’s a low level language. It is lower level than C, but a step higher than assembly. It’s good when the performance of assembly is needed, but an interpreted environment is desired, like when poking around microchips. It is also useful in situations where assembly levels of access are needed, but a more simplified language design is desirable. Overall, though, it’s more just fun and educational rather than useful these days.
Can we see any forth laptops in future?? This guy founder of forth have been telling this since few decades, but no company is showing interest in this computer whatsoever
Years back some folks left the Sinclair company (Z81 computer) and created their own version which ran FORTH natively. It was called the Jupiter ACE. I'm unaware of any other consumer type FORTH computers. I'd buy !!
Forth is a horrible language. If ever there was an idea in computing so bad it should be consigned to the dustbin of history, it is this one (and I really, really hoped it had). I led a team in the 70s required to write code in Forth and I've never seen so much burnout and several near nervous breakdowns (including, and I can admit it now, myself!) I was mightily relived to be allowed to do my next project in Z80 assembler! Two comments by colleagues on this doomed project: 1. "Fourth: the write-once, read-never language." It is only usable for any project one person can complete in one sitting without a break. Take a tea break and when you come back it takes you as long to understand what you wrote before as it took you to write it in the first place by which time you need another break, so you never make any progress. 2. "Reading a Forth program is like translating an unfamiliar language armed only with a dictionary for native speakers". You look up the definition of one word, to understand that you have to look up the words in that definition and so on down an endless tangled root system from which you never return. There are some things just not worth learning, however good the tutorial. And then there is Forth which you are actually better off not knowing even if learning it is completely painless! Chuck Moore is the Byron of computer language designers: "Mad, bad and dangerous to know". I always suspected he was a kind of non-violent Unabomber - presciently doing his best to strangle the nascent computer revolution at birth!
You make some very good points. Anything more than very simple Forth programs become a monster as far as readability goes. I couldn't imagine using Forth as a team. That must have been brutal. Interestingly, Forth has gained some momentum in the past couple of years in the hobbyist programming world because it is interpreted yet low level. That makes it an excellent language for poking around microcontrollers and little computers like the Raspberry Pi hardware. No need to compile, just execute code in place. Good for figuring things out. And no need to take up disk space like other interpreted languages (e.g. Python). If there were some good statistics on Forth's popularity and the Raspberry Pi's popularity, I suspect there would be a close correlation between the two. I decided to teach Forth because learning it gave me a deeper understanding of how computers work, much the way learning assembler does. And hacking away at it feels like a game or puzzle. But no matter how hard I think about it, and I have thought about it a good deal, I cannot come up with any good high-level use case for Forth. So your points are well taken. Thanks for passing along your wisdom! I think you're actually the first person I've ever had comment who could say they used Forth professionally, so that experience you shared is very valuable. By the way, I enjoyed your theory about Chuck Moore! 😂
@@CodeAndCrux I'm using FORTH at a very high level as a report writer for the FirebirdSQL relational database. My FORTH is written on top of Python, because using Python directly introduces too many security risks e.g. unrestricted eval and file access. My FORTH is more like Javascript in that all it can do is query a database using select queries which it then transforms into HTML or CSV files. Being typeless, extensible (I regularly alter the Python FORTH REPL to make it work better for my purposes) and having a REPL that tells you EXACTLY where your code has crashed without crashing the REPL makes for very productive programming. The only problem is it takes some time to get back in the zone, if you haven't been using it for a while, compared to C code, which I can look at years after I've written it and understand it immediately. Writing inscrutable code in FORTH is very easy to do and I agree with the OP... writing masses of tiny words means you can easily lose your way going down the rabbit hole! When I first started using FORTH, I thought the answer was syntactic sugar words to hide the core words. Now, I try to avoid that, only factoring a word collection into a new word if I know I will be reusing it frequently and I use lots of comments telling me what a paragraph of words is doing. More information about my FORTH can be found at creditscorenz.blogspot.com/2021/06/safe-python-eval.html
@@creditscorenz According to my reading of the article linked in the description, your usage of Forth has the potential to be extremely dangerous, "a flamethrower crawling with cobras". I can't imagine using a language like this for security reasons.
@@DellAnderson True. Even limiting the possible Python words using Forth, it is always possible that somebody might use a Python word in a way I'd never expect resulting in a security breach. User scripting over the Internet is perhaps an impossible dream. That's how I began my journey with Forth. Now I've moved on with Forth to other things. I find it very rewarding to code in. My biggest success to date, using it to control theatre DMX lights.
Finally, a Forth course!! Thank you.
I'm new to this fascinating language but have made a start and have begun experimenting with mecrisp Forth on the "Blue pill" board.
Nice! The blue pill with mecrisp is a great way to learn and experiment with Forth. Thanks for the comment! I hope the course serves you well.
UA-cam needs to add an "I freakin love this" button!
Fantastic! I'm beginning my journey with Forth and its variants such as 8th.
Nice job demonstrating some simple calculations. I look forward to seeing more complex follow-up videos. I'm having a hard time imagining how this language could be of any practical use, but Chuck Moore said in the Edinburgh interview that he used it for astronomical telescopes, commercial (business) applications, databases (pre-SQL), and even Hollywood (a camera tracker for special effects compositing with accuracy to one pixel). He even used it to create a program for designing carpets - in black and white. I have a difficult time understanding how one gets from such a simple interface to those kind of applications but I long ago learned there are people way smarter than me.
Nice to see intrest in FORTH coming back. Good intro too, kind of high speed though.
I am 14 years old and I love FORTH.
At about 8:50, it’s not an equation, it’s an expression. The “e” in pemdas stands for exponents.
Thanks! Loved it to bits. Need stacks more of these. ;)
Thanks for the kind words!
pemdas / bodmas.
P
Parentheses first
E
Exponents (ie Powers and Square Roots, etc.)
MD
Multiplication and Division (left-to-right)
AS
Addition and Subtraction (left-to-right)
unfortunately, these mnemonics are not general purpose, and worse, quite a lot of mathematical notation is not well specified at all, and people apply it differently and don't agree on how. For instance, coefficient multipliers have higher precedence than exponentiation. This often leads to translation errors when writing multiplicative formulas to languages without coefficient multipliers; basically every single programming language ever. 5xy^5 is not 5 * x * y ^ 5. its (5 * x * y) ^ 5.
I know you wrote this 4 years ago. I so happens I implemented forth in machine code in 1982, and as you say, it is a very fast programming language, and it was a good training for me an my friends who studied computer science at the time. I assume it no longer has your interest and instruction times.
Hi, I would like to know if Forth also uses commands for graphics to be able to make 2d games.
Is there any documentation?
Thank you!
Greetings from Italy
Yes, it does. RetroForth, in particular, has built-in WebGL functionality.
In general, Forth can also bind with C, so you can use game engines/libraries like SDL to make games in Forth. I have a video on setting that up: ua-cam.com/video/FOnECIhAOMI/v-deo.html
Thanks for the comment!
Wow. Forth in 2020.
how do you get pixels and sprite on the screen using forth? that would be interesting
How time consuming is to program aka be productive in Forth compared to C and even Python?
Does qFORTH come under this?
I haven’t used qFORTH, and couldn’t find any documentation on it online, but seeing it is from the Apple II era, I suspect it would be similar to most other Forth implementations.
8:23 e is the exponent.
Proceeds to explain stack with the most un-stackable things on his table 🙂, Thanks - great intro, though!
Whats the name of the program?
what is the main purpose of this Language
is this low or high level language
It’s a low level language. It is lower level than C, but a step higher than assembly. It’s good when the performance of assembly is needed, but an interpreted environment is desired, like when poking around microchips. It is also useful in situations where assembly levels of access are needed, but a more simplified language design is desirable.
Overall, though, it’s more just fun and educational rather than useful these days.
Nice and approachable video, thanks! :)
Think of the Stack as a deck of cards
Great advice, thanks!
Show how you code River Raid in this 45 years old + overglorified dinosaur of the programmibg language - then I'll be interested
So it more like postfix math
Can we see any forth laptops in future?? This guy founder of forth have been telling this since few decades, but no company is showing interest in this computer whatsoever
Years back some folks left the Sinclair company (Z81 computer) and created their own version which ran FORTH natively. It was called the Jupiter ACE.
I'm unaware of any other consumer type FORTH computers.
I'd buy !!
didn't the OLPC use forth for it's low level bios?
@@pacman10182 lots of relatively common bootloaders and firmware architectures also use forth.
@@christopherlawley1842 The Canon Cat used FORTH, Jeff Raskin talks about his work on it in his book about UI design "The Humane Interface".
There is a Forth operating system. It's pretty interesting actually. It's called Collapse OS.
Hah I didn't know Forth was RPN :) Reverse Polish Notation :) This is how I caclutate things on my HP 48gx
God Forth is so ugly yet there's just something in me that loves it. Maybe because of it's simplicity?
The e is for exponents. jeez
Thanks
My pleasure!
My God this reminded my ho dump teaching order of operation with acronym is so stupid.
Have younot seen how Allah has set forth a parable? A good word is like a good tree-its root is firm and its branches are in heaven,
Forth is a horrible language. If ever there was an idea in computing so bad it should be consigned to the dustbin of history, it is this one (and I really, really hoped it had). I led a team in the 70s required to write code in Forth and I've never seen so much burnout and several near nervous breakdowns (including, and I can admit it now, myself!) I was mightily relived to be allowed to do my next project in Z80 assembler!
Two comments by colleagues on this doomed project:
1. "Fourth: the write-once, read-never language." It is only usable for any project one person can complete in one sitting without a break. Take a tea break and when you come back it takes you as long to understand what you wrote before as it took you to write it in the first place by which time you need another break, so you never make any progress.
2. "Reading a Forth program is like translating an unfamiliar language armed only with a dictionary for native speakers". You look up the definition of one word, to understand that you have to look up the words in that definition and so on down an endless tangled root system from which you never return.
There are some things just not worth learning, however good the tutorial. And then there is Forth which you are actually better off not knowing even if learning it is completely painless! Chuck Moore is the Byron of computer language designers: "Mad, bad and dangerous to know". I always suspected he was a kind of non-violent Unabomber - presciently doing his best to strangle the nascent computer revolution at birth!
You make some very good points. Anything more than very simple Forth programs become a monster as far as readability goes. I couldn't imagine using Forth as a team. That must have been brutal.
Interestingly, Forth has gained some momentum in the past couple of years in the hobbyist programming world because it is interpreted yet low level. That makes it an excellent language for poking around microcontrollers and little computers like the Raspberry Pi hardware. No need to compile, just execute code in place. Good for figuring things out. And no need to take up disk space like other interpreted languages (e.g. Python). If there were some good statistics on Forth's popularity and the Raspberry Pi's popularity, I suspect there would be a close correlation between the two.
I decided to teach Forth because learning it gave me a deeper understanding of how computers work, much the way learning assembler does. And hacking away at it feels like a game or puzzle. But no matter how hard I think about it, and I have thought about it a good deal, I cannot come up with any good high-level use case for Forth. So your points are well taken.
Thanks for passing along your wisdom! I think you're actually the first person I've ever had comment who could say they used Forth professionally, so that experience you shared is very valuable.
By the way, I enjoyed your theory about Chuck Moore! 😂
@@CodeAndCrux I'm using FORTH at a very high level as a report writer for the FirebirdSQL relational database. My FORTH is written on top of Python, because using Python directly introduces too many security risks e.g. unrestricted eval and file access. My FORTH is more like Javascript in that all it can do is query a database using select queries which it then transforms into HTML or CSV files. Being typeless, extensible (I regularly alter the Python FORTH REPL to make it work better for my purposes) and having a REPL that tells you EXACTLY where your code has crashed without crashing the REPL makes for very productive programming. The only problem is it takes some time to get back in the zone, if you haven't been using it for a while, compared to C code, which I can look at years after I've written it and understand it immediately. Writing inscrutable code in FORTH is very easy to do and I agree with the OP... writing masses of tiny words means you can easily lose your way going down the rabbit hole! When I first started using FORTH, I thought the answer was syntactic sugar words to hide the core words. Now, I try to avoid that, only factoring a word collection into a new word if I know I will be reusing it frequently and I use lots of comments telling me what a paragraph of words is doing. More information about my FORTH can be found at creditscorenz.blogspot.com/2021/06/safe-python-eval.html
@@creditscorenz According to my reading of the article linked in the description, your usage of Forth has the potential to be extremely dangerous, "a flamethrower crawling with cobras". I can't imagine using a language like this for security reasons.
@@DellAnderson True. Even limiting the possible Python words using Forth, it is always possible that somebody might use a Python word in a way I'd never expect resulting in a security breach. User scripting over the Internet is perhaps an impossible dream. That's how I began my journey with Forth. Now I've moved on with Forth to other things. I find it very rewarding to code in. My biggest success to date, using it to control theatre DMX lights.
Painful to watch.
More preparation would certainly improve the presentation. Not much youtube FORTH instruction is available.