DIY Programming Language #1: The Shunting Yard Algorithm

36,119
0
Published 2024-05-03

All Comments (21)
  • @javidx9
    So are you BODMAS, or PEDMAS, or something else?
  • i've been writing code for almost 30 years and im still learning new things. thank you so much
  • @psodq
    During the first 8 minutes I was thinking: You know he is a programmer when he does not need a computer to program! Thumbs up!
  • @user-ov5nd1fb7s
    Dude, I started following your stuff when I was a junior dev. Almost 10 years have passed, nice to see you still make great content.
  • @kplays_6000
    Just as a callout to people who learn alternatives such as PEMDAS and BIDMAS - the order of multiplication and division doesn't matter - they have the same precedence and are just done from left to right together. The same with addition and subtraction. You can swap M/D and A/S if you feel more comfortable that way, but these are within the scope of this video the only pairs that are interchangeable as of right now!
  • @Barnardrab
    In school, we were taught "Please Excuse My Dear Aunt Sally" as the acronym for the order of operations. Also, another word for value is operand. For instance, in 4 + 5, the "+" is the operator and "4" and "5" are the operands.
  • Just got into the Pixel Game Engine and happy to see you still making content! Thanks for everything you do for the community, you are appreciated!
  • @landmanland
    I never knew that it was called the shunting yard algorithm. I still remember that creating a calculator was one of the first programs I had to write while studying 35 years ago.
  • @SimGunther
    My mind was blown when I combined Recursive Descent statement parsing and Pratt expression parsing constructed with compile time curried functions. Great analysis of this expression parsing algorithm!
  • @antonpieper
    Custom programming languages are an interesting topic that plagued my mind for years! Great to see you covering this
  • @scottpageusmc
    I've been programming since 1986, and probably have forgotten more languages than I remember now, but you somehow are able to teach this old dog something new in every video. I'm 46 now, and it is rare that I run across many people with the same background as I have, and you are in my top at least 3 favorite YouTubers of all time! You're clear, concise, well structured, and brilliant. Thank you for doing what I wish I could do! Outstanding all around!
  • @catapillie
    programming language development on this channel, I'm all for it!!
  • @GRAHAMAUS
    Familiar algorithm, well explained -- good job! One thing you might have added is why it's called the "shunting yard algorithm", because it can be explained by analogy to shunting railway wagons in a yard in such a way as to build a train in the necessary order. In that analogy, only one stack is generally used (though another is needed for evaluating the solution, though in fact it can be the same stack with a bit of cunning).
  • @Sam-hu3xt
    I love how eloquent you are explaining alien stuff like this.
  • @jhfoleiss
    I teach this algorithm in an introductory data structures course. It's a fun algorithm that makes students "get" the importance of using appropriate data structures to solve problems (in this case, the stack). Great explanation, btw!
  • @Z80Fan
    25:50 The answer is 2 but not for the reason given: multiplication and division have the same priority so they are evaluated left-to-right, so: 1x(2+4)/3 = 1x6/3 = 6/3 = 2. The same for addition and subtraction.
  • @tsol9097
    We called this postfix notation when I was learning compiler design - there's also a prefix way to do it. I believe we used an operator stack and a literal stack, but essentially the same process.
  • @Olosann
    The best ever use case for kitchen table. Thanks!!!
  • The master has returned. Always good to see amazing content with value from you and the community. Keep it up javid, and congratulations on X10 growing health:)
  • @CediCore
    I love your lovely placed remarks, like the "system("pause")" one ❤