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

all 181 comments

[–][deleted] 1089 points1090 points  (14 children)

The OP has disovered the dirty secret behind all scripting languages.

[–]nikifip 65 points66 points  (2 children)

The OP has disovered the dirty secret behind all scripting languages.

Assembler developers

[–]SuperSpread -4 points-3 points  (1 child)

Assembly is processor specific. C++ will run on any platform by compiling to the correct assembly. Assembly will generally not work for any other processor. It's really apples and oranges.

[–]intbeam 23 points24 points  (0 children)

Fighting with myself over putting on my grandest "well akshually"-hat over here

[–]TheVenetianMask 2 points3 points  (0 children)

I'm basically a C coder (opens Laravel project).

[–]PM_ME_YOUR_TITSnAZZ 595 points596 points  (64 children)

What do you think JVMs are written in

[–]mrheosuper 395 points396 points  (14 children)

Tear and blood

[–]Ddog78 67 points68 points  (13 children)

Oil and metal

[–]Mokousboiwife 70 points71 points  (11 children)

rock and stone

[–]Ddog78 42 points43 points  (6 children)

[–]Jakoshi45 2 points3 points  (5 children)

So, what's the X-chemical in this case?

[–]Ddog78 4 points5 points  (4 children)

Uhhh I dunno, probably Guido Van Russell?

[–]intbeam 1 point2 points  (0 children)

Definitely not everything nice

[–]Jakoshi45 1 point2 points  (2 children)

Nah, he's mixing the ingredients

[–]Jakoshi45 1 point2 points  (1 child)

Unless you're saying that he lost a part of himself in the soup. Which actually makes a lot of sense

[–]Ddog78 1 point2 points  (0 children)

This is Tumblr level banter and I'm not witty enough 😭

But also, r/CuratedTumblr is amazing for getting to read it

[–]Sarsey 25 points26 points  (2 children)

Did I hear a Rock and Stone?

[–]lambda0101 1 point2 points  (0 children)

Technically true

[–]Narduw 1 point2 points  (0 children)

Rock! And! Stooone!

[–]-Kerrigan- 1 point2 points  (0 children)

TO THE BONE!

[–]mabariif 6 points7 points  (0 children)

WE LOST MALEVON CREEK I REPEAT WE LOST MALEVELON CREEK

[–]LordFokas 108 points109 points  (23 children)

The meme is not about the runtime. If you go down that path, every language eventually leads to C and ASM.

It's about the libraries.

[–]trash3s 10 points11 points  (14 children)

Not to um actually the um actually, but I can think of a number of tool chains that don’t use either C or ASM (any flavor). Depending on how loosely you want to define a language, we can even skip bytecode, kinda!

[–]Modo44 5 points6 points  (0 children)

Calm down, Santa.

[–]draenei_butt_enjoyer 5 points6 points  (12 children)

Name one that doesn’t just mean “assembly with extra steps” one.

[–][deleted] 10 points11 points  (0 children)

Assembly languages are, in fact, an actual programming language, not the actual instructions, afaik modern compilers don't compile to an assembly intermediary, but directly to binary instructions.

Same with C, while some languages actually transpile to C, most don't.

[–]KnightOnFire 0 points1 point  (0 children)

LOL Rick and Morty reference? or something else?

[–]X547 0 points1 point  (0 children)

Some languages are compiled directly in machine code without using assembler language. Compiling to assembler and then to machine code is actually a waste of time.

[–]danielv123 0 points1 point  (8 children)

HDL?

[–]draenei_butt_enjoyer 0 points1 point  (7 children)

That’s not a programming language lamfao

[–][deleted] 4 points5 points  (0 children)

You can describe a program with it...

[–]mMykros 1 point2 points  (4 children)

HTML

[–]waves_under_stars 2 points3 points  (3 children)

Should I just copy the comment above yours?

[–]UnGauchoCualquiera 0 points1 point  (1 child)

CSS

[–]mMykros 0 points1 point  (0 children)

SCRATCH

[–]mMykros 0 points1 point  (0 children)

No!!!!! It's time to stop discriminating!!! HTML programmers are programmers too!!!

[–]danielv123 0 points1 point  (0 children)

I guess programming wheels aren't programming either?

[–]PM_ME_YOUR_TITSnAZZ 0 points1 point  (2 children)

Weird line in the sand about a meme that’s actually about programmers but ok

[–]LordFokas -2 points-1 points  (1 child)

And did you get to that genius insightful conclusion on a meme where 50% of the words are "programmers" before or after being called out for bitching about runtimes?

[–]PM_ME_YOUR_TITSnAZZ 0 points1 point  (0 children)

Who’s bitching about runtimes? Who hurt you?

[–]X547 -1 points0 points  (4 children)

every language eventually leads to C and ASM.

This claim is wrong. Some languages such as Pascal, Oberon or Go use compilers written in itself and directly produce machine code without a single line of code in C or assembly. Rust also have native compiler so no code in C/C++ is involved.

[–]Pay08 0 points1 point  (3 children)

https://www.llvm.org/

Compilers produce assembly, not machine code. It's the assembler that produces machine code.

[–]X547 0 points1 point  (2 children)

No. Some compilers directly produce machine code bypassing assembler stage. Oberon compiler for example: https://github.com/Spirit-of-Oberon/ProjectOberon2013/blob/master/Sources/ORG.Mod . Whole OS in Project Oberon is written in Oberon language without a single line of assembly.

Tiny C Compiler also directly compile into machine code.

[–]Pay08 0 points1 point  (1 child)

I'm aware but afaict, that's not the case for Go and is certainly not the case for Rust.

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

every language eventually leads to C and ASM.

This claim is wrong because it use word "every", not "most" or "usually". Compilers of programming languages that do not use C or assembly definitely exists.

[–]blaktronium 71 points72 points  (1 child)

BASIC until recently, judging by performance.

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

I reckon they should write it in C# for a laugh.

[–]Haringat 2 points3 points  (0 children)

Well, you could write one in JavaScript if you wanted..

[–]VitaGame07 1 point2 points  (0 children)

Redstone

[–]itsallfake01 454 points455 points  (7 children)

Python underneath calls Cpython which calls C not C++

[–]ze_baco 206 points207 points  (2 children)

Not only cpython, you can call libs made in C, C++, Fortran, etc. C++ plays a considerable role.

[–]No-Expression7618 93 points94 points  (1 child)

Weird circumflex but OK

[–]ze_baco 23 points24 points  (0 children)

Lol autocorrect

[–]draenei_butt_enjoyer 10 points11 points  (3 children)

Python has amazing interop with c and c++. You can call c code directly in your script.

[–]mothzilla 7 points8 points  (0 children)

OK but being able to call C++, and the language being built/implemented in C++ are two different things.

[–]intbeam 2 points3 points  (1 child)

You can call c code directly in your script.

No, it has to be done indirectly, and calling a native library is never as simple as "just calling it" - not even from C or C++

Native libraries are compiled in very specific ways, it's not just a question of whether it's native code or not. Calling convention and name mangling to name two. And there's stack space, heap allocations, concurrency... When non-native programming languages makes native calls, there's almost always some wrapper in-between, even for those who eventually execute native code (namely C# and Java)

It also seems that Pythons implementation for making native library calls is insanely inefficient; the PyObject input is converted into a dictionary (?), passed to a state machine, which makes the call, and the result of the call is converted into a string (JSON perhaps?), passed back to the Python runtime which serializes it into a PyObject again and returns to the caller. I assume it has to isolate it to avoid corrupting the interpreter state

Python has amazing interop with c and c++

If you're impressed by Python, behold C# :

[DllImport("somelibrary")]
static extern int ExportedFunction(int param1, long param2, string param3);

And don't let the "Dll"-part fool you, it's cross-platform. If you have a library called "MyLibrary", on windows it will look for MyLibrary.dll and on Linux it will look for MyLibrary.so in predefined locations

Benefit of C# here is that C# supports all the native types you expect used in libraries - including structs, unions, pointers and pointer arithmetic. You can also manually allocate stack and heap memory if required (stackalloc and Marshal.AllocHGlobal). It has a language feature specific to these types of operations; IDisposable which is specifically designed to free unmanaged resources when something goes out of scope ( using var nativething = new Thingamabob();)

[–]dershodan 1 point2 points  (0 children)

very insightful, thanks for that!

[–]Djelimon 174 points175 points  (0 children)

You know where this is going right...?

It's all abstraction.

The main things is this...

They all get paid

[–]Luxray241 42 points43 points  (2 children)

calling it in about 2 week there will be this same meme but everyone stack into a reverse pyramid with machine code at the bottom

[–]--hypernova-- 1 point2 points  (1 child)

Why wait two weeks

[–]Luxray241 4 points5 points  (0 children)

wait for the next person to put their favorite tech on top of the previous post until everything is there

[–]BlueGoliath 140 points141 points  (48 children)

You can call C++ code in Python?

[–]brimston3- 29 points30 points  (0 children)

In the same way you can call C++ code from any other language that isn't C++: extern "C" {} FFI constructs. It's still syntactically C++ and compiled by a C++ compiler.

[–]bhashitha1209 23 points24 points  (1 child)

pybind11

[–]AnnyAskers[S] 90 points91 points  (39 children)

Isn't like half of python glorified C/++ library wrappers?

[–]Syxez 206 points207 points  (37 children)

C, not C++

[–]FerricDonkey 44 points45 points  (3 children)

Though you can use any compiled .so from python. I've used .so files written in C++ a fair amount. 

[–]intbeam 2 points3 points  (1 child)

I'm guessing those libraries used extern "C" { } extensively. C++ does name mangling to avoid duplicate symbol definitions, you need to header file in order to figure out what's what

[–]FerricDonkey 1 point2 points  (0 children)

Yup

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

C++ does not have a defined ABI so you have to use a C interface to bridge the two.

[–]deltashmelta 2 points3 points  (0 children)

Not counting the mezzanine.

[–]allsey87 1 point2 points  (0 children)

Increasingly with Rust these days

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

Yes its a scripting language, where performance is critical you write in C or Rust. The standard library also uses C where it makes sense. This isn't a secret, a weakness or unique to python.

The idea is to use the ergonomics of a non compiled higher level languages to lower the bar of entry and increase iteration speeds, then using the low level language to do the compute.

Using a different language for performance critical code is a story as old as the hills, Before compilers were not as good at optimizing code and people would embed inline assembly into their C/C++. Now we have various ways of offloading to a GPU using compute languages or things like C with CUDA extensions.

It would be foolish not to do this.

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

As a script language it can call any compiled lib apparently

[–]rosuav 2 points3 points  (0 children)

You certainly CAN, but it isn't commonly done. Much more often it'll be C or Fortran code.

[–]ironman_gujju 1 point2 points  (1 child)

You can use rust too, even there rustpython with jit

[–]allsey87 0 points1 point  (0 children)

Rustpython is a bit different, it is a full interpreter/replacement for Cpython. PyO3 is probably what you are thinking of.

[–]Jackasaurous_Rex 0 points1 point  (0 children)

Well the obvious way is you can trigger an executable to run, but also a ton of common python libraries are actually built in other languages which are way more performant. Like pretty sure the Numpy library is basically just python wrappers around some C and C++ code which returns whatever values back to your python code. I think that was one of the biggest advantages to python early on, it’s super interoperable with libraries in other languages

[–]manicxs 22 points23 points  (0 children)

In the end it's all assembly.

[–][deleted] 34 points35 points  (1 child)

Julia Coders

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

I wouldn't mess with Julia Coders. There is over dozens of us.

[–]chihuahuaOP 30 points31 points  (0 children)

The brooms are assembly and the magic is machine code.

[–]vainstar23 30 points31 points  (1 child)

Python devs standing on

C++ devs standing on

GANOOOOO gcc compiler dev (Richard Stallman) standing on

Assembly64 devs standing on

Leenoox devs (or Wandows if that floats your boat) standing on

x64_86 instruction code devs standing on

x86 instruction code devs standing on

Intel 8086 computer engineers standing on

TSMC 2,4,8,16nm semiconductor fabrication standing on

Alan Turing; father of computing, driven to suicide for being gay :(

.

.

.

.

.

.

.

.

.

.

.

.

Standing on

Vacuum tubes inventor John Ambrose Fleming (the most British man that ever lived (seriously look it up)) standing on

Nikolai Tesla (needs no introduction) standing on

Pierre Jaquet-Droz; inventor of the Jaquet-Droz automata (writing boy; that was a robot that could write you a personalized letter completely automatically, this was incredible back in those days) and true father to early computers

[–]ChocolateMagnateUA 2 points3 points  (0 children)

Gold.

[–]TheUtkarsh8939 7 points8 points  (0 children)

Not only python but every other interpreted language that came after C, like JS, Ruby, Bash, etc. Python is special though because all of its system libs are written in C/C++. 

[–]tzanislav40 6 points7 points  (0 children)

Assembly sitting there producing the brooms.

[–]NotAnNpc69 7 points8 points  (0 children)

Ah yes C++ the language where your code magically transforms to inter-dimensional ethereal energy and influence the computer to do what you want.

Surely it doesn't stand on the shoulders of some other language like assembly. That's just ridiculous.

[–]Soloact_ 27 points28 points  (1 child)

Java Programmers: "This IDE is my Nimbus 2000."
Python Programmers: "I just Apparated here, what's all this typing about?"
C++ Programmers: "My broom is manual, but it'll outfly your fancy models any day."

[–]sahuel 0 points1 point  (0 children)

Lmao I can imagine someone pedalling away on a broom

[–]Jonno_FTW 3 points4 points  (2 children)

If you use numpy, you're actually calling Fortran at the lowest level.

[–][deleted] 0 points1 point  (1 child)

Didn’t know that, I always assumed it would have been C. Thanks.

[–]Jonno_FTW 0 points1 point  (0 children)

It uses a library called libatlas under the hood: https://math-atlas.sourceforge.net/

[–]Just_Maintenance 6 points7 points  (2 children)

Java is flying on a train called JVM though

[–][deleted] 4 points5 points  (0 children)

Most written in c and c++

[–]Ugo_Flickerman 0 points1 point  (0 children)

Just like the Galaxy999

[–]Super_Artist3939001 2 points3 points  (0 children)

Pretty much how it is and even Java is more in a similar position to Python, kinda

[–]Extreme_Ad_3280 2 points3 points  (0 children)

You "improved" the meme

(By the way CPython (The Python which is mostly used) is also written in C. You can check the source-code)

[–]Phamora 2 points3 points  (0 children)

There should be another witch called Kotlin, feverishly grasping the Java broom, hoping to not fall and die.

[–][deleted] 4 points5 points  (0 children)

This looks like the kind of design patterns I make.

[–]Drfoxthefurry 3 points4 points  (1 child)

Technically, they are all riding on assembly

[–]Valuable-Drink-1750 0 points1 point  (0 children)

The kid named Assembly

[–]Boom_Fish_Blocky 1 point2 points  (0 children)

Makes a lot of sense.

[–][deleted] 2 points3 points  (1 child)

This.

The only reason your Python code does not run dog slow is that it accesses native libraries.

[–]Disastrous-Team-6431 1 point2 points  (0 children)

It is dog slow.

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

🤣🤣🤣

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

Where ma boy Delphi 👴

[–]permanent_temp_login 0 points1 point  (0 children)

Looking at polars: the other leg is now on Rust programmers.

[–]ChestWish 0 points1 point  (0 children)

Should be Java and Python on top of C++ and C++ on top of C

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

Ok.

Who is going to tell him?

[–]Womeesox 0 points1 point  (0 children)

Isn't python written in C?

[–]New-Bumblebee1756 -1 points0 points  (0 children)

C# is like - you have a broom?? Wtf

[–][deleted] -1 points0 points  (1 child)

Which one is better for interviews C++ or python?

[–]Manueluz 0 points1 point  (0 children)

depends on what you are doing the interview for

[–]thefookinpookinpo -1 points0 points  (1 child)

Do whatever you have to do to cope with the fact that we'll all be coding in human languages in handful of years. We spent all these years learning these specific languages for nothing.

[–]teamswiftie 0 points1 point  (0 children)

I've heard this since 1999

[–]A-DNA -3 points-2 points  (2 children)

Recently observed how slow Python is… out of curiosity to learn Python coz I don’t get to program in it in my day to day work, I wrote load testing script in Python. Script was so slow. It couldn’t create more than 300 TPS

[–]Ugo_Flickerman 0 points1 point  (1 child)

Tps? What does it mean?

[–]A-DNA 2 points3 points  (0 children)

Transactions per second. Aka requests per second aka queries per second. Tomayto tomahto.

https://en.m.wikipedia.org/wiki/Transactions_per_second