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?

  • Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    14 hours ago

    People who say “Python is slow” are generally wrong, yes, the language is slower then C in basically everything and it also almost always doesn’t matter.

    The bottleneck in a console app is not your applications ability to process, it’s your ability to read and type, you will have the same experience in any language.

    The same is true with GUI apps, python GUI apps are generally just bindings to toolkits written in other languages like pyqt is a python wrapper around a C++ toolkit.

    In actual gamedev, something like Pygame is using SDL which is a C library.

    YouTube is a python web app.

    Yes, python is slow, and generally it doesn’t matter, if it’s slow then it’s usually a PEBCAK problem. Python is primarily used as an easy to write language that is gluing together more complicated things written in faster languages.

    Like bash, but readable by humans!

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

      The reason anyone thinks it’s slow is that in the real world, people still ship* Python scripts/projects that don’t offload their performance-sensitive code to faster solutions.

      Acting as glue isn’t unknown to anyone looking into Python either, problem being there are multiple different solutions that each have their own benefits/drawbacks that will differ based on the use-case. Fine if you can lean on an existing library, more complicated if you actually need to write the performance-sensitive code.

      Similar to @Chais@sh.itjust.works, plus newer compile-to-C/C++/JS languages offer a lot of what Python does (glue, whitespace, style) plus more stuff like UFCS.

      My preference is nim-lang, it has stuff like for i in 1..17: (or something like
      for h in 0.uint8..<height:. Typing is a thing but doesn’t stop me, so either not a big hurdle or there’s something with my brain that makes it fine despite issues with other languages/styles). Nimscript is an option, and I like Clang with opt:size for an efficient testing option (Bellard’s TCC was an even better option for quick iteration in the past, not exactly supported now (as of 2023) though. Might work for other languages).

      * my last experience with this was a piano thing (soundfonts for MIDI keyboard) that had choppy audio when played too quickly and would crash my Raspberry Pi 2B. The issue was closed as not planned.