this post was submitted on 14 Mar 2024
1284 points (98.5% liked)

Programmer Humor

19692 readers
74 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 25 points 8 months ago (5 children)

All those memes picturing C++ as unsafe and unstable yet the server that serves these memes is running mostly C/C++ and has an uptime of months.

[–] [email protected] 35 points 8 months ago (2 children)

Lemmy is written in Rust. There might be bits of C at the periphery behind bindings.

[–] [email protected] 22 points 8 months ago (3 children)
[–] [email protected] 24 points 8 months ago* (last edited 8 months ago)

Predominantly C. But even the kernel is beginning to use Rust as a way of avoiding entire classes of programming error.

[–] [email protected] 6 points 8 months ago

well and it's only running this well because of decades of effort and millions of effort spent on security reviews

[–] [email protected] -1 points 8 months ago* (last edited 8 months ago) (1 children)

They implemented some sort of OOP tho.

edit: I meant: the Linux devs implemented some sort of OOP in their C code in the kernel – is something i read forever ago.

[–] [email protected] 11 points 8 months ago

Rust isn't really OOP like C#, Java or C++ - it has structs with functions that you could consider an "object" but there is no inheritance. Instead Rust uses traits which are a little bit like interfaces in some languages.

The way the kernel is using Rust at the moment is to produce safe bindings for modules to be written in Rust, i.e. you can create a module in Rust source which will be correctly loaded up, the code is safe by default and will have access to kernel services via bindings. I expect over time that more of the kernel will become Rust, but the biggest impediment right now is Rust relies on LLVM and LLVM only supports a subset of targets that a kernel could potentially support with another compiler like gcc.

[–] [email protected] 3 points 8 months ago

Lemmy is written in Rust.

Wow, way to ruin my joke.

[–] [email protected] 17 points 8 months ago

True, but that's partly because the Linux is beyond mature, and you can ferret out a lot of bugs with millions of users over decades.

[–] [email protected] 14 points 8 months ago (1 children)

Also they're always treating C++ like it's some arcane enterprise variant that uses 1990s C++

Using modern C++ you can write much cleaner, more usable, and really safe code

[–] [email protected] 1 points 8 months ago

Having a thorough process and an engineer approach in software development is also pretty handy. There weren’t many bugs in the AGC. Yet it was programmed mostly in assembly and people had no trouble trusting it with their life.

[–] [email protected] 7 points 8 months ago (1 children)

yet the server that serves these memes is running mostly C/C++

Time to rewrite it in Rust!

/ducksandruns

[–] [email protected] 4 points 8 months ago (1 children)

if i remember lemmy is written in rust

[–] Scoopta 2 points 8 months ago

Lemmy is rust and it's alternative sublinks is java...your comment has now power here