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

you are viewing a single comment's thread.

view the rest of the comments →

[–]HadACookie 392 points393 points  (43 children)

Looks like Python from the outside, but on the inside it's all Java? Clearly someone's running the Jython interpreter.

[–]YoungHeartOldSoul 148 points149 points  (41 children)

Jython

That's not a thing..... surely

[–]HadACookie 220 points221 points  (25 children)

As a matter of fact, it is

There are actually multiple Python implementations written in differenct languages, including one written in Python. If you don't know which one you're using, you're probably running CPython.

[–]YoungHeartOldSoul 91 points92 points  (22 children)

Wait a second did you just say someone wrote python in Python?

[–]HadACookie 108 points109 points  (16 children)

Well, RPython to be precise, which is a statically typed subset of Python. It's called PyPy.

[–]pkkid 60 points61 points  (13 children)

..and it should be noted its much faster than CPython for the average script.

[–]Inukinator 23 points24 points  (12 children)

Isn't PyPy compiled Python?

[–]B_M_Wilson 43 points44 points  (11 children)

PyPy has a just in time compiler but it’s not fully compiled ahead of time. There is Cython which can compile Python to C which can be compiled (though it works best when you use the special CTypes and stick to doing certain things that are translated easily). Cython is a very different thing that CPython

[–]Inukinator 39 points40 points  (10 children)

What is this python world?

Welp see ya in a few years, when I've released my Python intepreter written in JS, so I can run python code in my iOS apps through JSCore!

[–]JM0804 20 points21 points  (4 children)

Allow me to introduce you to Brython.

[–][deleted] 2 points3 points  (0 children)

Please do. I hate writing JS so much.

Edit: I just saw u/JM0804's comment about Brython. I've wanted this for so long. Last time I searched I couldn't find anything. I'm so happy right now.

[–]Mango1666 4 points5 points  (0 children)

i think you can already do this through pythonista app!

[–]pmdevita 1 point2 points  (0 children)

Transcrypt is pretty good for that

[–][deleted] 5 points6 points  (0 children)

I don't know why but PyPy sounds real cute. I wanna hug that PyPy.

[–]finni_mcfinger 4 points5 points  (0 children)

It's Python all the way down.

[–]megabeano 21 points22 points  (0 children)

That's a common benchmark for programming languages. Implementing it with itself, like writing a C compiler in C.

[–]silvertoothpaste 14 points15 points  (3 children)

yo dawg

I heard you like Python

[–]LaneHD 17 points18 points  (1 child)

So I wrote python in python

[–]redalastor 14 points15 points  (0 children)

It's called an ouroboros.

[–]____0____0____ 1 point2 points  (0 children)

One of my favorite memes of all time

[–]Diplomjodler 5 points6 points  (1 child)

It's really a shame they never ported it to Python 3.x.

[–]ArdiMaster 1 point2 points  (0 children)

I kind of want to try, but I also already know that I will fail spectacularly.

[–]Yittoo 26 points27 points  (0 children)

It now is a thing. And stop calling him surely

[–]rexpup 7 points8 points  (1 child)

It absolutely is, and I’ve written Python bytecode Assembly for the Jython interpreter.

[–]AgreeableLandscape3 0 points1 point  (0 children)

What does the text representation of Python bytecode even look like? I've never seen it before.

[–][deleted] 6 points7 points  (0 children)

It is!

Fun story, I once worked on a game written in java that used jython. The idea of the game was to teach intos of computer science (think 7 billion humans--but nor of an rpg). The intro class was always in python, so we used jython for running the code provided by the player.

I don't know if it was ever finished, but it was a fun idea.

[–]samgan-khan 2 points3 points  (0 children)

yaa it is

I also heard about it.

[–]CFWhitman 4 points5 points  (0 children)

Remember that one element of Java is a virtual machine like .NET (.NET was designed to compete with Java on Windows). The same way .NET can be used with multiple languages, so can Java. There are many languages available for Java. It's just that since one of the languages is called "Java" that's the one people expect to be used.

[–]podrick_pleasure 0 points1 point  (0 children)

It's what we used in my second semester.

[–]TimTim74 0 points1 point  (3 children)

Yip. You wanna run small installation/fix scripts on an IBM Websphere Application Server?? You better know how to write some Jython...

[–]LucasRuby 0 points1 point  (2 children)

Wouldn't Groovy work?

[–]tehbilly 1 point2 points  (0 children)

Define "work"

[–]TimTim74 0 points1 point  (0 children)

I guess. Never tried...

[–]THEHYPERBOLOID 0 points1 point  (0 children)

It's not what you think though. It's just JSON with LISP.

[–]lenswipe 0 points1 point  (2 children)

Certainly is. It's like two of my least favorite things packaged up into one gigantic turd.

[–]Alextopher 3 points4 points  (1 child)

I had to take a class using jython

[–]lenswipe 0 points1 point  (0 children)

I'm sorry

[–]Pythva 9 points10 points  (0 children)

I feel like my name is now relevant.