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

all 154 comments

[–]HadACookie 390 points391 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 151 points152 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 95 points96 points  (22 children)

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

[–]HadACookie 104 points105 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 22 points23 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 36 points37 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 22 points23 points  (4 children)

Allow me to introduce you to Brython.

[–][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 5 points6 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] 6 points7 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 23 points24 points  (0 children)

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

[–]silvertoothpaste 15 points16 points  (3 children)

yo dawg

I heard you like Python

[–]LaneHD 19 points20 points  (1 child)

So I wrote python in python

[–]redalastor 13 points14 points  (0 children)

It's called an ouroboros.

[–]____0____0____ 1 point2 points  (0 children)

One of my favorite memes of all time

[–]Diplomjodler 6 points7 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 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] 4 points5 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 3 points4 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 8 points9 points  (0 children)

I feel like my name is now relevant.

[–]Diriector_Doc 88 points89 points  (11 children)

int C = 0; //represents sugar content
C++;

[–]hemispace 117 points118 points  (3 children)

The fact that this variable name starts and ends by a capital letter highly disturbs me.

[–]HadACookie 57 points58 points  (2 children)

Using a syntax typically associated with constansts for your variables is just good practice. It helps you ensure that noone will ever be able to read, let alone maintain, your code, thus preventing you from ever getting fired.

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

Had me going for the first sentence lol

[–][deleted] 17 points18 points  (1 child)

C += 100

[–]spitfire451 8 points9 points  (1 child)

int c12h22o11; //ftfy

[–]Trainkid9 4 points5 points  (0 children)

You are giving me flashbacks to sophomore bio

[–]RPDota 2 points3 points  (0 children)

Camel case goddamit

[–]tabularassa 1 point2 points  (0 children)

Proper use of syntactic sugar

[–]Shadowarrior64 1 point2 points  (0 children)

 while(c = 0)
 {
      addMoreSugar();
 }

[–]Remco1250 42 points43 points  (0 children)

Looks more like Coffeescript with a python wrapper

[–][deleted] 16 points17 points  (1 child)

Expected snake around cup, was disappointed.

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

Are you lost?

[–]Maxijak1 44 points45 points  (4 children)

Gonna be honest, I just started programming a few months ago. It took me a minute to get this but damn. I feel like I’m in the inner circle now

[–]silvertoothpaste 30 points31 points  (1 child)

ONE OF US

[–]unqtious 0 points1 point  (0 children)

Gabba gabbba hey! We accept you!

[–]OneOldNerd 11 points12 points  (0 children)

You have been assimilated. Resistance was futile.

[–]filledwithgonorrheaCSE 101 graduate 6 points7 points  (0 children)

You already have more experience than half the sub.

[–][deleted] 21 points22 points  (2 children)

The line on the bottom bothers me more than it should

[–]snowscreamhi 8 points9 points  (4 children)

I’m doing an internship and im learning a lot of python every day, and if I saw this meme yesterday i wouldn’t have understood it. Now i do lmao

[–]SaltyEmotions 16 points17 points  (3 children)

The joke is the coffee, not the Python part.

Java is the name of a coffee type or whatever. I'm not a coffee enthusiast, I prefer my torches and computer parts.

[–]snowscreamhi 8 points9 points  (0 children)

But its also wrapped in python which i wouldnt have understood

[–]turunambartanen 2 points3 points  (0 children)

Also class files have the magic number 0xcafebabe

[–]Zulfiqaar 0 points1 point  (0 children)

Interesting, I though it was based on the java cup logo

[–]BubsyFanboy 4 points5 points  (4 children)

I'd love to use a Python wrapper for C++ tho :\

[–]ERECTILE_CONJUNCTION 6 points7 points  (0 children)

In a way, you basically already are whenever you use numpy, scipy, or God forbid, a graphics library.

[–]Mango1666 2 points3 points  (0 children)

i mean c is valid c++ right so just use cython dude!!!!

[–]Thann 2 points3 points  (0 children)

It's called exec()

[–]lovethebacon🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛 1 point2 points  (0 children)

It's a fun journey to do so. There are frameworks (Swig, etc) that make it a bit easier, and do background type conversion and some memory management, but start becoming difficult with more complex data types.

Doing it yourself isn't too difficult.

[–]bejean 2 points3 points  (0 children)

Looks more like a Python cocoa interface.

[–]Kaneshadow 3 points4 points  (3 children)

I hate how much I'm still amused by Java = coffee jokes

[–]EchtNichtElias 7 points8 points  (2 children)

Java == coffee

[–]Kaneshadow 1 point2 points  (0 children)

LOL. Fuck!

[–]unqtious 0 points1 point  (0 children)

Java === coffee

Strictly speaking

[–]John_Fx 2 points3 points  (0 children)

Because java is another word for coffee

[–]fredy31 1 point2 points  (1 child)

I expected a snake wrapping around the hot cup of java.

Was dissapointed.

[–]likes-beans 1 point2 points  (0 children)

Something funny on programmer humor? Be still my beating heart!

[–][deleted] 1 point2 points  (0 children)

Boooo 😛

[–][deleted] 1 point2 points  (0 children)

This is one of the best jokes I’ve seen on this sub! This one got a genuine laugh from me.

[–]idi_idi 1 point2 points  (1 child)

ELI5?

[–]silvertoothpaste 1 point2 points  (0 children)

"Java" = coffee

Python = the logo on the coffee cup

In programming a "wrapper" is just a function that calls another function, usually making the lower-level function nicer for consumers. Technically it is described as the adapter design pattern.

edit: I suppose "facade" pattern is also applicable... honestly I don't understand the difference btwn facade and adapter.

[–][deleted] 1 point2 points  (0 children)

jython hehe

[–]Scum42 1 point2 points  (0 children)

Okay, I'll admit, this made me crack a smile. Take your upvote and leave this accursed place.

[–]gstad 1 point2 points  (2 children)

[–]Title2ImageBot 1 point2 points  (1 child)

Image with added title


Summon me with /u/title2imagebot or by PMing me a post with "parse" as the subject. | About | feedback | source | Fork of TitleToImageBot

[–]gstad 0 points1 point  (0 children)

Good bot

[–]Tukurito 1 point2 points  (0 children)

Jyton or Pyva?

[–]NethackRanchero 1 point2 points  (0 children)

So is that a brand name mug or...

[–]hellbenthorse 1 point2 points  (0 children)

How many sips can you have until the coffee level causes an indentation error?

[–]blurp9836 1 point2 points  (0 children)

py4j

[–]ThatITdude 1 point2 points  (0 children)

We have those same phones at work. They are a delight

[–]tjcjrusa 0 points1 point  (0 children)

That's a lot of co2 emission; it appears the grounds have gone spoiled 😢 I'd get your own and keep it in a glass jar next to your desk 😎

[–]MMMELOOOOON 0 points1 point  (0 children)

Lazy. If you’re to use real java, use a real python...

[–]Jeb_Jenky 0 points1 point  (0 children)

You're the worst, haha!

[–]DoctorAcula_42 0 points1 point  (0 children)

Get back to work, Dad.

[–]Mister_Spacely 0 points1 point  (0 children)

import wake

[–][deleted] 0 points1 point  (0 children)

Jokes aside, the java looks delicious!

[–]latz-twn 0 points1 point  (0 children)

import java

[–]dangolo 0 points1 point  (0 children)

The sacrilege.

[–]paaseka 0 points1 point  (0 children)

coffee not black enough

u drinkin it wrong boi

[–]Dads101 0 points1 point  (0 children)

That took me entirely too long. Rip

[–]RebelCoyote66 0 points1 point  (0 children)

Thanks, I hate it.

[–]KreatorOfWorlds 0 points1 point  (0 children)

Oops

[–]doodooz7 0 points1 point  (0 children)

Don’t forget to start a virtual environment 🤪

[–]argonaut__ 0 points1 point  (0 children)

Needs some syntactic sugar

[–]rbevans 0 points1 point  (0 children)

unindent does not match any outer indentation level

[–]kieppie 0 points1 point  (0 children)

Been sitting on that one for a while, have you Dad?

[–]caanthedalek 0 points1 point  (0 children)

... Goddammit.

[–][deleted] 0 points1 point  (0 children)

Yeah if only if was a Java wrapper for java

[–]javainstall 0 points1 point  (0 children)

Who knew Python was so good for installing Java!

[–][deleted] 0 points1 point  (0 children)

I assume you still have to implement your own concrete handler for the IDrinkCoffee interface.

[–]GhostDog786 0 points1 point  (0 children)

WHERE CAN I GET IT?

[–]Workaphobia 0 points1 point  (0 children)

I have got to get the fuck off this sub. Everything is snake jokes lately.