Is there a compiled* programming language with dynamic, maybe even weak typing?

后端 未结 9 2050
野的像风
野的像风 2021-02-02 06:44

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

9条回答
  •  佛祖请我去吃肉
    2021-02-02 07:14

    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.

提交回复
热议问题