Skip to content

Instantly share code, notes, and snippets.

@lyqht
Last active September 11, 2019 05:27
Show Gist options
  • Save lyqht/bc6b2fdf65b9e4ae5574cfb8385718a9 to your computer and use it in GitHub Desktop.
Save lyqht/bc6b2fdf65b9e4ae5574cfb8385718a9 to your computer and use it in GitHub Desktop.
Summary of Matz's Talk @ RubySG Meetup 2019

Matz' Talk - Ruby Through Reserved Words:

This talk is held during RubySG ❤️ Matz Meetup (September 2019)

Checkout the video by Engineers.sg here!

Below are just some mini notes in text that I took down for Matz's talk! Thanks @Matz for the walkthrough of how he designed the language's reserved words.

EDIT: I also attached links if you wanted to read up about the less commonly known languages that he mentioned. Please leave comments below if there is anything you wanna add in!

EDIT: Changed the Ending thoughts section to Other Thoughts.

There are 41 keywords in Ruby, and here are some words that he covered:

  • Begin/end -> 1950s Algol programming lang style.
  • Comb indentation style + rescue, ensure, retry -> 1980s Eiffel programming lang.
  • Rescue, ensure, entry -> exception handling should be usual. So he don't want people to have the mentality of "this region might cause an error so try ...", but instead the code should already have exceptions that your code would rescue than just trying.
  • Break/next/redo & no continue & unless & while & and/next/or -> from Perl, as he enjoys its succintness. Tho, he regret copying too much.
  • Class/def -> Python/Lisp(flavours)/Mixin
  • elsif instead of elseif/elif -> It is the shortest pronunciation of this word to Matz haha.
  • Nil/false are both falsy -> But Ruby still three value model for Nil, False and True, because they are objects of their own. There is no boolean object class.
  • do/yield -> CLU 1970s of MIT only used these words for loops, but Ruby can use for callbacks loops scopes many cases. Biggest invention of Ruby. Similar to higher order function
  • self/super -> Derived from Smalltalk lang.
  • alias/undef -> from Santher 1980s, ucb school. The purpose of these keywords are against the Liskov principle of oop.
  • BEGIN{}/END{} -> NOT recommend anymore. Derived from Awk, a scripting language. Ruby also started off as a scripting language but now ppl just use Ruby more for web dev, so not in use liao.
  • Chain pipeline operator -> #F, Elixier also have. But for Ruby, add primary argument as the receiver.

Other thoughts by Matz

  • Making your own programming language will improve your programming skills as you think about the optimization and speed of the language.
  • Decision changes for Ruby are done by benevolent dictator for life (BDFL). So what happens if he retire as he mentioned that he has plans to retire 2025? He say that was more of a joke and for motivating the team to better plans. Definitely they will get someone/ a committee to lead the development of Ruby in future. If it was just a lead like now, would he/she be a dictator? Who knows.
@phtan
Copy link

phtan commented Sep 6, 2019

Not to sound pedantic, but when Matz said "I believe making your own programming language will make you a better programmer", it was at the beginning of the talk.

I'm not sure if Matz said it again at the end of the talk - what @lyqht suggests in the document above, in the section 'Ending thoughts by Matz', is that Matz mentioned it at the end of the talk

@lyqht
Copy link
Author

lyqht commented Sep 6, 2019

@phtan Yes you're right about that. I placed those comments at the ending thoughts section because i felt that those words became more meaningful after you listened through the explanations for his choice of designated reserved words. I'll rename the section as 'Other Thoughts by Matz' if it helps to make things clearer. Thanks for pointing that out!

@phtan
Copy link

phtan commented Sep 6, 2019

:-)

@gczh
Copy link

gczh commented Sep 11, 2019

@phtan Yes you're right about that. I placed those comments at the ending thoughts section because i felt that those words became more meaningful after you listened through the explanations for his choice of designated reserved words. I'll rename the section as 'Other Thoughts by Matz' if it helps to make things clearer. Thanks for pointing that out!

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment