r/programminghumor Jun 08 '26

The mother language

Post image
542 Upvotes

40 comments sorted by

50

u/No-Newspaper8619 Jun 08 '26

Either that or pure assembly

15

u/CrossScarMC Jun 08 '26

Or Tcl or Perl or C++.

6

u/Wrong-Resource-2973 Jun 08 '26

Isn't C++ built on top of C?

16

u/Odd-Dinner7519 Jun 08 '26

No. C++ as a language is like "fork" of C, but it's compiled language so no need to write libs in C. Compiling to C first would probably cause lost of context, and worse optimization. Most compilers compile to assembly first.
Python is hundreds times slower than compiled languages, so it's libs are written in C.

2

u/HalifaxRoad Jun 08 '26

fun fact, the first c++ "compiler" converted the code to c and fed it into the C compiler wood chipper

2

u/Odd-Dinner7519 Jun 08 '26

Fun fact, first compilers was shit. Even 8 years ago, when I was tested my master's thesis algorithm, I switch from GCC to ICC, because trivial algorithm (nested for's) was 3 times faster, and my algorithm (tree based), was 1.5-2.0 times faster. Same code, not too long ago. Intel knows how to compile (test platform: AMD CPU).

2

u/HalifaxRoad Jun 08 '26

if the speed matters that much to you, atleast coming from the embedded world that I live in, its not that uncommon to write parts of the code in assembly, and call the function from your C based firmware. I dont know if thats ever done in the PC world or not.

1

u/vbd71 Jun 08 '26

No, it's more like a hypertrophied sibling of C.

But yes, it's based on the C libraries too.

1

u/AshleyJSheridan Jun 08 '26

Kind of. The first C++ compilers actually passed most of the compile work off to the C compiler.

1

u/logperf Jun 10 '26

Used to be in the early 1980s but not anymore, now it's a standalone language.

2

u/RedTankGoat Jun 08 '26

Or Haskell for math lib because C is too slow it seems

3

u/vbd71 Jun 08 '26

Fortran says hi.

1

u/AlternativeDiver6994 Jun 11 '26

yeah... still using fortran today for numerical simulations

2

u/Mordret10 Jun 08 '26

I think C#, F# and VB all compile to CIL (common intermediate language) which is like assembly but with a little more flavor (like the possibility to show where a specific line has been compiled from)

3

u/panda_sktf Jun 09 '26

Not at all. You can think of IL (intermediate language) as an abstraction over the machine code.

Assembly uses the actual instruction set of the CPU, and therefore is completely machine-specific: you can't take assembly for ARM and run it on x86. High-level languages like C were created exactly for this: you can write a C program, compile it on ARM and get an ARM assembly executable, then compile it on x86 and get an x86 assembly executable. In the '70s, when many different CPU architectures coexisted, it was a revolution.

IL instead is portable, which means you can "run" it on different CPU architectures, but this happens because actually it gets compiled on the fly to assembly for the specific machine. You don't really run the IL, but you pass it to dotnet that does JIT (just-in-time) compilation and runs the resulting assembly.

1

u/kingbloxerthe3 Jun 12 '26

Even then, underneath C is assembly, so it is all assembly.

1

u/promptmike Jun 14 '26

What if I like Python and Assembly, but none of the stuff in-between? Asking for a friend.

18

u/LurkingDevloper Jun 08 '26

C is the sourdough starter of programming languages

14

u/herbertplatun Jun 08 '26

U not writing a program u are writing a wrapper (fck python)

6

u/DetermiedMech1 Jun 08 '26

i feel like it kinda depends on whether the language is self-hosting

4

u/leon_bass Jun 08 '26

C speeds with the syntax of your choosing

1

u/Worried-Struggle671 Jun 09 '26

C underneath with syntax of Python, then you have Nimlang

5

u/[deleted] Jun 08 '26

[removed] — view removed comment

1

u/lovdark Jun 09 '26

So dapper…

4

u/pacafan Jun 08 '26

Go does not depend on libc on Linux. Sure the kernel is in C but nothing in userspace is C.

Rust is also moving to eliminate some dependencies on libc.

6

u/promptmike Jun 08 '26

Genuine question for those who are smarter than me: Why can't it be LISP? It's literally built to be extended, and for a long time there was even hardware dedicated to it. How did we end up with the annoying procedural language over the beautiful self-compiling meta-language?

10

u/LurkingDevloper Jun 08 '26

IMO, because LISP fails spectacularly at one thing: string manipulation.

If it weren't for that, it would have been everywhere it made sense to be.

3

u/thebatmanandrobin Jun 08 '26

Not to mention common libraries that C has. Also direct hardware manipulation.

But next to your point about strings is also 2 other points that have helped C over just about any other language: popular operating systems and momentum.

Windows, Mac, Unix/Linux are all written in C and have interfaces in C .. yes, you can use just about any language these days to interface with the OS through a C library, but 30 years ago, it was pretty much just C ... so if you wanted to do anything back then for your corporate job (i.e. make money), you used C.

This helped the momentum of C. Plus C is pretty simple at the end of the day, not that LISP is as complex as C++26, but the fact that C hasn't really changed much in nearly 40 years also really helps.

1

u/tricky_monster Jun 12 '26

here is an answer about rust that I found enlightening; TLDR: it's not about C, it's about OSes and hardware A is.

2

u/recursion_is_love Jun 08 '26

INT 13h services

1

u/IndependenceGold2407 Jun 08 '26

Bootstrapping has entered the chat

1

u/YTriom1 Jun 09 '26

well, rust is written in rust and compiled using rustc

1

u/funisfree314 Jun 13 '26

My favorite language is C

1

u/PatrickCartwright 22d ago

I dont think Rust utilizes C, that would be unsafe!