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 mean methods are objects so can pull out a method and stash it in a variable, then call it later. Our encoding of objects in DOB allows something like this in how methods are functions so you can extract the method and then stash it somewhere.

Reflection

Given some object, can you poke around to find its class, methods, etc? (has a MOP - 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

Metaprogramming

Recall our discussion of staged programming of C++ templates and meta-ML: code can be "run to make the code".

Overloading and shortcut syntax


Last modified: Thu Jul 9 13:59:30 EDT 2009