I wondered if there is a programming language which compiles to machine code/binary (not bytecode then executed by a VM, that\'s something completely different when considering
Objective-C might have some of the properties you seek. Classes can be opened and altered in runtime, and you can send any kind of message to an object, whether it usually responds to it or not. In that way, you can implement duck typing, much like in Ruby. The type id
, roughly equivalent to a void*
, can be endowed with interfaces that specify a contract that the (otherwise unknown) type will adhere to.