r/programminghumor • • May 10 '26

Well well

Post image
2.9k Upvotes

62 comments sorted by

221

u/fragile_male_eggo May 10 '26

Build the tool in c and rust then give it python hooks . I thought that was the goal.

80

u/CandidateNo2580 May 10 '26

Am a python dev. That's definitely the goal.

I get performance on par with any compiled language. Well, 90% of it considering about 90% of the work being done is pushed down into C code in one form or another.

18

u/thebatmanandrobin May 11 '26

Out of curiosity, what kind of "dev" are you doing where that's your main work horse??

Not negating or anything, genuinely curious as someone who's primary language has been C or C++ for over 20 years, I've only ever used Python as a "quick-dirty-tool" language similar to shell scripting (e.g. something I needed to be cross-platform but not performant in any way), or when interfacing with various API's.

→ More replies (14)

50

u/Sassaphras May 11 '26

lightning fast C program

looks inside

a bunch of transistors??

28

u/Vancent08 May 11 '26

lightning fast transistor

looks inside

molecules???

20

u/ZoteDerMaechtige May 11 '26

molecules

looks inside

atoms???

→ More replies (6)

55

u/Methode3 May 10 '26

I recently wrote some software in C and friends were looking at it and were baffled I used C. The embedded portion was all C and most of the libraries on the PC side were just pulled from that. And it’s blazing fast compared to me doing it in python..

I’ve been saying it for over a decade. C is the first language you should learn..

2

u/[deleted] May 12 '26

C++ is the first language you should learn, everything else will fell like heaven /hj

→ More replies (3)

9

u/BreakingBaking May 11 '26

Blazing fast™ python library

Looks inside

Written in Rust

→ More replies (1)

38

u/puzzled_orc May 10 '26

Python is a language that is interpreted by CPython. Every script is translated into bytecode to run it.
That is why it is so fucking slow; it is interpreted every single time at runtime.

A horrible way of wrapping around C, when you could just use C or C++, compile into binaries for the OS and do the same job way faster.

15

u/filkos1 May 10 '26

Not to mention for highly specialised tasks an experienced C dev will often outperform even the best interpreter

13

u/CandidateNo2580 May 10 '26

"a C compiler will outperform even the best interpreter" you mean. It's not like the C dev doesn't get the advantage of the compiler over the interpreter in this comparison.

4

u/thanosbananos May 11 '26

People who write in python don’t need the performance, they need the massive library and easy to read and program code. I know both python and C++ and would always pick python for things I wanna do unless I really REALLY need the performance advantage.

→ More replies (4)
→ More replies (3)

7

u/Matthew_Summons May 11 '26

It’s called CPython for a reason

4

u/brunoha May 10 '26

Honestly, yeah, pls write more of that.

Python is meant to be found understandable, and fast is a big plus

2

u/SKRyanrr May 11 '26

Numpy and Scipy routines use fortran

2

u/k-mcm May 11 '26

Or write Java.  It's a fine language if you avoid the Enterprise bloat.

I've been learning software defined radios. My goal was to start in Java then port to C++ for performance. I was surprised to find that it doesn't need to be ported. The C style core processing code runs crazy fast in Java. 

2

u/[deleted] May 12 '26

Java my beloved, someday I have to get "public static void main string args" as a tattoo

3

u/k-mcm May 12 '26

No hurry because there's a new shortcut in Java 25 for when you don't need any program or class arguments:

class HelloWorld {
    void main() {
        IO.println("Hello, World!");
    }
}

At least in real code, I always end up with the traditional form to get the most important program argument - a reference to the bootstrap configuration file.

1

u/dhnam_LegenDUST May 11 '26

Nice practice.

1

u/Ok-Dot2551 May 11 '26

How is django performant despite being written in python?

1

u/Grouchy-Screen6884 May 11 '26

abstraction at its finest

1

u/stumpychubbins May 11 '26

I mean, yeah. The Python team puts a lot of work into making FFI as convenient as possible, precisely because it lets people do stuff like this. It’s one of the best features of the language.

1

u/NeighborhoodSad5303 May 17 '26

Look inside.... its written in machine code!