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

后端 未结 9 2029
野的像风
野的像风 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:17

    C# 4.0 has many, if not all of these characteristics. If you really want native machine code, you can compile the bytecode down to machine code using a utility.

    In particular, the use of the dynamic keyword allows objects and their members to be bound dynamically at runtime.

    Check out Anders Hejlsberg's video, The Future of C#, for a primer:

    http://channel9.msdn.com/pdc2008/TL16/

    0 讨论(0)
  • 2021-02-02 07:19

    In a similar vein to Lisp, there is Factor, a concatenative* language with no variables by default, dynamic typing, and a flexible object system. Factor code can be run in the interactive interpreter, or compiled to a native executable using its deploy function.

    * point-free functional stack-based

    0 讨论(0)
  • 2021-02-02 07:24

    I don't know of any language that has exactly those capabilities. I can think of two that have a significant subset, though:

    • D has type inference, garbage collection, and powerful metaprogramming facilities, yet compiles to efficient machine code. It does not have dynamic typing, however.
    • C# can be compiled directly to machine code via the mono project. C# has a similar feature set to D, but again without dynamic typing.
    0 讨论(0)
提交回复
热议问题