Brainf**k in 100 Seconds

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 4,6 тис.

  • @marty-mammel
    @marty-mammel 3 роки тому +36475

    my encephalon hurts!

    • @alek3y
      @alek3y 3 роки тому +191

      yay!

    • @4444altan
      @4444altan 3 роки тому +193

      Oh damn you were faster than me gg!

    • @Safeboot
      @Safeboot 3 роки тому +90

      damn! well played.

    • @Fireship
      @Fireship  3 роки тому +1403

      🤯 WINNER! Well done. Send me an email or slack DM with your t-shirt size and mailing address.

    • @totallyrandom4664
      @totallyrandom4664 3 роки тому +153

      @@Fireship but how do you know it's him that mailing you? Small doubt 😊

  • @nartallaxrwefwetg5627
    @nartallaxrwefwetg5627 3 роки тому +26486

    One thing to add - it's not just "turing complete", it's very close to original Turing machine, so no surprise it is turing complete.

    • @levyroth
      @levyroth 3 роки тому +730

      No computer is really a complete Turing machine because we don't have unlimited memory space.

    • @multiarray2320
      @multiarray2320 3 роки тому +1277

      @@levyroth but the language is turing complete

    • @Kitulous
      @Kitulous 3 роки тому +709

      @@levyroth yeah but Brainfuck is just a bunch of cells with a pointer, sounds awfully close to a Turing machine

    • @gJonii
      @gJonii 3 роки тому +300

      @@levyroth Turing-complete in that, any turing machine X could be simulated, as long as we give the computer access to some M_X of memory, and t_X time. As long as you can expand the memory of the system somehow, it works well enough.
      Basically, instead of physical machine, when speaking of turing completeness or not, you tend to talk about hypothetical version of that machine that has Just Big Enough hard drive attached.
      It's a bit wacky but afaik it's still "here be dragons" type deal with memory-limited computation limits. You have busy beaver function and... Uh, that's it?

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 3 роки тому +75

      @@multiarray2320 Technically it's not Turing complete even in theory, because the specification restricts it to 30,000 cells, not any implementation.

  • @etialpti9930
    @etialpti9930 3 роки тому +18500

    I tried to make a silly little program in bf and realized learning assembly would be much easier

  • @eleah2665
    @eleah2665 3 роки тому +11847

    Sounds promising. I look forward to the full course.

    • @alemalohe
      @alemalohe 3 роки тому +63

      😂

    • @armeli
      @armeli 3 роки тому +308

      Well.. this is actually all there is to it :D

    • @Xyzgamershub
      @Xyzgamershub 3 роки тому +32

      😂😂😂
      Savage

    • @stretch654
      @stretch654 3 роки тому +97

      Udemy probably has one.

    • @TwoLeggedTriceratops
      @TwoLeggedTriceratops 3 роки тому +69

      You’ll be lookin forward alright, into the dark abyss of your inner sanctum.

  • @TheParrot5
    @TheParrot5 Рік тому +564

    [ start loop
    ] end loop
    . print value
    ; save value
    > move cell pointer forward
    < move cell pointer
    backwards
    - decrement cell
    + increment cell

    • @AUTTP911
      @AUTTP911 6 місяців тому +6

      Tnx

    • @shadmanfatin777
      @shadmanfatin777 5 місяців тому +6

      Where's comma (,) to input values?

    • @thedoubledeckerhat4416
      @thedoubledeckerhat4416 4 місяці тому +8

      And people complain it's hard to comprehend 🤣
      *This is a joke. Please don't kill me

    • @lightning_11
      @lightning_11 4 місяці тому +1

      Thank you

    • @Learning-GameandCoding
      @Learning-GameandCoding 4 місяці тому

      ​​​@@thedoubledeckerhat4416Are you sure about your last 4 words🌚?

  • @user-he4ef9br7z
    @user-he4ef9br7z 3 роки тому +46561

    Invent a usable language and developers will complain about it.
    Invent an esoteric language and it will be appreciated forever.

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 3 роки тому +2960

      Ties in really nicely to Bjarne Stroustrup's quote (creator of C++):
      _"There are only two types of languages, one that people complain about, and the other that no one actually uses"_

    • @pizzacheeseman2854
      @pizzacheeseman2854 3 роки тому +449

      My only “popular” repo is for an incredibly shitty joke language compiler I wrote

    • @zaccstacc4568
      @zaccstacc4568 3 роки тому +149

      Except the one that is complained about a ton is the most used language ( cough javascript cough python cough ), and the most appreciated one is barely ever used for anything practical lol

    • @sof4183
      @sof4183 3 роки тому +16

      @mane i like it

    • @LuanHimmlisch
      @LuanHimmlisch 3 роки тому +43

      @mane working with prototypes is more confusing than brainfuck. Like, why the hell 'this' returns me the window instead of the class?!

  • @leemokid
    @leemokid 2 роки тому +4662

    Got bored in highschool so I spent all year learning this language. By the end of the year, best I had was a text based tic-tac-toe where you entered a number 1-9 and it would then print the tic-tac-toe board in text. Repeat this 9 times and boom, a complete game. It was hundreds, if not thousands of lines of code to do it and very inefficient

    • @Jasomniac
      @Jasomniac 2 роки тому +533

      Did python or C not exist at the time or did you just want to torture yourself?

    • @latermyfriend8934
      @latermyfriend8934 2 роки тому +385

      Sounds like you're pretty proud of that achievement.

    • @blacksabbath5300
      @blacksabbath5300 2 роки тому +335

      @@latermyfriend8934 he said at the end to do it inefficient... And uh, for brainfuck, that's actually pretty good.

    • @darkergen
      @darkergen 2 роки тому +52

      bf is meant to hurt brains hence the name, bf

    • @TheMashmeister
      @TheMashmeister 2 роки тому +16

      I want to Like this comment but cant. 420 likes is such a nice number to ruin

  • @Mr.Coffee576
    @Mr.Coffee576 3 роки тому +9070

    So its like the Dark Souls of programming.

    •  3 роки тому +926

      More like the "Getting Over It" of programming, designed to be minimal, hard, with one all purpose tool and once done you are left to ponder why you did you even start.

    • @luckyskull3531
      @luckyskull3531 3 роки тому +201

      Nah, Dark Souls is a rhythm game this is just fuckin blasphemy haha

    • @fabrimuch
      @fabrimuch 3 роки тому +89

      When a bug occurs you have one chance to rewrite your code to fix it but if it happens again the next time it's run the entire codebase is deleted forever

    • @vnie1988
      @vnie1988 3 роки тому +74

      Dark Souls is written in Brain Fuck

    • @Abu_Ubaida9
      @Abu_Ubaida9 3 роки тому +45

      the most just thing to do is to force dark souls developers to make darksouls only using bf, that would be fun to see, justice at it's peek

  • @ibnbhai
    @ibnbhai Рік тому +50

    as a person who did not understand a single word you said, i must say, you explained it rarther well

  • @21Blankenship
    @21Blankenship 3 роки тому +1902

    lol I didn’t ever expect you to cover this one

    • @CariagaXIII
      @CariagaXIII 3 роки тому +10

      i expected this to be covered. eventually

    • @herrxerex8484
      @herrxerex8484 3 роки тому +2

      @@CariagaXIII mooooooooMmmmooOo

    • @hugazo
      @hugazo 3 роки тому +5

      I was expecting this one for april's fools

    • @TheBitenix
      @TheBitenix 3 роки тому +2

      @@hugazo I am still making sure it is not April Fools

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 3 роки тому +1

      @@PalmDevs Cow language is uninspired. It's a textual replacement of brainf*ck. I just need to replace the tokens in my brainf*ck interpreter with the Moo variants and it works.
      It's still fun though 🚀🚀

  • @kaimba14
    @kaimba14 2 роки тому +3062

    he picked a perfect name for a physics student creating a programming language, but he did achieve his goal for creating language with smallest possible compiler so kudos for that

  • @DoctorPlasmaMC
    @DoctorPlasmaMC Рік тому +569

    One of the things you didn't have time to explain is why -5, then +3.
    By starting with 1, one subtraction of 5 rolls over to 252. the second slot is incremented to 3.
    There's a lot of modulus arithmetic going on here.
    After 50 more loops (51 total) your values are 2 and 153.
    then subtracting 5 again rolls over again to 253 (and 156 now)
    another 51 loops and you're to 254.
    another 51 loops and you're to 255.
    another 51 loops and you're to 0 and end.
    At this point the second +3 slot will have added a total of 615, rolling over after 255 each time, so the desired output is reached, 103.
    What I haven't yet solved is how this "start 1, minus 5, plus 3" mod 256 algorithm to produce 103 was designed.
    There has to be a simple approach to say "I wish for this number" and pick 1,5,3 with a calculator.

    • @ThreeTrees475
      @ThreeTrees475 Рік тому +10

      Translate.

    • @ThreeTrees475
      @ThreeTrees475 Рік тому +7

      Math god.

    • @flaps_acd
      @flaps_acd Рік тому +20

      thanks i was wondering about how this works!

    • @abhi-ru3is
      @abhi-ru3is Рік тому +21

      Thank you for explaining it mods because I was losing my mind. I would just do like 10 + and then have it increment 10 times in the loop go to the first cell and decrement once.
      But this is cool.

    • @sharpcircle6875
      @sharpcircle6875 Рік тому +22

      I didn't understand shit until I noticed that the whole 256 8-bit limit looped over when incremented or decrement at both sides of the interval lol.
      But that really masochistic way of inputting numbers and I'm pretty sure even assembler is more straight-foward :v

  • @Adeyum64
    @Adeyum64 2 роки тому +1686

    We had to program with brainfuck once in college. And trust me, it was so damn difficult to:
    1. understand the language
    2. not bursting out laughing everytime the professor said brainfuck

  • @ThomasProsserZurich
    @ThomasProsserZurich 2 роки тому +634

    Fun fact. There is a language called Whitespace which works a lot like Brainf**k just only uses - well - whitespace characters (line feeds, spaces, tabs, qou get the point, and you can probably imagine what a file of Whitespace code looks like). A colleague of mine and I were studying at the same school as Müller (the Swiss Federal Institute of Technology). My colleague chose to code a Brainf**ck to Whitespace converter. For purely scientific reasons of course.

    • @Revermb
      @Revermb Рік тому +79

      god, why tf would anyone do that.
      sounds like fun, ima go do it aswell

    • @dripz_tlg3447
      @dripz_tlg3447 Рік тому +50

      @@Revermb noooo ur gonna spend way too much time on it and then regret ever commitiong to such a monsterous project. anyways good luck

    • @-thanawat-8296
      @-thanawat-8296 Рік тому +1

      holy

    • @ursaeminooris
      @ursaeminooris Рік тому +6

      is the name an omori reference/j

    • @Paulo27
      @Paulo27 Рік тому +5

      Is the converter written in bf or whitespace though?

  • @kotokrabs
    @kotokrabs 2 роки тому +4447

    Until around 1:50 i thought this video is designed to f#ck your brain like some kind of illusion. But then I realized that he wasn't saying and showing some random stuff.

    • @Zeus_Was_Here
      @Zeus_Was_Here 2 роки тому +9

      You made my day =))

    • @Kobekola
      @Kobekola 2 роки тому +291

      Ironically if you don't understand operating systems this was still 100 seconds of brainf*ck

    • @shaansingh6048
      @shaansingh6048 2 роки тому +29

      this is what it's like to not understand tech lol

    • @JustapErson
      @JustapErson 2 роки тому +12

      The fact that people still use blatant clickbait is shameful.

    • @bleedinghearts4768
      @bleedinghearts4768 2 роки тому +1

      LMAOOO ME TOO! I feel so stupid 🤣

  • @JangoF12b
    @JangoF12b Рік тому +58

    I have no idea what I just witnessed and no idea on how to comprehend it. Amazing work of art.

  • @rfn900
    @rfn900 3 роки тому +4061

    It all made sense when you mentioned it was invented by a physics student!

  • @WalkinChristum
    @WalkinChristum 2 роки тому +860

    I feel x10 smarter after watching this video, even if I don't understand much

    • @sibanbgd100
      @sibanbgd100 2 роки тому +8

      Dunning Kruger is that you?

    • @Japhnac
      @Japhnac 2 роки тому +19

      0x10 is still 0

    • @Japhnac
      @Japhnac 2 роки тому

      @David. ... how would 0x10 be 16

    • @Japhnac
      @Japhnac 2 роки тому +1

      @David.

    • @Muwahid999
      @Muwahid999 3 місяці тому

      @@Japhnac He would be talking about hexadecimal 16

  • @rhy_rhy_rhy
    @rhy_rhy_rhy 3 роки тому +252

    Notice how he didn't do the usual "if you want a full course on this language, let me know in the comments below" for this one.

    • @eeriemyxi
      @eeriemyxi 2 роки тому +15

      @@jon-h lmao

    • @f.n.8540
      @f.n.8540 Місяць тому +1

      This is a full course wdym

  • @HartleySan
    @HartleySan Рік тому +112

    For about 12 microseconds, I felt the need to write an interpreter to convert a higher-level language to BF, and then I realized, wait! that's what compilers already do for machine code. Never mind!

    • @BurrritoYT
      @BurrritoYT 11 місяців тому +1

      fr

    • @xWatexx
      @xWatexx 10 місяців тому +1

      I thought the exact same thing

  • @SkyyySi
    @SkyyySi 2 роки тому +1588

    I think that bf could actually do with even less characters: Instead of using -, we could cause intentional overflows to reset a character.

    • @wwsciffsww3748
      @wwsciffsww3748 2 роки тому +240

      And instead of using >, you could go right until it loops back around

    • @SkyyySi
      @SkyyySi 2 роки тому +123

      @@wwsciffsww3748 Oh you're right. Since bf has a finite length (usually 30,000 bytes), that should also be possible

    • @__8120
      @__8120 2 роки тому +82

      @@SkyyySi except I believe it is only Turing complete in the hypothetical case of having an infinite tape length

    • @__8120
      @__8120 2 роки тому +38

      @Kanashimi except the whole point is that a language or concept is turing complete, not a physical implementation. You're right, nothing in the real world is technically turing complete

    • @__8120
      @__8120 2 роки тому +18

      @Kanashimi correct. I'm just saying if you want it to be Turing complete you still need instructions to go both ways because looping around to the end isn't an option

  • @FEED_EZ
    @FEED_EZ 3 роки тому +293

    Programmers: why?
    Müller: why not?

    • @QCAlpha-212
      @QCAlpha-212 3 роки тому +8

      As programmers with, theoretically, all the digital world at our mercy, the answer is always: Why not?

  • @fawzanfawzi9993
    @fawzanfawzi9993 3 роки тому +1891

    No way VSCode actually has syntax highlighting for BF.

    • @leoingson
      @leoingson 3 роки тому +401

      Of course there are at least 3 extensions for exactly that, one has 9k downloads.

    • @shadamethyst1258
      @shadamethyst1258 3 роки тому +302

      Syntax highlight extensions are quite easy to write, and brainfuck is like the easiest to parse, all you need are two regexes

    • @nemesisurvivorleon
      @nemesisurvivorleon 2 роки тому +110

      not much to highlight

    • @reda29100
      @reda29100 2 роки тому +17

      @@leoingson some people just want to see the world burn, the other 9k are smuggling lighters to the rest.

    • @slonkazoid
      @slonkazoid 2 роки тому +6

      the markdown spec has it

  • @si-arc
    @si-arc 2 роки тому +16

    "manipulating memory like cavemen" got me. But also very accurate.

  • @lisaschuster9305
    @lisaschuster9305 2 роки тому +350

    This is much smarter and more interesting than I would originally have thought. Thanks for the video! It was insightful.

  • @ueberchild
    @ueberchild 2 роки тому +352

    if you wonder how we got to 103 at 1:34:
    the first number is 1 before the loop, the second is 0, all unsigned 8-bit integers
    the loop is executed 205 times, it decreases the first by 5 and increases second by 3 every iteration
    so the first becomes (1 - 205 * 5) % 256 = 0 (allowing the loop to end), the second becomes (0 + 205 * 3) % 256 = 103

    • @edvinsjudins1109
      @edvinsjudins1109 2 роки тому +10

      why is the loop executed 205 times?

    • @UQMD
      @UQMD 2 роки тому +2

      why does the first cell undergo modulus?

    • @ueberchild
      @ueberchild 2 роки тому +16

      @@edvinsjudins1109 because on every other iteration the first cell is not zero, which is required to stop the loop

    • @ueberchild
      @ueberchild 2 роки тому +23

      @@UQMD all the cells are unsigned 8-bit integers, so they are overflowable, e.g. 253 + 3 is actually 0 (mod 256)
      256 is 2^8

    •  2 роки тому +10

      omg, thanks for that! I was staring at the screen thinking about it but I just couldn't believe I was in the right path

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 3 роки тому +591

    What a coincidence lol! I was learning Rust and just built a Brainf*ck compiler yesterday.
    I also added a new operator _$_ that simply prints out the number by interpreting it as a number instead of an ASCII codepoint. This removes a lot of clutter found in brainf*ck code.

    • @ChaoticNeutralMatt
      @ChaoticNeutralMatt 3 роки тому +36

      For some reason, I found this hysterical

    • @ThomasGodart
      @ThomasGodart 3 роки тому +107

      You're going in the wrong direction. BF was invented to have as few commands as possible, and to be as hard to use as possible at the same time, while being theorically capable of doing anything. Hint: there is another version of BF with as few as 6 commands, because two of the 8 main BF commands can in fact be obtained with the 6 others. That's the way!

    • @nonadqs
      @nonadqs 3 роки тому +27

      @@ThomasGodart Stop telling people to respect the simplicity of an esoteric, joke language

    • @drewsarkisian9375
      @drewsarkisian9375 3 роки тому +61

      @@nonadqs You miss the meta-point. The language isn't meant to be used, so what's the point of adding to it? Creating a MINIMAL language that could theoretically do things IS the point, and the joke.

    • @Alche_mist
      @Alche_mist 2 роки тому +25

      @@drewsarkisian9375 That said, nowadays, this - the thing OP and many other did - is what is Brainf*ck used the most as of now. That is, for people to learn the basics about compilers and to have a defined problem for training a very particular skillset and ideas. As that, I see OP's work - yes, even including the clutter-removing expansion - as an absolute win. It's not honoring the _original_ idea of the language, but it very much is honoring OP's intent with the concept.

  • @GillyTech
    @GillyTech Рік тому +4

    I have never seen a more clear explanation than this for brainf*ck. Bravo!

  • @oskrm
    @oskrm 3 роки тому +400

    Idea: Service workers or caching in general, and maybe WPAs.

    • @israelssantanna
      @israelssantanna 3 роки тому +40

      Written purely in brainf*ck?

    • @oskrm
      @oskrm 3 роки тому +33

      @@israelssantanna What else, I'm sure it can be compiled to webassembly

    • @fairyanimal
      @fairyanimal 3 роки тому +2

      *WAP

    • @sudoalex
      @sudoalex 3 роки тому +2

      PWAs?

    • @akunformalitas
      @akunformalitas 3 роки тому +2

      JSF*ck actually exists and might be more feasible

  • @00euclid
    @00euclid 3 роки тому +130

    Had to write a whole python script just to check what happened with the first letter over there, didn't know with subtractions it goes back to 255 after 0 and with additions, after 255 it goes back to 0, obviously due to overflow.
    def test_255(num: int) -> int:
    if num < 0:
    return 256 + num
    elif num > 0:
    return num
    else:
    return 0
    def main() -> None:
    num: int = 1
    counter: int = 0
    while num != 0:
    num = num - 5
    print(num)
    num = test_255(num)
    counter = counter + 1
    print(f"Iterations --> {counter}")
    if __name__ == "__main__":
    main()
    ## Output: 205
    So the loop runs 205 times and it adds 3 to each time leading to 615, which after accounting for the overflow leaves 103.

    • @Grimtheorist
      @Grimtheorist 2 роки тому +20

      Thank you, I was trying to figure this out with just a calculator, heh..

    • @No.ah.
      @No.ah. 2 роки тому +10

      @@Grimtheorist Thanks for your help guys, standing here with the calculator and a Python-script open. :')

    • @TheHotIcedTea
      @TheHotIcedTea 2 роки тому +15

      this was the comment I was looking for, thank you!

    • @John14073
      @John14073 2 роки тому +7

      thank you for doing the legwork - i wasn't 100% certain at first how he was able to reach 103 like that

    • @TuringMachine001
      @TuringMachine001 2 роки тому +2

      You can also do modular arithmetic to solve this. If k is the number of times the body of the loop runs, then 1 - 5 k = 0 mod 256. Plugging this into WolframAlpha or solving by hand, you get k = 205 mod 256, so the loop runs 205 times.

  • @tamaskovacs-ajtai7489
    @tamaskovacs-ajtai7489 3 роки тому +62

    I didn't know what I wanted for christmas. You just gave me a perfect surprise. Always interested how this works, but never took the time and focus to do it myself. Thank you very much!

  • @eyesicecold
    @eyesicecold 8 місяців тому +9

    2:00 is the funniest part in my opinion, because the bleep isn’t even. “This has been Brainfuc*”

  • @baggier
    @baggier 3 роки тому +40

    now im willing to buy fireship pro to find more content about this language

    • @oskrm
      @oskrm 3 роки тому +3

      I see a bright future for this language, 2022 trending

    • @vaisakh_km
      @vaisakh_km 3 роки тому

      Because HR s are getting dummer... We have to make more apps like ticktok to get job...

    • @goteer10
      @goteer10 2 роки тому

      There is no more content, only programs

  • @RayDragonfly
    @RayDragonfly 2 роки тому +90

    For those having trouble understanding how the loop works I've illustrated it:
    We have two cells:
    [0][0]
    ^
    We're incrementing the first cell by 1:
    [1][0]
    ^
    Then we enter the loop and decrement the first cell 5 times:
    [0][0]
    ^
    [255][0]
    ^
    [254][0]
    ^
    [253][0]
    ^
    [252][0]
    ^
    Then we move one cell to the right:
    [252][0]
    ^
    We then increment the cell 3 times:
    [252][1]
    ^
    [252][2]
    ^
    [252][3]
    ^
    Then we move one cell to the left:
    [252][3]
    ^
    Now we repeat the loop until the first cell becomes 0, both cells have to underflow/overflow several times:
    Add 256 when underflowing (Going below 0)
    Subtract 256 when overflowing (Going above 255)
    [252][3]
    ^
    (Loops 50 times)
    [-250][+150]
    [2][153]
    ^
    [253][156]
    ^
    (Loops 50 times)
    [-250][+150]
    [3][51]
    ^
    [254][53]
    ^
    (Loops 50 times)
    [-250][+150]
    [4][203]
    ^
    [255][206]
    ^
    (Loops 51 times)
    [-255][+153]
    [0][103]
    When the first cell equals 0 we exit the loop
    You can apply these principles to all of the loops shown to find the correct values!

    • @MarkO-tu9dh
      @MarkO-tu9dh 2 роки тому +10

      you a real one for this, I understand it now haha

    • @muhammadhaque8118
      @muhammadhaque8118 2 роки тому

      Here is another way to arrive at a similar result, except that it yields [103][0] instead of [0][103] :
      >++++++++++[-]

    • @majorgeneralrahul6298
      @majorgeneralrahul6298 2 роки тому

      Thanks

    • @caterpillow
      @caterpillow 2 роки тому

      hey i know u

    • @LGseeker
      @LGseeker 2 роки тому +1

      That makes a lot of sense now

  • @RexVelde
    @RexVelde 3 роки тому +49

    Love this kind of vids! Esoteric languages are always fun, so I would love to see more videos covering them.

  • @breytonpabst1009
    @breytonpabst1009 Рік тому +14

    Damn he really did say hi mom…

  • @TheRonpe
    @TheRonpe 3 роки тому +173

    This language has potential to be a successor for JavaScript.

  • @NourArt02
    @NourArt02 2 роки тому +89

    Every other programming language: "Hello World!"
    Brain F**k: "Hi Mom"
    Edit: Thanx Red Point for "pointing" that out.

    • @redpoint6870
      @redpoint6870 2 роки тому +3

      It's "Brain" how did you mess it up?

    • @noobracerz6964
      @noobracerz6964 2 роки тому +7

      @@redpoint6870 His brain really got f**ked that's why he messed it. 😆

    • @alexandermcclure6185
      @alexandermcclure6185 5 місяців тому

      Me: Fine. I'll do it myself.
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------.------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++.+++.------.--------.-------------------------------------------------------------------.

  • @bruhgamer317
    @bruhgamer317 3 роки тому +206

    great way to get into making compilers and interpreters, even as a total novice you can get something working in a single day

    • @sebastiangudino9377
      @sebastiangudino9377 3 роки тому +9

      I remember seeing a pretty fun implementation using only c macros

    • @ozenthelewdable5427
      @ozenthelewdable5427 2 роки тому +3

      From making compilers to becoming an actual brainfuckery physicist.

    • @-Burb
      @-Burb 2 роки тому +1

      Yeah I was able to create a brainfuck interpreter in literally 20 minutes. I thought it would be a fun little challenge to work on for a few hours but didnt realize just how easy it would be.

  • @revenevan11
    @revenevan11 2 роки тому +165

    You should do one using the pikachu language! It just uses a few words that are things that pikachu says, like "pika"
    There's a mission statement about it being made based on pikachu language instead of human language, to make coding more accessible to pikachus, which are an underrepresented minority in the industry 😅
    So a few years ago I made a simple program with it to add 2 inputted numbers together... and found out that the online interpreter for it was treating the input as strings, and just concatenating 1+1 to get 11... but iirc multiplication worked 🤦‍♂️ so basically the only place I found to run it was a flawed implementation that didn't follow the official pika syntax /standard 😫

    • @Ok-_-719
      @Ok-_-719 Рік тому +7

      This language sounds really interesting. I looked it up and it’s called Pikalang

    • @aurelia8028
      @aurelia8028 Рік тому +2

      lol

    • @alexgreene7110
      @alexgreene7110 10 місяців тому +1

      I just looked this up and literally cried laughing. Thank you for this. ♥️

  • @thegreatbambino3358
    @thegreatbambino3358 2 роки тому +60

    I had a school project where I had to output all the lyrics of 99 bottles of beer on the wall using brainf*ck and then give a presentation on the language. It was actually quite fun to talk about making functions that generated the brainf*ck code for me in I think perl.

  • @thatfriendwhomovedaway6889
    @thatfriendwhomovedaway6889 2 роки тому +555

    That code at the end is probably "Never gonna give you up" because it looks like it would match the length of the code, considering that each letter that should be printed needs a lot of brackets and other stuff in the code.

    • @ng1n369
      @ng1n369 2 роки тому +47

      This is a wise man right here

    • @Mostbee
      @Mostbee 2 роки тому +13

      But actually, the video says it's only outputted by a dot and you can store a value and make loops to avoind longer code too, so double dots means 2 indentical letters one after another...
      There's more than 50 dots there, so maybe it's a long text

    • @thatfriendwhomovedaway6889
      @thatfriendwhomovedaway6889 2 роки тому +19

      @@Mostbee I mean never gonna give you up is a long text in its full length

    • @Mostbee
      @Mostbee 2 роки тому +3

      @@thatfriendwhomovedaway6889 Well, that's true

    • @NareshBharasagar
      @NareshBharasagar 2 роки тому +8

      Executed the first few letters, it begins like "what a".

  • @RinkieGeintie
    @RinkieGeintie 2 роки тому +291

    fun fact: this language is so simple that it has been recreated in a Geometry Dash level

    • @Flo-rq8by
      @Flo-rq8by 2 роки тому +13

      What the hell?! 😂
      But does that mean you can program inside the game?

    • @RinkieGeintie
      @RinkieGeintie 2 роки тому +16

      @@Flo-rq8by No they just used the triggers

    • @alexandruracz9995
      @alexandruracz9995 2 роки тому +24

      @@RinkieGeintie I mean he did create a GD programing language as well

    • @RinkieGeintie
      @RinkieGeintie 2 роки тому +1

      @@alexandruracz9995 yeah thats true

    • @Skywalker2016GD
      @Skywalker2016GD 2 роки тому +12

      Ah yes, brainfugd

  • @MattTacc
    @MattTacc Рік тому +1

    Someone made this in Geometry Dash. Fucking Geometry Dash.
    "Brainfugd by Spu7nix"

  • @shalomcastelino4805
    @shalomcastelino4805 2 роки тому +46

    0:13 Urban Muller literally looks like Michael Reeves

  • @armeli
    @armeli 3 роки тому +32

    Creating an interpreter for bf in any language you start learning is a fun beginner project. I had no prior experience with coding when I took a beginner class in C#. After a few lessons when we had covered how loops work I made myself an bf interpreter. The most complicated thing is how to handle the [ and ] signs correctly, but it doesn't require much knowledge in coding and it's more like a logic puzzle.

  • @aethar2750
    @aethar2750 2 роки тому +16

    Things like this make me appreciate how much abstraction and normal understandable code helps our tiny little human brains

  • @nikolascsgo
    @nikolascsgo Рік тому

    super funny how he started caring less and less about beeping out brainfuck the longer the video went on

  • @sadeepaalwis5938
    @sadeepaalwis5938 3 роки тому +213

    at this point i wouldn't be surprised if another language pops out like "Holy $#!t" and fireship did a 100 second video about it

    • @JustPlayerDE
      @JustPlayerDE 3 роки тому +23

      technically there is HolyC which can be understood as "Holy $#!t" if said weird

    • @softwarelivre2389
      @softwarelivre2389 3 роки тому +13

      @@JustPlayerDE Is that the language used to create TempleOS?

    • @NozomiClips
      @NozomiClips 3 роки тому +10

      @@softwarelivre2389 yep

    • @imaginaoYouTubesoquecomarrobas
      @imaginaoYouTubesoquecomarrobas 3 роки тому +14

      btw there are other weird languages with weird or funny names from the likelyhood of brainf**k in terms of unconventional design, that are known under the name of "esoteric programming languages", or "esolangs" for short. I would like to highlight APL (litterally an acronym for "A Programming Language", and is one of the first esolangs ever being created), the Shakesperian Programming Language (a language whose scripts can also be interpreted in a really weird play) and Piet (an image-based esolang that allows you to draw art in any place that isn't code)

    • @sadeepaalwis5938
      @sadeepaalwis5938 3 роки тому

      @@imaginaoUA-camsoquecomarrobas omg

  • @JoshingYouu
    @JoshingYouu 3 роки тому +14

    So happy you made a video on this. It’s been one of my favorite languages for but now and is what got me into esoteric languages in the first place.

  • @enkryp
    @enkryp 3 роки тому +26

    - What is the simplest programming language?
    - BF, it has only six simple commands and nothing more

    • @junosoft
      @junosoft 3 роки тому +5

      8

    • @vaisakh_km
      @vaisakh_km 3 роки тому +1

      When I was in school l,I actually thought why I can't make a programming language that has minimum number of symbols.... So people don't need to study a lot...
      Then only i came to know about this lang and understand it will be a f..Up language.

    • @exedeath
      @exedeath 2 роки тому

      The simplest one is unary, its basically this one, but first symbol is converted to 0, the second is now 1, the third is 2 and this goes on. After you have all those numbers in order, you add a 1 before the first number and convert this huge number to unary ( basically 3 is 111, 5 is 11111, 2 is 11 and this goes on).
      This one has just one symbol.
      There is also a golfcode one (forgot the name), instead of converting to unary you dont, and there are an extreme amount of golf code langueges, one called language 1, other called language 2, and this goes on and one. if the language you are compiling is "language 12345", by compiling a empty file from this language it will compile the program with the code 12345, if the code is not empty, it will compile brainfuck.

  • @CrisNepuleon-yy6un
    @CrisNepuleon-yy6un 8 місяців тому +1

    Bro, honestly, i didn't believe that was the actual name

  • @MarkB..
    @MarkB.. 2 роки тому +19

    I'm going to forget all of this in about 20 seconds but thank you for teaching me this

  • @ksjitendra18
    @ksjitendra18 3 роки тому +20

    Recruiter: Why you have mentioned hello world program in your resume?
    Me: Sir I wrote that in BrainF**k
    R: You are hired

    • @buddhavskungfu
      @buddhavskungfu 3 роки тому +2

      That actually seems like a legit idea.

    • @alexandermcclure6185
      @alexandermcclure6185 5 місяців тому

      plot twist you just wrote
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------.------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++.+++.------.--------.-------------------------------------------------------------------.
      instead of using clever loops

  • @Roads_india
    @Roads_india 3 роки тому +16

    Fireship is one of the very few channels i follow to learn computers. It is very unique and fun too. Keep going and do great things ❤️

  • @Phanto.
    @Phanto. Рік тому +2

    brainf**k
    In computing: 🤯
    In nhentªi: 💀

  • @jaysonbunnell8097
    @jaysonbunnell8097 3 роки тому +46

    Y’know what though, this is way more interesting than I thought. I may try writing in brainf**k sometime
    edit: wrote a brainf**k interpreter in JS (still working on the input to be portable). Super fun challenge. 10/10!

    • @Dr.Schnizzle
      @Dr.Schnizzle 2 роки тому +16

      Great! Now write a JS interpreter in brainf**k ;P

  • @MotoCzar
    @MotoCzar 2 роки тому +85

    Interviewer: You have 30mins to solve. Which language will you program in?
    Me: _Brainfuck_

    • @Markomilicic012
      @Markomilicic012 2 роки тому +2

      Interviewer: we need 4 wishes for this ono

  • @MidnightSt
    @MidnightSt 2 роки тому +18

    I knew about Brainfuck, but this is the first time I've heard about its modern dialect, Brainfbeepk. Thank you, very informative.

  • @dragonegger2
    @dragonegger2 6 днів тому

    In my compiler design course this was the language we had to write a compiler for. Quite a lot of fun.

  • @notmilenakos
    @notmilenakos 3 роки тому +9

    i like how he completely missed censoring at 2:00

    • @notatallbruh2011
      @notatallbruh2011 Рік тому

      "this has been brainf%$# in 100 seconds"

    • @alexandermcclure6185
      @alexandermcclure6185 5 місяців тому

      @@notatallbruh2011 No, it was more like "this has been brainfuc* in 100 seconds"

  • @Ady-rt1yu
    @Ady-rt1yu 3 роки тому +9

    Amazing timing, I was just going to start using this on a project.

  • @DonVigaDeFierro
    @DonVigaDeFierro 2 роки тому +21

    I love those 2-minute videos that explain something so simply that I can think "Oh, yeah, I totally got this. Easy as hell." as long as I don't have to actually do the thing...

    • @benc589
      @benc589 2 роки тому +1

      This world is rapidly passing away and I hope that you repent and take time to change before all out disaster occurs! Belief in messiah alone is not enough to grant you salvation - Matthew 7:21-23, John 3:3, John 3:36 (ESV is the best translation for John 3:36) if you believed in Messiah you would be following His commands as best as you could. If you are not a follower of Messiah I would highly recommend becoming one. Call on the name of Jesus and pray for Him to intervene in your life - Revelation 3:20.
      Contemplate how the Roman Empire fulfilled the role of the beast from the sea in Revelation 13. Revelation 17 confirms that it is in fact Rome. From this we can conclude that A) Jesus is the Son of God and can predict the future or make it happen, B) The world leaders/nations/governments etc have been conspiring together for the last 3000+ years going back to Babylon and before, C) History as we know it is fake. You don't really need to speculate once you start a relationship with God.
      Can't get a response from God? Fasting can help increase your perception and prayer can help initiate events. God will ignore you if your prayer does not align with His purpose (James 4:3) or if you are approaching Him when "unclean" (Isaiah 1:15, Isaiah 59:2, Micah 3:4). Stop eating food sacrificed to idols (McDonald's, Wendy's etc) stop glorifying yourself on social media or making other images of yourself (Second Commandment), stop gossiping about other people, stop watching obscene content etc. Have a blessed day!

    • @dziolex2190
      @dziolex2190 2 роки тому

      @@benc589 stop baiting

    • @alexandermcclure6185
      @alexandermcclure6185 5 місяців тому

      @@benc589 (pinches your mouth) *S H U T .*

  • @rahulkesarkar2825
    @rahulkesarkar2825 2 роки тому +4

    Best language for beginners

  • @kirkkork
    @kirkkork 3 роки тому +32

    Awesome!
    My head hurts trying to figure this out, but this helps a lot, thank you!

  • @Dr_Doofenshmirts
    @Dr_Doofenshmirts 2 роки тому +20

    this looks like a nice language to use to communicate with people rather than using it to make programs, just thinking about using bf to make a simple program gives me the shivers

  • @apteryx
    @apteryx 3 роки тому +35

    I'm guessing the code at the end is something like "never gonna give you up"

    • @arandomuser1723
      @arandomuser1723 2 роки тому

      no it is "what a free t-shirt? be the first person to comment "my encephalon hurts!" "

  • @wescom.vallen
    @wescom.vallen 2 місяці тому +1

    "Brainf**k" counter:
    0:00 = 1
    0:57 = 2
    0:52 = 3
    0:58 = 4
    1:03 = 5
    1:57 = 6
    2:00 = 7
    2:03 = 8

  • @TheComedyGeek
    @TheComedyGeek 2 роки тому +31

    Thanks for this! I've always wanted to know more about this esoteric bit of programming trivia.

  • @1.Y.6
    @1.Y.6 3 роки тому +12

    Loving your videos man, keep up the good work!

  • @rohithk04
    @rohithk04 3 роки тому +88

    I would like to see an extended version please

  • @Among_us3.0
    @Among_us3.0 11 місяців тому +1

    My brain did not hurt though I think my brain just put it in categories

  • @jgggj9421
    @jgggj9421 2 роки тому +7

    Having an exam in an hour. Found the perfect video to watch!

  • @neizanmendez6317
    @neizanmendez6317 2 роки тому +4

    you know, after everything i've seen so far on the internet, this is by far the best possible result i could've imagined based on the term "brainfuck"

  • @pape_diack
    @pape_diack 3 роки тому +8

    Perhaps some day, some mysterious day, somebody will come up with a framework developed in this language.

    • @sebastiangudino9377
      @sebastiangudino9377 3 роки тому +1

      If you think about it, machine language is just branf**k. With the added operation of "mov" to write a value into a given "tape"(memory) location regardless of where the "head" (program counter register) actually is. And "jnz" as a macro that moves the head to a given location (using the previously defined mov), performs a check to see if it is zero (the definition of the [ ] operators) and then moved the head to either the previous location or the new provided location (another simple mov)
      And if we follow this mental stretch and concider machine code a superset of BF. Every single language is no more that a BF framework 😎

  • @3_14pie
    @3_14pie 11 місяців тому +1

    "manipulating memory like caveman" is the best thimg i've heard in a while, i'm actually laughing outloud

  • @phiarchitect
    @phiarchitect 2 роки тому +4

    I love how the beep comes after he has spoken the word :)

  • @sogzful
    @sogzful 3 роки тому +9

    how many years of experience do they want in this one now 😔

    • @miloserus
      @miloserus 3 роки тому +1

      For a junior position: 5 years experience with Brainf**k, and 42 years experience with any Malbolge backend framework.

  • @ferddd
    @ferddd 3 роки тому +7

    i am totally 0% sure that the next video would be *Cow in 100 seconds* :)

  • @mitsuzawa
    @mitsuzawa 2 роки тому

    that was sick, i hope they add some DLC for brainfug

  • @nemis123
    @nemis123 3 роки тому +30

    You can literally be 256 * 8 times faster if you just type machine code directly :D

    • @gregoryfenn1462
      @gregoryfenn1462 3 роки тому +11

      Machine code is too high level abstraction for this!

    • @NOT_A_ROBOT
      @NOT_A_ROBOT 3 роки тому +5

      why write machine code when you can manipulate logic ga- *ahem* transistors

  • @MrConcord75
    @MrConcord75 3 роки тому +52

    This video made me laugh more than I thought it would. Good job. I can see why it's called what it is. LMFAO

  • @cauebooks1383
    @cauebooks1383 3 роки тому +4

    It makes sense, after all, and makes you focus on logic. But, as mentioned, it's a work of art, not for ordinary usage.

    • @dutchdykefinger
      @dutchdykefinger 2 роки тому +1

      it's just ASM but obscured even more lol

  • @Ramon314
    @Ramon314 Рік тому +1

    Had to build this in assembly for school, was quite a fun exercise.

  • @MikkelKjrJensen
    @MikkelKjrJensen 2 роки тому +10

    An interesting side effect of BF being Turing-complete is that you can assure yourself that a given programming language is Turing-complete by implementing a BF interpreter in it. Since BF was explicitly made to be a very minimalistic language, this is far easier than to do so for another Turing-complete languages, and should be far easier than a formal proof.

  • @o-manthehuman7867
    @o-manthehuman7867 3 роки тому +11

    I've been enjoying writing in it. Ton of fun. The only annoying thing is keeping track of where the pointer is; I got around that by writing an interpreter that uses labels-- when the program starts, before it begins, the lexer converts the labels into a number of arrows. I also wrote a script to compile it into normal bf!

  • @jiripeska3475
    @jiripeska3475 2 роки тому +4

    We programmed an interpreter in one university course for modified brainfuck language (extended by some additional operations) in VHDL. The VHDL part was pain but I actually enjoyed coding program in that brainfuck, that prints my login and then optimizing it to be as short as possible :D

  • @bibasik7
    @bibasik7 11 місяців тому +1

    This video is 129 seconds (or 130 seconds before you click on it).
    I feel like I've been scammed.

  • @hephaestus6778
    @hephaestus6778 2 роки тому +4

    this was actually a pretty good and easy explanation, i might switch from c++ to ensure that i can not be fired, ever!

  • @vikumwijekoon3166
    @vikumwijekoon3166 3 роки тому +30

    For a course in comp sci, we did calculations using a turing machine, little did we know, we pretty much wrote brainfuck with different syntax.

  • @HerbProductions
    @HerbProductions 2 роки тому +13

    I love how the 2nd to last brainf**k just completely misses with the bleep.
    “This has been brainfuck *bleep* -nd if you want to learn more...”
    Whoever’s editing this: I see you 👀

  • @theexploderofworlds3855
    @theexploderofworlds3855 Місяць тому

    this is what i imagined all programming was like before i started coding myself, something about that is intriguing to me

  • @jannes6666
    @jannes6666 3 роки тому +32

    Not designed to create actual software...
    How dare you XD

    • @jannes6666
      @jannes6666 3 роки тому +3

      @@jon-h But can it run Crysis?

    • @alexandermcclure6185
      @alexandermcclure6185 5 місяців тому +1

      @@jannes6666 More importantly: But can it run DOOM?

  • @B44-y5i
    @B44-y5i 2 роки тому +4

    Never understood why it was called like that. It's super simple and intuitive

  • @glassoffire873
    @glassoffire873 2 роки тому +4

    a niche game called SS13, namely the goonstation branch has a machine in chemistry where you can code it in brainfuck to automate chemical processes
    Boy this was helpful for understanding, thank you

  • @JesusCarrero1991
    @JesusCarrero1991 Рік тому

    I clicked the like button out of respect for whoever spend time learning that... but I don't want more videos about it.
    Knowing that exists is enough.

  • @_vicary
    @_vicary 2 роки тому +4

    i love how every beep is slightly off so it doesn't mask the word

  • @mobin6804
    @mobin6804 2 роки тому +6

    imagine someone recreating a game like rdr2 in this language

  • @_Tzebra_
    @_Tzebra_ Рік тому +5

    I wrote some 8088 assembly where first you had to clear the screen by placing black backgeound and black foreground and then actually writing character bytes to the video memory to show it on screen and i have to use interrput hooking (was required). So I actually had to modify the interrupt vector table.
    As far as I see, BF looks easy in comparison

    • @六工業のカービィ
      @六工業のカービィ Рік тому

      The code is less obvious than assembly.
      Languages try to make logic of the algorithm more understandable by humankind. While this thing makes it more confusing.

  • @bananasuo2048
    @bananasuo2048 2 роки тому +1

    My friend has just started learning programming and I told him to start with brainf*ck because its the easiest language. I created a monster 💀