Wait. Can and how do you remove the top value without outputting?
@SimonClarkstone2 жыл бұрын
@@tetrachart4156 "drop", I think
@Blue-Maned_Hawk2 жыл бұрын
That invite doesn't work.
@Truttle12 жыл бұрын
@@Blue-Maned_Hawk that's because you were banned from the server... several months ago...
@Blue-Maned_Hawk2 жыл бұрын
@@Truttle1 , could that please be reverted?
@noscreadur Жыл бұрын
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.
@emilioschmidt21062 жыл бұрын
You should look into porth. It's like forth, but written in porth
@grayishcolors2 жыл бұрын
Best part is it’s in active development so anything today might change tomorrow. Oh & it only works in Linux so hopefully he’s using that lol
@emilioschmidt21062 жыл бұрын
@@grayishcolors it only works on *linux 64 bit,😡* I have debian running on my ARM raspberry pi and I can't run it :(
@grayishcolors2 жыл бұрын
@@emilioschmidt2106 oh yeah that’s an L
@einsjannis2 жыл бұрын
Hahaha welcome to epic porth club
@kraskaska2 жыл бұрын
i see a fellow tsoding viewer
@sinom2 жыл бұрын
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.
@Stingpie2 жыл бұрын
Same thing can be said for the spaces. It looks like they are used to help the tokenizer, and it would take a dumb amount (in the 70s) to make the tokenizer muddle through it.
@HansBezemer2 жыл бұрын
As a matter of fact: most languages use a recursive descent parser to convert infix to postfix - it's the way CPUs work - since they are blissfully unaware of parenthesis. But if you really want to you can back fit most Forth with one - as this code shows: : calculate ( -- flag) let f = f - u; let h = h - v; let v = (((v + g) * 10) - (u * 2)) / 10; let h,|0> 0=|; \ height < 1? ; : lander begin ready \ G-force, velocity, height, fuel let g=2; let v=70; let h=1000; let f=500; begin meter boost calculate until let h = max (h,0); meter report ." Do you want to play again? (0 = no, 1 = yes) " enter 0= dup abort" Have a nice day." cr until ;
@perplexedmoth2 жыл бұрын
@@HansBezemer Do you have the code available for your last example to work?
@jamesgray68042 ай бұрын
It also means you don't need to identify precedence or ascocitivity for each word you define
@stagelights_2 жыл бұрын
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.
@StefanNoack2 жыл бұрын
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.
@rebca_2 жыл бұрын
yes! the real power in forth is modifying the compiler with your own compile-time words
@HansBezemer2 жыл бұрын
Those hijacking words are called "parsing words". The basic tokenizer just separates tokens by white space and then executes three rules: 1. If it's a command executes it; 2. If it isn't try to convert it to a number - and throw it on the stack; 3. If it isn't issue an error message.
@tyfoodsforthought Жыл бұрын
Not going to lie. That's really cool! Forth is interesting.
@codewizard58 Жыл бұрын
: interp query word find if execute else number then ; : execute state @ if compile else doit then ; : compile , ; : number state @ if .lit , then , ; // parse input into ws separated words, look up in dictionary, execute or compile if found else treat as a number
@maximebouillot55482 жыл бұрын
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.
@SimonClarkstone2 жыл бұрын
Yes. The reason string printing looks like that is that there needs to be a space to end the ." word. as soon as that word is parsed at compile-time, the compiler hands over control to it. It reads the string and compiles the appropriate code to print that string out before returning back to the main compiler. Similarly, the compiler hands over control to the conditional and looping constructs at compile time, and they only know how to write out branch/jump instructions or update the target addresses of such instuctions, not how to do the branching themselves, so they only know how to compile (inside a word definition) not be interpreted. You can write your own words that run a compile-time if you want.
@GeorgeTsiros2 жыл бұрын
(forth is still used) (in actual production)
@charlespax Жыл бұрын
Yes! The Novix NC4016 is a Forth processor and it's really cool! According to Philip Koopman in Stack Computer: The New Wave, "[The Novix 4016] was the first single-chip Forth computer to be built, and originated many of the features found on subsequent designs."
@KC9UDX Жыл бұрын
There were Pascal processors, too.
@zilog12 жыл бұрын
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?
@HansBezemer2 жыл бұрын
It's MUCH better than Python performance wise. Depending on the task at hand it's typically between 2 - 10 times.
@HansBezemer2 жыл бұрын
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".
@orangegaming95622 жыл бұрын
Come forth sir truttle
@esolangsemerald63942 жыл бұрын
i am severely disappointed in forth. I am hoping that fifth does much better.
@ribosomerocker2 жыл бұрын
its called factor!
@QTpyeRose2 жыл бұрын
lets abstract to nth!
@nathanoy_2 жыл бұрын
porth will do better xd kzbin.info this channel is develloping it. Already self hosted
@johanloubser81382 жыл бұрын
I think its fork "hence" is better
@xSH4773Rx2 жыл бұрын
There's actually a language called fifth based on forth lmao
@furretwalky2 жыл бұрын
0:26 *shows John Egbert* _dies instantly_
@irishbruse2 жыл бұрын
How about one on porth after this
@marconymous2 жыл бұрын
I was looking for that comment :)
@sarenard2 жыл бұрын
Yea, good idea lmao was looking for this comment too @Marconymous
@irishbruse2 жыл бұрын
We might finally learn what forth is after all
@xelaxander2 жыл бұрын
Yes! It's like Forth, but written in Porth.
@marconymous2 жыл бұрын
@@irishbruse hahaha true
@Vallee1522 жыл бұрын
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"
@chofmann Жыл бұрын
i assume "then" basically just drops a value from the stack. like, after "2 mod 0 =", the top of the stack contains a boolean. "if" probably checks for the top value and if it's true, it puts a value _below_ the top, so "else" can work. "else" then checks for the top of the stack and puts its value below it, if it's false, leaving you with the boolean still on the top of the stack. "then" just removes it, to leave you with the result
@KitsuneAlex2 жыл бұрын
You should mention Porth by Tsoding :)
@Provitia2 жыл бұрын
was about to say that
@cyberneticsquid2 жыл бұрын
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
@xeenypl2 жыл бұрын
6:38 This is build in to Forth. it's CR (name form carriage return). But overall cool video.
@imlxh71262 жыл бұрын
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.
@MrRyanroberson12 жыл бұрын
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
@Golem6422 жыл бұрын
Love your videos as always, discovering new programming languages is cool but when you explain them it's better
@jaded1512 жыл бұрын
holy shit that homestuck reference did psychic damage to me
@thefractalistic37612 жыл бұрын
real legends had blown out their ear drums in this video
@Truttle12 жыл бұрын
i accidentally set the volume of that clip to the max instead of the min lol... now there's just an awkward cut because the youtube built in editor sucks and you can't re-upload already uploaded videos...
@thefractalistic37612 жыл бұрын
@@Truttle1 oh ok
@samuelwaller49242 жыл бұрын
How did I miss this upload? I've been waiting for you to do forth for a while, glad to finally see it!
@iidoyila2 жыл бұрын
would love to see you revisit some of your favourite langs and do some creative coding ^ ^
@kazii_the_avali Жыл бұрын
this seams like a very very friendly esolang. i was expecting some dumb thing that would make it hard to learn but this is very much learnable
@peterkerj7357 Жыл бұрын
It's not an esolang.
@kazii_the_avali Жыл бұрын
@@peterkerj7357ah my apoligies. the first 3 results on my go to serch engine for "is forth a esolang" showed to the esolang wiki.
@nyuh2 жыл бұрын
Esojam judging when
@wmpowell82 жыл бұрын
I’ve seen a lot of news articles about this esolang called *Bhai Lang* . You should look into it.
@algotkristoffersson157 ай бұрын
0:59 well creaturey, who ever watches shorts
@DanielLenrd2 жыл бұрын
"then ends an if-block in forth" and then there was nothing
@r.pizzamonkey73792 жыл бұрын
I remember using forth for Redpower computers back in ye old tekkit days. Forth is a really difficult language to use, but it's really efficient to make a repl for.
@MCLooyverse2 жыл бұрын
Woah! I'd honestly much rather use Forth than Lua (for Computer Craft). I've never noticed a mod with a programming language other than Computer Craft.
@teknikal_domain Жыл бұрын
@@MCLooyverse RetroComputers (for 1.12.2), NedoComputers (1.7.10, now defunct completely) were basically re-implementations of RP2 FORTH. In theory, OpenComputers *can* use other languages (just need to register a handler that works with a different language that can somehow work within the JVM), but by itself doesn't ship with more than Lua 5.2 and 5.3 I'd imagine SOMEONE could make a FORTH machine in it natively, but I haven't seen it yet.
@spageen Жыл бұрын
I love the funny reptile characters!
@tux14682 жыл бұрын
Dangit, I missed the premiere! Oh well, this video should be fun regardless.
@desmondnel57062 жыл бұрын
Went back to look at the esolang 'FolderCode' and Ver 1.0 was intended for you. Literally. It's right there on the page in black and white.
@SeasideBandit Жыл бұрын
The Nokia 6610i was the first phone I bought for myself in 2004. Still have it in a drawer.
@l2ubio6 ай бұрын
it would be cool seeing you do something with Factor. Which is a new-ish (00's) stack based programing language but that it seems to ship with decent libs and bindings for graphics
@DarioBucca2 жыл бұрын
Even if it is still in heavy development Porth is worth a look. It's a programming language inspired by forth, developed by Tsoding
@petrus42 жыл бұрын
Whenever I need to perform some mathematics now, I've started always using GNU FORTH instead of Windows Calculator.
@Hibbyhubby2 жыл бұрын
i've recently discovered your channel and i love the wealth of content, the enthusiasm for different languages and projects is just the best to see elsewhere! thank you!
@bujitself2 жыл бұрын
I love making myself, do that every day
@sajeucettefoistunevaspasme8 ай бұрын
a wise man once said "never odd or even"
@heavoid2 жыл бұрын
is that John Egbert from Team Fortress 2 (2007)?
@thepinkbunnyempire10272 жыл бұрын
why is homestuck appearing everywhere now
@marswatcher2 жыл бұрын
Try a Udamonic Scamp embedded computer. It comes with Forth preinstalled, and it's really great to use. There are a few youtube videos on it, if you search for it. Pretty cool!
@kantoros2 жыл бұрын
1:41 actual smart people actually call it 'postfix' because the name 'reversed polish' is stupid
@ArazNebiza2 жыл бұрын
FORTH!1!?1?
@SealedKiller2 жыл бұрын
Wow your voice has changed! Haven't watched your vids for a longer time.
@EdKolis2 жыл бұрын
FORTH needs a sequel called FITH. Actually, I need to drink a FITH after watching this video!
@MrTortoed2 жыл бұрын
I wonder what made you cover this language ;) great video
@tschak909 Жыл бұрын
In Forth, stack manipulation is explcit. This is why everything looks backwards.
@KC9UDX Жыл бұрын
Peter Gabriel used Firth, or so I've heard.
@kurosurintomasu Жыл бұрын
john egbert jumpscare
@GegoXaren2 жыл бұрын
Why then is at the end, is becouse it push things to the stack and when you reach then it evaluatus it??? So it becomes if then else then???
@tsobf2422 жыл бұрын
"Forth isn't an esolang! ... okay you know.. fine.."
@chixenlegjo2 жыл бұрын
I gotta make fith. It’s just required by this point.
@robinsonrojaslopez52002 жыл бұрын
Talk about Porth, is a modern stack programming language
@yomama1938j2 жыл бұрын
Have you considered doing a video on game builder garage.
@BAgodmode Жыл бұрын
“I’m gonna make a joke language, and nerds in the future will use it to write Linux kernel modules in 1991. Also there will be a thing called Linux. Anyways, done clocking out for the day, gonna go smash some gash and smoke some grass” - Chuck Moore, being a chad.
@jenniferw8963 Жыл бұрын
Hrmm..seems like Forth would of been the appropriate programming language for the HP 48GX.. Love my old HP 48GX and RPN :)
@ianferguson50432 жыл бұрын
Great video, keep it up
@KatzRool2 жыл бұрын
4:16 saving this
@lukedeets50162 жыл бұрын
Awesome videos!
@GeorgeTsiros2 жыл бұрын
'if' is the beginning of the entire if-then-else process. it pops the flag from the stack. the runtime also starts iterating through the rest of the program looking for "else" and "then" words. the words if, then and else mark the starts and ends of blocks. in RPL (sister language to FORTH), you _could_ do 2 MOD IF 0 == THEN "even" ELSE "odd" END (and 1 DISP 7 FREEZE if you want the string to be shown on the screen instead of on the always-shown data stack) or 2 MOD 0 == IF THEN "even" ELSE "odd" END OR you could use the true RPN 💪😤 words IFT/IFTE 2 MOD 0 == "even" "odd" IFTE in SysRPL the same would be a bit more verbose, but quite a bit faster and if there is an error the calculator would probably lose its memory :: CK1NOLASTWD %2 %MOD %0 %= ' :: $ "even" ; ' :: $ "odd" ; ITE ; if memory serves me right
@herzogsbuick2 жыл бұрын
Fantastic!
@otesunki2 жыл бұрын
tzoding approves
@somebody53292 жыл бұрын
5:50 loud sound warning(fixed, sry)
@Truttle12 жыл бұрын
fixed!
@davidgari3240 Жыл бұрын
Well done! Forth is way better than Third.
@LucasBucur7 ай бұрын
how do you use inputs?
@xmurrcattx34988 ай бұрын
oh yes, dup, the universal word for duplication in almost every single English speaking country, I'm glad we've discovered your mysterious secret.......
@adwaith-rajesh2 жыл бұрын
you should check out porth btw
@muchamadyja Жыл бұрын
The invertor still alive 😂
@alurma Жыл бұрын
Nice vid bro
@DLBeatty11 ай бұрын
Seems like BASIC with OCD.
@thomas37542 жыл бұрын
What did i just witness...
@yash11522 жыл бұрын
4:14 it has to end in then, as it's RPN
@I_Was_Named_This_Way...2 жыл бұрын
That outro music… it sounds wrong
@jomy10-games Жыл бұрын
So basically WebAssembly
@coppersundew2 жыл бұрын
I found your channel through r/place😄
@Truttle12 жыл бұрын
Cool! How did you find the channel though, since it’s just the logo on r/place?
@coppersundew2 жыл бұрын
@@Truttle1 I was on the critical role server, and I noticed them talking about your logo😄
@richardhall20611 ай бұрын
All the Forth programmers looking at the odd or even example crying out to remove the '0 =' and switch the terms. Faster!
@hgmlle2 жыл бұрын
homstuc
@Truttle12 жыл бұрын
jhon ebgert
@esolangsemerald63942 жыл бұрын
sudburbe
@thacuber2a032 жыл бұрын
i took my phone and the first thing i saw was this
@boscorner2 жыл бұрын
Forth!
@jangamecuber2 жыл бұрын
can we do fith next /j
@masonthedunce37112 жыл бұрын
awesome !!
@tschak909 Жыл бұрын
and again, your 99 bottles of beer example, can be broken up into a few different words, making it simpler to understand.
@Officialbear02 жыл бұрын
hey dude are you done with esolang why im gonna help you with batch proggraming language
@Truttle12 жыл бұрын
What?
@Officialbear02 жыл бұрын
@@Truttle1 yeah i know batch prrograming language
@Officialbear02 жыл бұрын
@@Truttle1 DUDE TRUST ME İ KNOW MAKEİNG BATCH FİLEEE
@cramble2 жыл бұрын
four words, Try Porth
@Blue-Maned_Hawk2 жыл бұрын
Great video! A couple things: you forgot to credit the usage of the XKCD you used, and the audio seemed a bit more echoey than normal. Otherwise, pretty cool!
@finlayl25052 жыл бұрын
Good video, then
@obvioustruth Жыл бұрын
I heard about forth when I was a kid, but I didn't expect it was so shitty.
@jumhig Жыл бұрын
I would just redefine "then" as "endif"...
@kornsuwin2 жыл бұрын
content
@normalcat2 жыл бұрын
firs- uhhh fourth
@mkDaniel2 жыл бұрын
You are second. Oh, you did that.
@normalcat2 жыл бұрын
@@mkDaniel well i wouldnt count truttle since hes able to post before 99% of people WITH notifications can even know it exists
@ibrahimsadk17782 жыл бұрын
wow
@official-obama2 жыл бұрын
i'll try to implement brain***k so i can program easier
@faraday41602 жыл бұрын
you seem sadder than usually everything alright?
@Truttle12 жыл бұрын
Yeah?
@DylanMatthewTurner2 жыл бұрын
Isn't forth the first esolang? I think the reason there are so many stack based esolangs is bc many are inspired by forth too not just bc it's a data structure that makes sense in the context of creating a simple esolang.
@Truttle12 жыл бұрын
It inspired many esolangs, but FORTH itself is technically not an esolang.
@StefanNoack2 жыл бұрын
It really does make writing a compiler easier. just look at this implementation of a forth compiler in forth (the ":" word, example taken from CollapseOS) : : ENTRY 1 ( compiled ) C, BEGIN WORD LIT" ;" S= IF COMPILE EXIT EXIT THEN CURWORD PARSE IF LITN ELSE CURWORD FIND IF DUP 1- C@ $80 AND ( imm? ) IF EXECUTE ELSE , THEN ELSE (wnf) THEN THEN AGAIN ; It just reads: Create a new entry in the dictionary, mark it as a "compiled word". Then repeat the following: If the next word is ; compile* the exit word, and then exit yourself, otherwise try to parse a number and put it as a literal, 'but if it wasn't parsable as a number, find the word in the dictionary. if it has the immediate flag set, execute it now (this the hijack point for adding new compiler features), else write it at the end of the word being compiled (the word doing the writing is "," which is easy to miss...). Else (if the word was not found) go to the word not found (wnf) handler. But not only esolangs use the simplicity of the stack machine, "intermediate languages" such as MSIL or WebAssembly are also stack based, which makes it easier to write backends for many different platforms, I guess. Probably code optimization also works very well with this approach. * the COMPILE word does nothing more than finding the word, then writing the reference to it at the end of the current word, but without all the stuff regarding the immediate flag
@SimonClarkstone2 жыл бұрын
Ah, I see that ":" in that Forth contains the whole compiler mode, rather than just starting a word and switching the parser to compile-mode. That is clever, but makes compilation very hard to separate from :-definitions though.
@HansBezemer2 жыл бұрын
@@Truttle1 IMHO it's NOT an esolang. Esolangs are basically works of art - not workhorses. With (net) 35 yrs of Forth programming under my belt and more than 50 KLOCs of Forth code - both private and professional - I can definitely state it's NOT an esolang. Some examples: (1) It took a guy a full day of work to merge a dozen CSV files to one consistent dataset. I wrote a program in 5 working days. The estimate to do the same thing in C by an external company was three man months; (2) I once hacked a simple LDAP converter in an hour or two. The guy who asked me to was impressed and asked for the source. Then he opened the paper drawer - and I asked him why. He said: "There's only one page coming out, so I supposed it was out of paper"; (3) Late 90-ies, early noughties a guy from networking came in with a Cisco XML file - and needed a CSV. He asked me if I could do anything - but didn't expect much, because "you need quite some lib to parse this stuff". I treated the tags as commands - which is easy in Forth. I had a workable solution the same afternoon; (4) Some files had to be merged and generate a new file. Forth produced a 30-50K executable. Later the guy came in and asked me to "make it a PHP script - because if the program was so small, it couldn't amount to much". The program contained a DBMS, an RFC 4180 implementation and an INI file interpreter - and no: it didn't require any .DLLs.
@pauldusa Жыл бұрын
Autostart
@motzyt2 жыл бұрын
finally!
@bbarte2 жыл бұрын
Your voice changed a lot
@yash11522 жыл бұрын
4:14 the video is nice but the pace is not what i like. offtracked needlessly long all around.