Jonathan Blow on Calling Functions

Sdílet
Vložit
  • čas přidán 25. 03. 2024
  • Credit @jblow888

Komentáře • 70

  • @DavidsKanal
    @DavidsKanal Před měsícem +217

    "Jonathan Blow on Calling Functions" these titles are so funny, it's always like "Jonathan Blow on" and then the most mundane thing ever

    • @ITR
      @ITR Před měsícem +22

      For this vid the title doesn't feel correct to me, so I wonder why they chose it

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz Před měsícem +16

      lmao yeah I kept wondering how this guy has an opinion on literally everything, then I watched the video and it made a lot of sense.

    • @DavidsKanal
      @DavidsKanal Před měsícem +11

      Jonathan Blow on Breathing

    • @mr.sloth.
      @mr.sloth. Před měsícem +8

      on the next episode "Jonathan blow on writing hello world"

    • @crism8868
      @crism8868 Před měsícem +3

      Bruh, calling a function seems mundane only cuz were abstracting away the complexity

  • @BackUp-cz6zn
    @BackUp-cz6zn Před měsícem +107

    next up "Jonathan Blow on drinking water"

    • @Endelin
      @Endelin Před měsícem +14

      There was a clip of him praising a water filter. So that's actually a good guess.

  •  Před měsícem +60

    Top Down Operator Precedence
    Vaughan R. Pratt
    Massachusetts Institute of Technology 1973

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Před měsícem +3

      that doesn't sound too recent tho : p
      But thanks for the pointer : )

    • @delphicdescant
      @delphicdescant Před měsícem +6

      @@user-sl6gn1ss8p Most of computer science is also not that recent. Still holds true though, since it boils down to math.

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Před měsícem +2

      @@delphicdescant yeah, it's just that in the video they mention a recent paper

    • @igstan
      @igstan Před měsícem +5

      @@user-sl6gn1ss8p the paper he's probably referring to is "Top Down Operator Precedence" by Douglas Crockford, 2007. But that paper only rehashes what Pratt talked about in the 1973 paper.

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Před měsícem +1

      @@igstan Oh, thanks : )

  • @mastermati773
    @mastermati773 Před měsícem +30

    This title is a reverse click bait. Expected some things about function points, arguments on stack, etc. but ended up with building AST.

  • @OpferMomo
    @OpferMomo Před měsícem +8

    The technique of checking for current precedence and whether to recurse or not is also used by Thorsten Ball in his books

  • @patrolin
    @patrolin Před měsícem +28

    inb4 jon and casey on how easy operator precedence is

    • @fappylp2574
      @fappylp2574 Před měsícem +1

      It's literally the most trivial thing. I'm actually shaking right now because of how ****** easy operator precedence is!

    • @wilfridtaylor
      @wilfridtaylor Před měsícem +1

      Didn't they do that a few weeks ago :p

    • @xmurrcattx3498
      @xmurrcattx3498 Před měsícem

      it looks like he's going into the basic function of recursive descent compilers. Which is not exactly operator precedence, but

  • @notuxnobux
    @notuxnobux Před měsícem +4

    This is how I've always done it and I haven't looked up how others have done it

  • @robervaldo4633
    @robervaldo4633 Před 6 dny

    IIRC my formal languages classes, while simpler to understand, the "problem" with "recursive descent parser" is you have to write it by hand, while the "shift reduce" ones can be generated automatically from the language specification using tools like yacc, GNU bison, etc., also they can be used with a wider range of grammars, that's why they're more interesting (alas, the wikipedia page on recursive descent parser has a paragraph explaining exactly that, with more formal references, in the introduction)

  • @trevorc4401
    @trevorc4401 Před měsícem +8

    The file name is "asdfasdf" that's so real, he is but a man, no longer enshrined as a God

  • @maddyv5948
    @maddyv5948 Před měsícem +23

    This man's name is just perfect setup for deez nuts jokes.

  • @fakt7814
    @fakt7814 Před měsícem +3

    I've come up with infix-to-postfix parser after watching "How easy operator precedence is" (I guess I didn't fully understand it the first time), but this method looks more flexible, although the core idea is the same (decide whether to call procedure recursively depending on a change of precedence). I don't like explicit trees (maybe because I haven't really encountered them in work), maybe that's why postfix form felt more natural to me, and this one is more about creating AST.

  • @foxcirc
    @foxcirc Před měsícem +3

    why not "jonathan blow on operator precedence"

  • @oussemabenayech2345
    @oussemabenayech2345 Před měsícem +1

    from his thumbnails this guy look like Dave Bautista but in shape

  • @laztheripper
    @laztheripper Před měsícem +2

    I wrote a boolean logic parser recently, and I wish I had come across this before. This sounds so much simpler to implement when the strings happen to include nested instructions.
    I don't like the idea of it being recursive though, so I'd probably make a vector and push intermediate values to it, then shift through that while len > 0.

    • @ReedoTV
      @ReedoTV Před měsícem +10

      If you think about it, the call stack is just a fast access vector

    • @OzmandisMandis
      @OzmandisMandis Před měsícem

      May you share your reasons of why you dislike it being recursive ?

    • @phitc4242
      @phitc4242 Před měsícem

      ​​@@OzmandisMandis recursion has a depth limit. can be increased, but is there. if you use a vector (heap) you're freer. iirc. not 100% sure but pretty much that is it

    • @OzmandisMandis
      @OzmandisMandis Před měsícem

      @@phitc4242 that's true but for parsing you're not gonna get to that point anytime soon as expression are not really that deep, you can also change the stack size if you really need to.

    • @user-io4sr7vg1v
      @user-io4sr7vg1v Před 12 dny

      It's really the same. Heap vs stack.​@phitc4242

  • @AdamRezich
    @AdamRezich Před měsícem

    Why not include a link to the source video in the video description?

  • @asdfghyter
    @asdfghyter Před měsícem +7

    i was hoping he would have actual opinions on the very concept of functions and how they are implemented in most compilers or something like that

    • @simonschneider5913
      @simonschneider5913 Před měsícem

      same here.. ;)

    • @phitc4242
      @phitc4242 Před měsícem

      I guess if you look at the asm output you'd know more... I'm no expert tho.
      but in the end it's an instruction similar to "call [address/label]". the arguments are on the stack I think. or if it's not too many, I'd put them into rax/rbx/rcx/etc... but then again, I'm no pro, I've just dabbled in asm a teeny tiny bit

    • @asdfghyter
      @asdfghyter Před měsícem

      @@phitc4242 yeah and there’s a cost to that (pushing a bunch of stuff to the stack), so i was wondering if it was related to that or something. but i guess compiler authors have already spent a shit-ton of thought on that, so maybe there’s not that much new to invent there
      but on the other hand, different languages and different architectures have different calling conventions, so there’s already some variety there. for example, do you put some arguments in registers, as you mentioned? do you allow multiple return values, etc

  • @nikbl4k
    @nikbl4k Před měsícem

    What is the original date on these?

  • @ismbks
    @ismbks Před měsícem

    does he use emacs without line numbers?

  • @moristar
    @moristar Před měsícem

    I thought this is solved by building trees. At least it's how I do this.

  • @jks234
    @jks234 Před 16 dny

    ?
    8:00 Isn't this basically the same thing as tree traversal, it's just the comparison made is between numbers instead of... states.
    So you can sort of do a one-to-one analogy and realize it's the same thing.
    number > number for this.
    state vs state for the other system.

  • @coolguy69verycool
    @coolguy69verycool Před měsícem +2

    I'm very ignorant to both topics but this kinda sounds like the shunting yard algorithm but applied differently. If I'm way off, please let me know

    • @OzmandisMandis
      @OzmandisMandis Před měsícem +1

      you're not too far off, it's called Pratt parsing and it's an "augmented" version of shunting yard.

    • @coolguy69verycool
      @coolguy69verycool Před měsícem +2

      @@OzmandisMandis Wow, thanks! I didn't expect anyone to get back to me. I'll have to read about Pratt parsing and... probably study algorithms. I just started programming C and learning TCP/IP stuff. Learning programming is overwhelming.

    • @OzmandisMandis
      @OzmandisMandis Před měsícem

      @@coolguy69verycoolyou're welcome. I wish you a great journey.

    • @simonschneider5913
      @simonschneider5913 Před měsícem +1

      @@coolguy69verycool i feel the problem is to cut through so much bs....thats something i never have in mech eng....i got gaslit with the OO-religion decades ago...its so interesting to come back to programming now..they now shit on everything i was told is the best thing ever...J.Blow is one of the most brutal. it makes me hope i was nt crazy in the end when i stayed away from higher level stuff until now...

    • @coolguy69verycool
      @coolguy69verycool Před měsícem

      @@simonschneider5913 Ya, I first started dabbling when people started calling themselves "React developers" and I was buying in hard to that idea. I'm now fully committing to learning how computers work and how to be a good developer while acknowledging that those "React developers" were the people that were laid off.

  • @mateusvmv
    @mateusvmv Před měsícem

    How is the shunting yard algorithm recent

    • @delphicdescant
      @delphicdescant Před měsícem +1

      Bro Jonathan Blow said it, so it must be true.
      He's the patron saint for people who want to be programmers but don't want to go to school for it.
      Being right isn't as useful as being confident.

  • @uuu12343
    @uuu12343 Před měsícem

    Since when did Jonathan Blow become the end all be all lmao

  • @Acetyl53
    @Acetyl53 Před měsícem +1

    Faces, names, contexts, words, topics, identities. Past, present, future. Transient, permanent. I just don't get the human concept, their fixations, their attentions, what moves them within and without, this tangled world they are all part of.

    • @pattyspanker8955
      @pattyspanker8955 Před měsícem

      Get some help

    • @vornamenachname594
      @vornamenachname594 Před měsícem

      what confuses you is the intelligence that allows one to discern, make sense of the world and navigate the world effectively.
      If you mean what you said literally and not as a pseudointellectual quip, seek a neurologist. I have never heard of an adult who doesn't have an understanding of object permanence - researchers would be very interested in you.

  • @delphicdescant
    @delphicdescant Před měsícem

    I'm surprised someone as opinionated as him doesn't just go all in and say "do it in postfix."
    Honestly I wouldn't mind a language that only uses postfix for math.

  • @Themrlol2
    @Themrlol2 Před měsícem +1

    Who are you? These titles looks like you are some kind of IT guru

  • @Razumen
    @Razumen Před měsícem

    Next up Jonathon Blow on why he Blows

  • @raccoons_stole_my_account
    @raccoons_stole_my_account Před měsícem

    Next week, Jonathan Blow on pressing 3. You're never going to guess what happened next!