• ProgrammingSocks@pawb.social
    link
    fedilink
    arrow-up
    6
    ·
    2 days ago

    It’s stupid to participate on either side of this discussion. If you think it’s not a “real” language you are applying a 100% arbitrary definition to it, and if you say it is a “real language” you are conceding that calling it “not real” even makes sense in some way (which it doesn’t).

    Personally I like languages with real and strong data types but people are free to use whatever language they like most.

    • AVincentInSpace@pawb.social
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 days ago

      For the last time, Python is not weakly typed. It is dynamically typed. The statement 5 + "hello" results in a type error. Bash is weakly typed, and that same addition results in 5hello

      • NaevaTheRat [she/her]@vegantheoryclub.org
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        2
        ·
        2 days ago

        Why do people think Python is ducktyped? The syntax is quite explicit, just because x = 5. is shorthand for x = float(5) doesn’t mean it’s doing weird mutations. The closest would be maybe that something like:

        x = 5
        y = 2.
        z = x * y
        

        works (I think) but that’s not exactly a wacky behaviour. It’s not like it ever does the wrong behaviour of casting a float to an int which can erase meaningful data and cause unpredictable behaviour.

        I mean you can (and often should!) give functions/methods type signatures ffs.

        • AVincentInSpace@pawb.social
          link
          fedilink
          English
          arrow-up
          9
          ·
          edit-2
          2 days ago

          Because to a certain extent Python is duck typed. Python has no concept of interfaces, unless you count the abc module combined with manual isinstance() checks, which I’ve never seen anyone do in production. In order to be passed to some function that expects a “file-like object”, it just has to have methods named read(), seek(), and possibly isatty(). The Python philosophy, at least as I see it, is “as long as it has methods named walk() and quack(), it’s close enough to a duck for me to treat it as one”.

          Duck typing is distinct from weak type systems, though.

  • Scoopta
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    3 days ago

    I personally draw a distinction between “real” programming languages and scripting languages. Scripting languages being languages that are traditionally source distributed. They tend to be much easier to write, run slower, often but not always dynamically typed, and operate at a higher level than “real” programming languages. That’s not to say they aren’t actually useful or difficult to learn etc. It’s not a demeaning separation, just a useful categorization IMO. Not to say the categorization always holds water in all those attributes, luajit is way faster than Java but it does follow the other bits. As someone who loves C there are lots of languages that seem too limiting and high level, doesn’t mean they aren’t useful tho.

    • Kacarott@aussie.zone
      link
      fedilink
      arrow-up
      10
      ·
      2 days ago

      Surely “compiled” Vs “scripting” langs is better than throwing around (at best) meaningless terms like “real”

      • Scoopta
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Yeah I agree, they are but I guess what I’m trying to get at is in day to day conversation I use “programming language” as a term for compiled languages hence “real” and “scripting language” for scripting languages. I never say “real” in conversation, just in the context of this post and as I mentioned it’s not to say scripting languages aren’t good languages, just how I separate them. Your distinction is much better in more comparative dialog such as this

    • Ethan
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 days ago

      That line is blurring to the point where it barely exists any more. Compiled languages are becoming increasingly dynamic (e.g. JIT compilation, code generation at runtime) and interpreted languages are getting compiled. JavaScript is a great example: V8 uses LLVM (a traditional compiler) to optimize and compile hot functions into machine code.

      IMO the only definition of “real” programming language that makes any sense is a (Turing complete) language you can realistically build production systems with. Anything else is pointlessly pedantic or gatekeeping.

      • Scoopta
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        2 days ago

        I’m aware of the increasing prevalence of JIT, that doesn’t change the other markers I listed. Ironically though the language the post is about, CPython still lacks JIT. Also I disagree in general, there are things scripting languages can’t do and will never be practical for. It’s not that they aren’t useful programming languages, that’s not what I’m saying but I think having a separate category for them is useful.

        • Ethan
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 day ago

          Scripting languages being languages that are traditionally source distributed.

          • Source distributed means you can read the source if it hasn’t been obfuscated. OTOH, it is trivial to decompile Java and C# so this isn’t a real difference for those languages (which happen to be compiled languages). So it’s only relevant for languages specifically compiled to machine code.
          • Source distributed means the recipient needs to install something. OTOH, Java and C#, again.

          So the only ways that the distribution mechanism matter are really a difference between How does the distribution mechanism matter beyond that? And even those points are

          They tend to be much easier to write

          I’m assuming you are not saying “real” languages should be hard to write…

          run slower

          Objective-C and Go run slower than C and they’re all compiled languages. Sure, an interpreter will be slower than a compiled language but modern languages aren’t simply interpreted (i.e. JIT, etc).

          often but not always dynamically typed, and operate at a higher level

          There are dynamically typed compiled languages, and high level compiled languages.

          It’s not a demeaning separation, just a useful categorization IMO.

          Calling one class of languages “real” and another class something else is inherently demeaning. I wouldn’t have cared enough to type this if you used “compiled vs scripting” instead of “real vs scripting”. Though I disagree with using “scripting” at all to describe a language since that’s an assertion of how you use the language, not of the language itself. “Interpreted” on the other hand is a descriptor of the language itself.

          As someone who loves C there are lots of languages that seem too limiting and high level, doesn’t mean they aren’t useful tho.

          I personally can’t stand Java because the language designers decided to remove ‘dangerous’ features like pointers and unsigned integers because apparently programmers are children who are incapable of handling the risk. On the other hand I love Go. It’s high level enough to be enjoyable and easy to write, but if you want to get into the weeds you can.

          • Scoopta
            link
            fedilink
            arrow-up
            1
            ·
            24 hours ago

            Source distributed means the recipient needs to install something. OTOH, Java and C#, again.

            Needing something installed is vague at best. If I ship python or Java with my program the user doesn’t need it installed, if you compile a go or rust program the runtime is statically linked into the program, but it’s still there. Additionally while decompiling to Java is trivial it doesn’t change the fact that A) there is a compiler B) optimization can be done by the compiler C) compilers for other languages unrelated to Java can be built for the platform D) obfuscated bytecode can be structured in ways impossible to describe with Java source code because the JVM supports features the language does not(jumps, return type method overloading, etc)

            Basically the JVM is a platform for running code, yes it has one flagship language and yes they influence each other but they’re not exactly one in the same. A similar argument can be made for .NET.

            I’m assuming you are not saying “real” languages should be hard to write…

            I’m saying they’re typically more difficult and have more rules, not that they should be “hard” per-say. I know somone who is a pretty capable lua programmer but gets lost in namespaces, classes, etc. Sure you can OOP in lua and Python but you don’t strictly speaking have to. The only other language like that which comes to mind is C++ which has its own challenges. Go isn’t OOP but go packages and the requirement for having a package is the kind of extra complexity I’m referring to. Scripting languages typically have a lower barrier to entry, that’s all I’m saying.

            Objective-C and Go run slower than C and they’re all compiled languages. Sure, an interpreter will be slower than a compiled language but modern languages aren’t simply interpreted (i.e. JIT, etc).

            Yes but also popular languages…I.e CPython and lua are still interpreted.

            There are dynamically typed compiled languages, and high level compiled languages.

            You’re finding counter examples to all my points individually, I’m saying scripting languages usually share many of these traits, that’s what makes them fundamentally good at scripting. You probably don’t want a scripting language with boiler plate, that needs a compiler, that’s statically typed etc. My points aren’t traits unique to scripting languages, they’re traits shared by basically all of them.

            Calling one class of languages “real” and another class something else is inherently demeaning. I wouldn’t have cared enough to type this if you used “compiled vs scripting” instead of “real vs scripting”. Though I disagree with using “scripting” at all to describe a language since that’s an assertion of how you use the language, not of the language itself. “Interpreted” on the other hand is a descriptor of the language itself.

            I’m using the language of the post, in real life when talking to people I just call them “scripting languages” or “programming languages” respectively and am hardly ever in a situation where further distinction is required. You’re right that scripting language doesn’t mean anything other than “good for scripting” but that comes with a bag of traits that make it GOOD for scripting. You don’t want to script in C, Java, C#, C++, Go, Rust, etc because usually when people are scripting they want to write code fast, with less in their way, without a compiler, etc. Compiled vs interpreted is only one component of that categorization.

            I personally can’t stand Java because the language designers decided to remove ‘dangerous’ features like pointers and unsigned integers because apparently programmers are children who are incapable of handling the risk. On the other hand I love Go. It’s high level enough to be enjoyable and easy to write, but if you want to get into the weeds you can.

            When I want to get something done that needs C I use C, when I want something fast and easy to write I use Java and then JNI with C if that’s needed but honestly it better be a tiny amount of C or I’ll go write the whole thing in C. And when I want to make a super short script to do things that scripting is good for I’ll use bash or if I need something a bit more “real”, to use that term again, I’ll use lua. All languages have their place, they’re just good at different things.

  • Ethan
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    3 days ago

    Who says Python isn’t a real programming language? Do they mean it in the same way as “real men prefer X”? That’s an opinion, though an idiotic one. Because if they mean it in the “CSS isn’t a programming language” sense, that’s factually wrong (about Python).

    • Scoopta
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      CSS is turning complete, those that think it’s not a real language have not tried hard enough

      • Ethan
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 days ago

        Malboge and brainfuck are also Turing complete. Hell, magic the gathering is technically Turing complete. Yet for some reason no one uses them for production systems… A real programming language is something you can realistically use to create production software, not just something that’s Turing complete.

        Also (source):

        You can encode Rule 110 in CSS3, so it’s Turing-complete so long as you consider an appropriate accompanying HTML file and user interactions to be part of the “execution” of CSS.

        So unless you have a different source, CSS is not Turing complete by itself. CSS+HTML is - if you allow “user interactions” which IMO disqualifies it.

        • Scoopta
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          My response was more of a meme to the fact of you saying CSS isn’t a programming language. There are lots of different categories for programming languages. Is CSS a “real” programming language, no. But depending on your field and persuasion scripting languages like python aren’t “real” programming languages. But they’re all still programming languages and if you make use of CSS in a turning complete way you are quite possibly the most “real” programmer I know even if it is only a gimmick. Also your last statement is not wrong, although I would consider it turing complete despite those limitations. If we want to be pedantic malbolge is not turing complete because memory limitations are baked into the spec and there are therefore problems that cannot be solved with it that could be provided it had more memory.

  • JackbyDev
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    Even I, a self proclaimed Python hater, admits it is a “real” programming language.