Тёмный
No video :(

Why Forth? (programming language) 

Abraham Moller
Подписаться 1,7 тыс.
Просмотров 23 тыс.
50% 1

A brief rationale for and introduction to using Forth.
Check out these pages shown at the end of presentation for more information:
Why Forth? (Bernd Paysan) - bernd-paysan.d...
Forth: A Weird Programming Language. Here’s Why You Might Love It Anyway (Frank Moraes) - www.whoishosti...
Forth: The Hacker’s Language (Elliot Williams, Hackaday) - hackaday.com/2...
Easy Forth (Nick Morgan) - hackaday.com/2...
A Beginner’s Guide to Forth (J.V. Noble) - galileo.phys.vi...
Forth Tutorial (Gforth) - www.complang.tu...
Starting Forth (Leo Brodie) - www.forth.com/...
Thinking Forth (Leo Brodie) - thinking-forth....
Recorded with OBS Studio and edited with OpenShot Video Editor.

Опубликовано:

 

14 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 104   
@TimHayward
@TimHayward 4 года назад
Everyone talks about the stack but one of the really clever components is the dictionary and how it is used for variables, functions, overloading, compiling, scoping, etc. I hope your next video will cover that and the input stream.
@garthgoldwater5256
@garthgoldwater5256 3 года назад
Tim Hayward i second this!
@basicforge
@basicforge 4 года назад
Forth is the first structured language I learned after I spent a few years with BASIC. I accidentally stumbled across Starting Forth in the public library and since I already had several years of HP calculator programming under my belt I found it very comfortable to learn. With that book and the excellent following Thinking Forth I was ready for a career in software development.
3 года назад
I had a hard time trying to get the grasp of Forth and what made it much easier was to understand the "threaded code" model and how "The Dictionary" is implemented. (Interestingly, the Forht Wikipedia page is very nice.)
@whstark
@whstark 2 года назад
Forth Interest group has allot of resource's, I belonged to in back in the 70 tie's and had it running on my CPM operating z80 system, with 8" DMA controller drives DT8's (controller and 2 drives were $1500 back then but really fast) - The IMSAI S100 VIO memory mapped video was great, also the MIO IO board, banked 256K ram also running a ram drive.
@finndriver1063
@finndriver1063 4 года назад
I'm inspired! I've always enjoyed stack programming and RPN since my PostScript days, I never thought to try Forth, many thanks
@walnuthills11
@walnuthills11 4 года назад
You are welcome! IIRC PostScript is based on Forth.
@mr1enrollment
@mr1enrollment 2 года назад
: Beep Forth love if honk then; I used Forth to design digital oscopes back in the 80's on 2905 bite slice machine. Love'd it. I have been considering writing FORTH in C for micros. Probably C.H.Ting's F79 or 83. I see Mecrisp Forth is available but I don't know the history of it. People get carried away with 'improvements' which I think get beyond the simplicity of the basic language.
@GianmarioScotti
@GianmarioScotti 4 года назад
A nice presentation of the advantages of Forth, but I am even more thrilled by the info in the video description. Thank you, Abraham!
@walnuthills11
@walnuthills11 4 года назад
Thank you, Gianmario! There will be Forth tutorial videos in the future, and hopefully some data acquisition, real-time control, and microcontroller programming examples as well!
@GianmarioScotti
@GianmarioScotti 4 года назад
@@walnuthills11 I am looking forward to the tutorials. What will be the target hardware? Hopefully something affordable like the Arduino Uno. Though the Parallax Propeller is more Forth-like.
@walnuthills11
@walnuthills11 4 года назад
@@GianmarioScotti Possibly M5Stack!
@lorensims4846
@lorensims4846 4 года назад
Nice overview and argument in favor. I discovered Forth with fig-Forth on my Atari800 in 1985. It was a revelation! I have since tinkered with Yerk (a Forth system) on my Mac Performa in the mid-'90s just after my graphic design teacher taught us that PostScript is, in fact, a page description 'language' by having us write programs in it. I was delighted to see that it's basically Forth!! I wasn't really surprised to find so little information on RU-vid, but I was delighted to find your informative video. I just came from that hackaday.com site before I cam here! Thanks so much for the info in the description!!
@walnuthills11
@walnuthills11 4 года назад
Thanks! Is my video on Hackaday?
@b213videoz
@b213videoz Год назад
I'd like to see River Raid coded in FORTH eslecially for Atari 800
@lambda494
@lambda494 3 года назад
Forth is great. Fortress and Factor are other cool stack languages to check out if you're interested in them!
@yash1152
@yash1152 2 года назад
thanks for recommending other stack based languages
@scramjet4610
@scramjet4610 6 месяцев назад
Factor documentation is very poor. Could not even find how to compute with trigonometric functions; instead, they just talk about text manipulation and "Palindromes." Basically, useless.
@xravenx24fe
@xravenx24fe 5 месяцев назад
​@scramjet4610 their documentation and online helper are some of the most comprehensive I've ever seen lol. Literally all it takes is a basic search inside the help browser, and it tells you the module name and shows you the implementation...
@geromiuiboxz765
@geromiuiboxz765 Год назад
🇨🇱 Being a FORTH fan since the 70's, I enjoyed your video with a dose of nostalgia 😀 Perhaps you should have mentioned (honored) it's creator genius Chuck Moore, who "invented" it back in 1968. Saludos desde 🇨🇱
@john-lenin
@john-lenin Год назад
Forth is once again the future
@K0P
@K0P 4 года назад
Awesome presentation! I've been trying to get into forth and noticed a lack of youtube videos as well. Appreciate the resources
@gustinian
@gustinian 4 года назад
Forth is just so expressive and yet refreshingly simple. It is deplorable that it is not better known (although a secret weapon is best kept secret...) In comparison with other prevalent languages (which got adopted by chance more often than not from what I can tell) it is almost as if the priestly class (i.e. programmers) were trying to deliberately obfuscate programming, to keep the black box unknowable. It is rare in the age of colossal operating systems and plug and play libraries built on layers of dependencies, to have a system that is fully comprehensible from top to bottom. The Mecrisp Stellaris Forth for ARM Cortex is particularly recommended.
@walnuthills11
@walnuthills11 4 года назад
Indeed! I'm getting an M5Stack ESP32 dev box for IoT. I plan to demonstrate Forth in various MCU and IoT applications in the future, along with obligatory tutorials and sample programs.
@marswatcher
@marswatcher 2 года назад
You should get yourself a Udamonic Scamp3 embedded computer. It boots into Forth as its native environment. Highly recommended!
@briandonovan9091
@briandonovan9091 Месяц назад
What about a more powerful MCU like the TI motor DSP? Way more memory, HR io etc.. and they only cost a dollar.
@TheKetsa
@TheKetsa 4 года назад
FORTH is sadly under-represented on the web. Hard to even find an intro.
@b213videoz
@b213videoz Год назад
Any ideas why?
@briandenley
@briandenley 3 месяца назад
@@b213videozit feels low level, hard to read some else’s code, difficult to break up for group coding, impossible to teach to young learners.
@tectopic
@tectopic 4 месяца назад
For me it’s mostly the ease of factoring and structure.
@heedmywarning2792
@heedmywarning2792 4 года назад
I have a FORTH programming tape for the Model 100 and NEC 8201a computers. Now I know what it's for.
@walnuthills11
@walnuthills11 4 года назад
Speaking of that, check out MFORTH! www.strangegizmo.com/products/mforth/
@heedmywarning2792
@heedmywarning2792 4 года назад
@@walnuthills11 thank you for the info!
@pauldusa
@pauldusa 10 месяцев назад
1989 was my FORTH timeline. I found one of my forth CPU, Ram, EEPROM, latch to control the Address. The Old days before Embedded microcontrollers we’re invented. The fun days
@hrnekbezucha
@hrnekbezucha 4 года назад
I really hope you'll get around to the demos, Forth is amazing and I'm especially excited it runs on the 8 bit micros!
@walnuthills11
@walnuthills11 4 года назад
I am very busy now but my first demo will probably be 16-bit Pygmy Forth (on the HP 95LX).
@hrnekbezucha
@hrnekbezucha 4 года назад
@@walnuthills11 That's fine :) I'm subscribed so I won't miss it.
@walnuthills11
@walnuthills11 4 года назад
@@hrnekbezucha Thanks for subscribing!
@AllGamingStarred
@AllGamingStarred Год назад
@@walnuthills11 Could you possibly do a series on the Jupiter Ace? It's a micro that runs forth that was released in the 80's.
@walnuthills11
@walnuthills11 Год назад
@@AllGamingStarred Possibly, but I unfortunately don't have one. Maybe in an emulator.
@meanmikebojak1087
@meanmikebojak1087 4 года назад
I think the only drawback to FORTH is that every programmer uses their own names and definations for some of the common process'. There was figFORTH, 79 FORTH, 83 FORTH. Moving form one version to another required some tinkering some of the FORTH words in PygmiFORTH would need to be altered to respond as expected in another dialect of forth. Every programmer would find a slightly different definanition to complete the same task. The book 'Starting FORTH' ( 79 FORTH ) offers some changes to high level words in whatever version you might be using to keep the results in the different dialects close to what your expecting when trying examples in the book. I use different versions of FORTH on three different processors and there are times when the low level words cause some problems. I still prefer using FORTH.
@NotMarkKnopfler
@NotMarkKnopfler 4 года назад
Yes. In the Forth world, we say "When you've seen one Forth, you've seen one Forth!". But part of the reason for that is because Forth is so expressive, so malleable, and configurable. Your machine becomes your own machine when you use Forth. You completely own it. I think it's particularly well suited to small embedded systems, which is where I use it.
@briandonovan9091
@briandonovan9091 2 месяца назад
I wrote a multi standard program when co writing Jforth that allows the use of multiple versions of forth weather interpreting or compiling by revealing and unrevealing the appropriate words in the vocabulary. It's pretty easy to expand to more standards. Jforth is available free now.
@zorgfr1
@zorgfr1 Год назад
i discovered Forth in the 80's on ORIC ATMOS Computer. It was Forth-F83 version. 🥰
@PeterForth
@PeterForth 4 года назад
Good work Abraham ! Congratulations !
@walnuthills11
@walnuthills11 4 года назад
Thanks, Peter! Thank you for adding this to your playlist! :)
@thomasgebert6119
@thomasgebert6119 5 месяцев назад
Just had this video recommended to me after doing some Googling for Commodore 64 development. I really hate using raw assembly code, but there are a few Forths written for the C64 that appear to get reasonably good performance. I think it might be fun to try and make a C64 game in Forth, since the language is a little more approachable than ASM but a lot faster than BASIC.
@walnuthills11
@walnuthills11 5 месяцев назад
Thanks for watching! Yes, I think there is a good deal of C64 and possibly TI-99/4A game development in Forth for the reasons you mentioned.
@HansBezemer
@HansBezemer 9 месяцев назад
It's a nice introduction to the basic Forth concepts. However, it also continues the myth. Yeah, it's easy to draw some stars on the screen - or do some square calculations, but the moment you *REALLY* want to use it for real world applications, people become aware that this "elegant stack" is really a pain in the neck. Two parameters to a word - that's fine, you can do that. But a word with *SIX* parameters quickly deteriorates in what's called "stack acrobatics". Every call, every branch, every loop opens up the possibility of getting stack errors. And with an application of a substantial size, that becomes looking for a needle in a haystack - and some very cumbersome debugging. If you want to apply Forth successfully, you have to adopt an entirely different way of approaching the problem. Where do parameters get in scope. Where do they go out of scope. Sure, you can adopt local variables - but then where is the difference with "classical" languages? Answer: there is none. You're actually building and releasing stack frames - like with any other language. Can it be done? Yeah, sure - but it will takes years of practice and thousands of lines of code. Nowadays I'm able to write Forth programs several factors faster than your average C programmer (and it's more fun). But it has taken me at least a decade to get there. And that is a part of the myth that is rarely communicated.
@briandonovan9091
@briandonovan9091 2 месяца назад
the are plenty of local stack variable programs, I've written several where I needed reentrant code within a task. Pick is fast. Usually programmers create date structure anyway.
@HansBezemer
@HansBezemer 2 месяца назад
@@briandonovan9091 If you want to write C, write C - not Forth. Using the stack as an array doesn't make your program any clearer - rather the opposite.
@briandonovan9091
@briandonovan9091 2 месяца назад
@@HansBezemerForth is infinitely more powerful than C. Try Create Does> in C
@briandonovan9091
@briandonovan9091 Месяц назад
@@HansBezemer I have done both. Forth is a very fast object meta language. C is crude and simple. In forth you can create new function creators. Create does> C cannot do this. In forth you can execute programs while compiling then even delete them, for instance to fill tables. You can grab the compiler input stream and process it however you want, in forth. Not in a separate limited macro language. C has also become very bureaucratic in practice in a failed attempt to beat the man month. The linker has it's own language, the compilers, it's all built into forth, and will fit inside the 128k byte CPU cache. most forths are now direct threaded and faster than C because of the high call overhead of C. Forth programmers are ridiculously short compared to C programs. Basic or a 8080 assembler is one page in Forth with macros and a high level conditionals. Plus forth. Studies of software bugs shows a linear relationship between characters needed and errors. Bigger programs are buggier. Forth has vocabularies so you can reuse words instead of making the programming language gibberish to "reserve" real words for the application names. Crazy. I also cowrote Jforth, so that's what I i'm going to use.
@HansBezemer
@HansBezemer Месяц назад
@@briandonovan9091 .. and you still have no idea who I am? Have you read your *own* home page? As a matter of fact, I wrote 4tH some 3 decades ago. In C, that is. It also features a preprocessor. One that can calculate not only a factorial while preprocessing, but also several trigonometry functions (not built-in). It can even produce a mandelbrot graph while preprocessing - or a sine wave. It is used to implement OOP in 4tH. In a world with high optimizing C compilers, I doubt very much there is a Forth compiler that can match any major C compiler. I haven't seen any benchmark where Forth takes the lead over C. In general, it's about 5-10 times slower - although I acknowledge the relatively high function call overhead for C. That's why I don't like locals in Forth. I'd be very curious to see any academic paper on "characters required" in relation to bugs. The most authoritative study is from Bell Labs in the late 90-ies. It concluded that the lack of an architecture, frequent violation of the architecture and the age of the code were determining factors in "software decay".
@MGeeify
@MGeeify 4 года назад
I‘m so glad you made that joke at @8:16 lol
@walnuthills11
@walnuthills11 4 года назад
You're welcome! Maybe someone has done it! Someone better do it ;)
@briandenley
@briandenley 3 месяца назад
As a huge RPN fan, I really wanted to like Forth but I find the available texts on the language to be awful! Does anyone know of a good text for Forth? I know several programming languages but many good texts are available for them.
@TimHayward
@TimHayward 2 месяца назад
Have you tried "Starting Forth" by Brodie
@jmp01a24
@jmp01a24 4 года назад
Would been nice to see you program and run some program in Forth.
@walnuthills11
@walnuthills11 4 года назад
That is coming up in future videos ;)
@MarekKowalczyk
@MarekKowalczyk 3 года назад
The word 'polish' in RPN ought to be capitalized, as it is an adjective derived from 'Poland' :)
@walnuthills11
@walnuthills11 3 года назад
Oh, oops! Definitely! Thanks!
@AllGamingStarred
@AllGamingStarred Год назад
I'm more used to no rpn languages so the concept of writing even a simple game in forth is daunting. Is there support for sprite movement with joysticks?
@FD-ze1xg
@FD-ze1xg 3 года назад
hello to everyone I would like to know if the Forth would be good for making 2d video games. thanks!
@TimHayward
@TimHayward 2 месяца назад
I'm thinking about it. I have an idea for a new kind of game console programmable in forth.
@piquat1
@piquat1 3 года назад
I had a FORTH programming cartridge for my VIC-20. After learning BASIC, FORTH was a challenge to wrap my mind around.
@davidgrossman5741
@davidgrossman5741 Год назад
That was really interesting! Thanks!
@walnuthills11
@walnuthills11 Год назад
You are very welcome!
@GaryChike
@GaryChike 2 месяца назад
"It's like Python and Assembly had a baby"
@walnuthills11
@walnuthills11 2 месяца назад
Hahahahaha 🙂
@simplelyf4072
@simplelyf4072 4 года назад
Nice! Regarding Forth, are you aware of a forth command which displays word definitions? I know there is a command called “words” which displays all the dictionary words, but is there a command to display the code behind each word?
@walnuthills11
@walnuthills11 4 года назад
I think the word "view" does that, at least in Frank Sergeant's Pygmy Forth.
@Ieromnimon_Kakabouras
@Ieromnimon_Kakabouras 4 года назад
Gforth uses the word "see" .
@briandonovan9091
@briandonovan9091 Месяц назад
Jforth had see to see the text, dism to see the code in assembly.
@KD5NJR
@KD5NJR 4 года назад
Fantastic !!
@walnuthills11
@walnuthills11 4 года назад
Thanks, Scott, as always!!
@aspergerhyperactive903
@aspergerhyperactive903 Год назад
is it possible to create a programming language with the programming language forth, if possible, how to create a programming language with forth
@briandonovan9091
@briandonovan9091 2 месяца назад
Forth self references from the money you load the kernel. You can spawn more kernels or more programs or more languages. Mathcad was written in Forth.
@Decco6306
@Decco6306 3 года назад
I think this would be really cool on the new Raspberry pi pico controllers
@walnuthills11
@walnuthills11 3 года назад
Absolutely, agreed!
@TimHayward
@TimHayward 2 месяца назад
Esp32Forth is a really great forth for the ESP32.
@AllGamingStarred
@AllGamingStarred Год назад
The Jupiter Ace cannot use sprites. I managed to program the sprite program for the c64. A lot faster. Damned shame
@michaelotu9723
@michaelotu9723 4 года назад
just when i want to learn forth.. I am pleased actually.. In a academia, I was i advised to use C/C++/Asm for system software development. Any advice
@walnuthills11
@walnuthills11 4 года назад
Maybe with microcontrollers? Try mecrisp Forth (STM32/ESP32 IIRC)
@michaelotu9723
@michaelotu9723 4 года назад
@@walnuthills11 thanks.. but i have no idea what these (mecrisp Forth (STM32/ESP32 IIRC)) are so i just downloaded gforth.. i am working my way bit by bit to byte
@walnuthills11
@walnuthills11 4 года назад
@@michaelotu9723 Yes, gforth would be a good place to start. There is a good tutorial for it. Also check out the various Forth groups on FB.
@vikidprinciples
@vikidprinciples 3 года назад
Which implementation to use on Linux?
@walnuthills11
@walnuthills11 3 года назад
Gforth.
@obvioustruth
@obvioustruth 9 месяцев назад
Come on!!! It is difficult to read. I understand why almost noone uses it. In my humble opinion FORTH is a crap language because of its syntax. It is terrible.
@walnuthills11
@walnuthills11 7 месяцев назад
Fair enough. It is typeless IIRC and everyone implements things their own ways. There aren't standardized libraries the way you would find them in say C or C++.
@TimHayward
@TimHayward 2 месяца назад
I think the reason there are so few standardized vocabularies is that it is so easy to create your own. I think this is a shortcoming, but I think it could be addressed.
@esra_erimez
@esra_erimez 11 месяцев назад
Who's watching in 2023?
@TimHayward
@TimHayward 2 месяца назад
2024
@b213videoz
@b213videoz Год назад
Why? Forth is more than 40 years old and all it's good for is endless bragging 😁
@walnuthills11
@walnuthills11 Год назад
Lol! This isn't far from the truth ;-)
@HansBezemer
@HansBezemer 9 месяцев назад
Yes. And deserved. I've seen (and demonstrated on YT) 1K line editors, FP extensions - and even OOP extensions. Try that with any other language. I myself have written an full DBMS in 400 lines and a Forth programmable preprocessor in 500 lines that puts CPP to shame. There are some remarkable feats possible in Forth. But you have to bring along the skills to show them off. I've seen seasoned IT professionals pulling out the paper tray because they don't believe a program with those capabilities could fit on half a page of paper. I've written programs of several thousand lines in just five days. And when the customer wanted to convert it to C, they didn't get any estimates of less than 3 months. And no, I'd written full specifications (took me another five days, but the customer always comes first).
@b213videoz
@b213videoz 9 месяцев назад
@@HansBezemer Ok, please write the River Raid game in Forth - I'd love to test it 😉
@HansBezemer
@HansBezemer 9 месяцев назад
@@b213videoz I'm in data, not games. You write a routine in C that does this: input => ISO 8601 output: 25-MAR-1960 => 1960-03-25T07:00:00.00 December 26th 1981 => 1981-12-26T07:00:00.00 20031105 => 2003-11-05T07:00:00.00 02/12/39 => 2039-12-02T07:00:00.00 22. Dezember 1971 => 1971-12-22T07:00:00.00 July 4th, 1776 => 1776-07-04T07:00:00.00 12 augustus 1925 => 1925-08-12T07:00:00.00 14 Julliet 1792 => 1792-07-14T07:00:00.00 22161 => 1960-09-02T07:00:00.00
Далее
до/после Знакомо?
00:16
Просмотров 12 тыс.
ТАЙНЫ И ЗАГАДКИ ИНТЕРНЕТА 2
41:37
When Zig Outshines Rust | Prime Reacts
23:31
Просмотров 138 тыс.
FORTH - Better than BASIC?
14:30
Просмотров 38 тыс.
Choosing Your Language: Python or Mojo?
14:33
Просмотров 113 тыс.
The Uiua Programming Language Caught Me By Surprise
12:24
Forth Programming Language: Introduction
13:32
Просмотров 20 тыс.
My4TH - A discrete CPU Forth computer
13:12
Просмотров 10 тыс.
Forth Programming Language - Shropshire LUG - Oct 2020
1:30:10