Console? good, GUI? good, game dev? use Godot engine with its similar language Gdscript, but what else? Ive been seeing AI, Data Science stuff, but whats the point if ita slow?

  • terabyterex@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    9 hours ago

    define slow.

    my life has been in C style languages but even i kniw python us a great general purpose language. are you going to use it for high frequency trading? no but most things dont need that speed.

    yes its used a lot in ai but also for a ton of linuc scripting. i dont think anyone uses perl anymore.

    so in what way was it slow when you used it? what micro seconds were you lookong for?

    • ryokimball@infosec.pub
      link
      fedilink
      arrow-up
      3
      ·
      9 hours ago

      I started off with programming languages that compiled into binaries. I knew dos and bash well enough but wanted the convenience of scripting, just type in run, no compiling needed. I also wanted it to be cross-platform.

      I chose Perl. TBH I loved it, but I kept hearing about all the cool things that would come as soon as Perl 6 was released, so I started waiting, and waiting, and waiting…

      The XKCD comic, import antigravity, is literally what convinced me to try python finally. Haven’t really looked back, even 13 years later when Perl 6 was finally released

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      2
      ·
      7 hours ago

      Python is slow enough to notice in fairly normal usage. Just doing lookups into a dict with thousands of entries, for example, will lead you to researching how to sort and index it.

      Python’s great as an interface to C which gives it the illusion of performing well.

      • FishFace@piefed.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        48 minutes ago

        Yeah, want to take a bet on how long a single lookup in a dict with 5,000 entries takes on my machine?

        How to sort and index it

        It’s a hash table. Can you explain why “sorting and indexing” would improve performance?

        You’re talking out your arse.

    • insomniac_lemon@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      8 hours ago

      This probably depends on what CPU someone has, someone with a higher-end CPU (higher-IPC/higher clockspeed) probably will have a better experience.

      On older/lower-end CPUs it is more common to see when something is single-threaded especially when it’s also interpreted. Particularly any type of generator/loader, filter, renderer, live audio. Which to be clear, is from a user perspective.

      • CarlLandry357@lemmy.worldOP
        link
        fedilink
        arrow-up
        1
        ·
        7 hours ago

        I think with newer CPUs Python’s current speed will be less of a problem but if your intention is game dev I think this is not enough.

    • CarlLandry357@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      2
      ·
      8 hours ago

      I wrote a console tictactoe game with primitive AI opponent using both Python and C++ and python takes more time in the background process before making a move than in C++.

      • Ephera@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        7 hours ago

        Yeah, computationally intensive stuff is going to be slow when implemented in Python. You will find lots of data science libraries for Python that do computationally intensive stuff, but they’re then generally implemented in C/C++ or Rust, with only a thin API layer written in Python.