FORTH?

preview_player
Показать описание
FORTH (or Forth if you don't like the caps-lock key, it's not an acronym) is a programming language that was developed in 1970. It's really simple, but it's really powerful as well. It also inspired several esolangs such as FALSE.

A good resource for learning FORTH:

Run forth code here:

MUSIC USED:
"Jumper 2" by Waterflame
"Starbound" by Itro x Valcos
"Anti-Sad Song" from Karoshi 2.0
"Hypnospace Teentopia Anthem" from Hypnospace Outlaw
Рекомендации по теме
Комментарии
Автор

Forth is my favorite language. You quickly build a bespoke language that describes your specific problem. Each word gets compiled as you write it, so it's fast. I love it.

noscreadur
Автор

The reason a lot of these seem the wrong way around is because that's easier to write a compiler for. Same with it being in reverse polish notation. Also a choice to make compilers simpler.

sinom
Автор

You should look into porth. It's like forth, but written in porth

emilioschmidt
Автор

Hi, Turttle. As far as I know, a lot of quirks of Forth come from the fact that this langues is very easy to compile. If I recall correctly, there used to be some processors that we able to compile and run Forth code in hardware. They were called Forth processors.
Even if Forth is not used much anymore, it is still a very nice and powerful language.

maximebouillot
Автор

the cursed part of this video is not the fact that you used a Homestuck character when talking about stacks, it's the fact that you decided to go with the smooth design from the beta.

stagelights_
Автор

Those spaces are necessary because : and ; are themselves just words. There are no special characters or keywords. the interpreter just goes word by word and executes them. Some words like : do hijack the input stream and do their own thing, but your own words could do that as well. Indeed, you could change any of the things you don't like by introducing a word that does it differently.

StefanNoack
Автор

also you have to keep in mind that this language has an interpreter like python and its actually crazy fast and efficient because its using a data structure that is native to how CPUs work so its really nice for embedded stuff with low resources. that WORD think is like creating your won custom operations and you cant take a giant thing and condense it into one word. you can also make words with other words and eventually like actually make your own OS/language if you wanted. you also have to kinda remove yourself from the head space that its a language. its more than that tbh. its an entire environment. and there are updated versions of this that are much better than the ones you shown in the video. Once you realize the context of why forth is the way it is its actually kinda cool. did i mention its CRAZY compact and fast?

zilog
Автор

0:26
*shows John Egbert*
_dies instantly_

furretwalky
Автор

This is not how a seasoned Forth programmer writes this : even 2 mod 0 = if ." Even" else ." Odd" then ;
(1) There is a word "0=", so : even 2 mod 0= if ." Even" else ." Odd" then ;
(2) Use "1 AND" for odd. It's faster, so : even 1 and 0= if ." Even" else ." Odd" then ;
(3) Get rid of "0=" by inverting the conditions, so : even 1 and if ." Odd" else ." Even" then ;
(4) If it's odd, we're quitting anyway - no need to make that ELSE jump : even 1 and if ." Odd" exit then ." Even" ;

That doesn't only makes it faster, it's also about 20-25% smaller in generated code.
Finally, no need for : newline 10 emit ; - the word you're looking for in Forth is "CR".

HansBezemer
Автор

4:24 my speculation on why it ends with a "then" is to say like "then do the stuff following the if block regardless of condition"

Vallee
Автор

Love your videos as always, discovering new programming languages is cool but when you explain them it's better

Golem
Автор

i am severely disappointed in forth. I am hoping that fifth does much better.

esolangsemerald
Автор

6:38 This is build in to Forth. it's CR (name form carriage return). But overall cool video.

xeenypl
Автор

How did I miss this upload? I've been waiting for you to do forth for a while, glad to finally see it!

samuelwaller
Автор

if you haven't done a video on it before maybe you could look at a language like Factor and how it uses quotations for a different way of flow control then

cyberneticsquid
Автор

After factoring out newlines, you can caftor out " bottles of beer" and " on the wall", and then alter bottles of beer to consider pluralization, ultimately resulting in an actually reaspnable program

MrRyanroberson
Автор

You should mention Porth by Tsoding :)

KitsuneAlex
Автор

Random fun fact: Paul DeMarinis wrote the code for the Music Room at the Exploratorium in Forth! Which I only know because Paul DeMarinis is one of the coolest people of all time to me.

imlxh
Автор

0:59 well creaturey, who ever watches shorts

algotkristoffersson
Автор

would love to see you revisit some of your favourite langs and do some creative coding ^ ^

iidoyila