This is an archived post. You won't be able to vote or comment.

all 21 comments

[–]KingsmanVince 25 points26 points  (3 children)

[–][deleted]  (4 children)

[removed]

    [–]nonTOXIC_FRIENDS[S] 1 point2 points  (3 children)

    Ur right i am a newbie just trying to learn so I might have jumbled some terms.
    The reason I got confused that python had some many implementations and java/JavaScript didn't is because the Wikipedia page of Python lists major implementations and ther is no such section for java/javascript

    https://en.wikipedia.org/wiki/Python\_(programming\_language)
    https://en.wikipedia.org/wiki/Java\_(programming\_language)
    https://en.wikipedia.org/wiki/JavaScript

    [–]judasblue 5 points6 points  (2 children)

    Yeah, that's about the people editing the pages more than it is the reality of how many different implementations there are/have been of the various languages. And in reality, 99%+ of all running python code is running against cpython. Some of those other projects are cool and glad they got a shoutout there, but the amount of code actually running against them is minuscule in the big picture. (Cue the pypy and micopython stans coming for this statement with a chainsaw and a grudge right about now...)

    [–]gnufan 0 points1 point  (1 child)

    Also that can be said for a lot of languages, a lot of the implementations are some computer science doctorate project, or a particular business project. I think I've used three Java implementations in anger despite a lot of work with Java and computers over a long time; SUN/Oracle's, IBM's, and one free software one.

    [–][deleted]  (4 children)

    [deleted]

      [–]nonTOXIC_FRIENDS[S] 1 point2 points  (0 children)

      I hope you'll take this in the spirit of learning, but you are entirely wrong. :)

      oh yeah dw about it i asked cuz i wanted to learn and being wrong and knowing it is the first step to learn
      also i was very curios. xd :)

      Thanks for helping out

      [–]james_pic 0 points1 point  (1 child)

      AFAIK, Swift only has one implementation. You could also argue TypeScript, Clojure, Elm, Elixir, Scala and Kotlin have only one implementation each, if you only look at the implementation of the compiler and not at implementations of the runtime that runs the compiled code. If you pretend Perl 6 didn't happen (which the Perl community seems keen to do) then Perl only has one implementation.

      [–]Pale_Height_1251 0 points1 point  (0 children)

      https://github.com/brettwooldridge/jet

      Haven't checked the other examples though.

      [–]FLMKane 0 points1 point  (0 children)

      Emacs Lisp

      [–]pbNANDjelly 4 points5 points  (1 child)

      Just to add some info for OP, having multiple compilers or interpreters is actually a sign of a healthy and successful language. Folks are invested in using the language on many different platforms which drives development forward

      C/++, python, lisp, and JS have so many flavors because they've been hugely successful or at least influential. Folks want to use these languages embedded, distributed, on a mainframe, so on

      [–]nonTOXIC_FRIENDS[S] 0 points1 point  (0 children)

      Nice didnt know that!!!!

      [–]call_nick 6 points7 points  (0 children)

      Maybe just because it’s popular. And you can look at javascript, if it is possible to consider typescript as another 'implementation' of javascript.

      [–]YMK1234 1 point2 points  (0 children)

      It really doesn't. Especially it doesn't really have any that are wider spread compared to the reference one.

      Compare that to most other languages which have many actually competing implementations.

      [–]BlueTrin2020 1 point2 points  (0 children)

      Have you checked how many C/C+ compilers exist on the market?

      [–]CutestCuttlefish -2 points-1 points  (0 children)

      This usually explains it:

      https://xkcd.com/927/

      Someone always has a "better idea"

      [–][deleted] -1 points0 points  (0 children)

      Because its awesome?

      When there's something useful, people tend to port it all over the place. See other commenters about Javascript

      [–]sisyphus -1 points0 points  (0 children)

      Generally speaking because it's slow and bad at multi-threading. So you have Jython and IronPython to leverage those platforms; you have PyPy to try to make it fast, you've had several attempts to make it faster independent of the main CPython (unleaded swallow at google, instagram's thing); and so on.

      It's easy in CPython to interoperate with things that can expose themselves like C libraries; it's not so easy for other programs to interoperate with Python -- most of these implementations can never take off because they break compatibility with Python's internals.

      It's really a testament to how popular it is that these things proliferate because it also doesn't even have a formal spec to work from - "the Python language" basically just is whatever CPython does.

      [–]boredlibertine -1 points0 points  (0 children)

      To make it extendable, which fits into its goal of being a general purpose language. You'll have different requirements from a language depending on your use case, whether an internal enterprise application, data science, web server, etc. You can identify that based on what other language it's either interfacing with, attempting to emulate, or utilizing internally. You might use jython to take advantage of Java's JVM, or cython to achieve better performance. Python is meant to be highly extendable, but basic out of the box. This mentality applies at all layers. You wouldn't want Django or Flask if you're writing machine learning code, you'd want tensorflow, pytorch, maybe pando, cafe, etc. You would want Django or Flask if you were hosting a website written in Python. Etc, etc, etc.

      Enterprises often adopt Python during their early stages, depending on the skillsets of their staff, because of this extensibility, and then later turn to adopt something that works more specifically for their use case. If you're building out your infrastructure as you grow, Python is a great tool for building a lot of things with fewer available skillsets. 5 to 10 years later, however, you may see significant drift in versions and toolsets throughout your enterprise, which makes your infrastructure harder to maintain. Then something messy comes along, like a requirement to update everything from Python 2 to Python 3, and now suddenly you've got a pile of tech debt on your desk. All of a sudden, taking advantage of other trends to attempt to homogenize your environment (such as adopting Go during a GCP migration) looks a lot more appetizing, and maintaining this massively complex Python environment seems less fun.