Study of Dynamically Typed Languages

Dynamic Typing

A pure dynamically typed language The non-OO school The "classic" dynamic OO languages The "modern" school

Dynamically typed languages and our Fb series

We will now look at some crosscutting aspects of these languages.

Blocks of code aka higher order functions

"Everything is an object"

There are various degrees to what this means.

Public/private/protected

First-class methods

This means methods are objects so can pull out a method and stash it in a variable, then call it later. Our encoding of objects in FbOB allows something like this in how methods are functions so you can extract the method and then stash it somewhere.

Reflection

Given some object at runtime, can you poke around to find its class, methods, etc? (another term for this is it has a MOP - a Meta-Object Protocol) This stuff is very easy to do in a dynamically-typed language because the program data structure is around explicitly at runtime. Ruby is much cleaner here, it has clean notions of adding methods and Smalltalk and Python can blow up because methods will disappear, and field references are wacky.

Inheritance

Overloading and shortcut syntax