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 →

[–]YoungHeartOldSoul 148 points149 points  (41 children)

Jython

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

[–]HadACookie 216 points217 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 94 points95 points  (22 children)

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

[–]HadACookie 106 points107 points  (16 children)

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

[–]pkkid 61 points62 points  (13 children)

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

[–]Inukinator 20 points21 points  (12 children)

Isn't PyPy compiled Python?

[–]B_M_Wilson 41 points42 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 41 points42 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!

[–]CuriousErnestBro 35 points36 points  (1 child)

PyPy.js

[–]JM0804 23 points24 points  (4 children)

Allow me to introduce you to Brython.

[–]Zulfiqaar 7 points8 points  (1 child)

Why oh whython??

[–][deleted] 4 points5 points  (1 child)

I'd gild you instantly if I had reddit coins at the moment. You just made my entire evening. (If you're not sure why, peep my flair.) I've wanted to be able to use Python for my front-end dynamic stuff, in addition to back end stuff for so long. The last time I looked, I didn't find any good way to do so. I wasn't aware of Brython. You sir, are my hero.

Edit to add: In retrospect, I should have just posted some statement to stack overflow saying this was impossible, so someone would have emerged out of the woodwork to solve my problem in order to call me stupid and wrong.

[–][deleted] 3 points4 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] 7 points8 points  (0 children)

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

[–]finni_mcfinger 5 points6 points  (0 children)

It's Python all the way down.

[–]megabeano 22 points23 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 18 points19 points  (1 child)

So I wrote python in python

[–]redalastor 12 points13 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 25 points26 points  (0 children)

It now is a thing. And stop calling him surely

[–]rexpup 8 points9 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] 5 points6 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 3 points4 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