• flatbield@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    It is far more then that. It is a full up programming language.

    I never understand why people think compilation is a barrier. But sure most python is not compiled.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      Python is largely compiled. All the pieces of a compiler are built into how it processes things. Almost nothing works on an interpreter model anymore, where each line is parsed and executed before handling the next. Unix-style shell scripts are one of the very few exceptions. I believe JavaScript also starts being interpreted in the browser in order to start executing immediately, but then a compiled version is swapped into the runtime as soon as it’s ready.

      • flatbield@beehaw.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        1 month ago

        Depends on what you mean by compiled. Python (CPython from python.org) typically translates to meta code and that is interpreted. True compilation to binary runs about 100x faster. Python is slow though there are faster versions and ways around it. Speed and threading are Python’s biggest issues.

        • Frezik@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          1 month ago

          I mean that there are successive steps to transform the entire code into tokens, the tokens into an AST, and the AST into some intermediary or final form.

          True compilation to binary runs about 100x faster.

          No, it doesn’t. Take a look at any of the number of projects that have attempted to compile Java to native code over the years. You’d be lucky to see any substantive gain at all. They sometimes have a use for packaging everything up in a single distributed binary, but you don’t do it for speed.

          Things like C and Rust are fast because the language semantics can be compiled in a fast way.