this post was submitted on 25 Sep 2024
384 points (92.9% liked)

Programmer Humor

19570 readers
1795 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
 
(page 2) 47 comments
sorted by: hot top controversial new old
[–] [email protected] 39 points 1 month ago

Rust (derogatory)

[–] [email protected] 96 points 1 month ago (1 children)

How can a rewrite in a completely different language violate this license? There should also be a clause "Once you looked at the source code you must not write anything with similar functionality .... in any programming language"

[–] [email protected] 44 points 1 month ago (1 children)

Leaked Windows code made Wine and ReactOS devs anxious, since MS could sue over it. On the other hand, I've looked up the keycodes from the Linux kernel for X11 (it's literally just PS/2 with the unused codes being used in place of the E0 keys), and they haven't yet came after us.

[–] [email protected] 47 points 1 month ago* (last edited 1 month ago) (1 children)

It made them nervous because someone might put parts of the original source into Wine. You can't do that in a rewrite in a different language, it doesn't even make sense. The thing the people in this screenshot are gloating about isn't even relevant to this license.

load more comments (1 replies)
[–] [email protected] 12 points 1 month ago (2 children)

I want to use Rust, but it lacks an Specification. Until that is done it's a no go.

[–] [email protected] 11 points 1 month ago

TIL about this problem.

[–] [email protected] 11 points 1 month ago (2 children)

What is this abi and standard calling methods you speak off? Are you a rust-non-believer or some shit! Rewrite it all in rust, no questions asked!

( i too like the ideas of rust, but without a decent abi or not constantly changing interface, its useless to me. I dont want to rebuild all code, including libraries every time i update 1 library in my application )

[–] [email protected] 8 points 1 month ago (3 children)

You're aware that Rust gives you access to the full C ABI?

What language are you going to use instead that has a better ABI story? Swift? Or maybe a dynamic language like Python?

[–] [email protected] 8 points 1 month ago* (last edited 1 month ago) (3 children)

I know that exists, but whats the point of that? You loose all advantages of rust when you use the library then because it cant predict application state with the library code. There is a reason all those rust libraries are compiled locally when you compile a rust application. Its a major lacking point for rust, and as long as it lacks that its dead in the water for big projects.
Again, i like strong type stuff and i like the ideas of rust but it is not grown up enough for me

load more comments (3 replies)
[–] [email protected] 1 points 1 month ago

Do you mean everything that uses LLVM automatically gets an ABI standard?

That's so nice of clang, really they should be proub.

[–] [email protected] 1 points 1 month ago* (last edited 1 month ago) (1 children)

Are you suggesting OP write a C application and then compile it as Rust? I'm not a pro, but that sounds kind of janky.

[–] [email protected] 9 points 1 month ago (1 children)

I'm suggesting building a Rust library and exposing a C ABI. That's what rsvg does for example.

[–] [email protected] 3 points 1 month ago* (last edited 1 month ago) (2 children)

Oh. There's a still Rust-y way to do this? Nevermind.

OP wanted stability and predictability. I suppose we'll see how entrenched one library can become.

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

The Rustinomicon has a chapter on it. The basics are quite simple: Declare non-opaque types to use layout matching the C ABI, export/import functions, some wibbles around name mangling. Option<T> vs. null pointers. Where things get a bit more involved is unwinding, but then you're at the end of it, nothing should be shocking to anyone having written C.

As to how Rusty it is... not very. I mean Rust has first-class FFI support, but the way FFI stuff is written is necessarily unidiomatic because you're basically writing C in Rust syntax and you won't get out of declaring your own functions `unsafe' before you read the rest of the Rustinomicon to understand what properties you need to ensure because the nice and shiny parts of Rust assume them.

[–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (1 children)

Hmm. So I guess it comes down to what OP is doing. They either want to write a Rust library, or something that uses a Rust library that may not be standardised or even exist yet. If the latter, they should stick with C.

[–] [email protected] 3 points 1 month ago

Writing C bindings to a Rust library is the easier scenario because you can rely on the safe code having nice and clean memory semantics.

[–] [email protected] 2 points 1 month ago

Yeah, Rust has pretty good integration of it: https://doc.rust-lang.org/nomicon/ffi.html#calling-rust-code-from-c

You do lose some of the Rust-y-ness, because obviously the C ABI is much more simplistic, but in terms of a stable ABI, it's impossible to beat C.

load more comments (1 replies)
[–] [email protected] 68 points 1 month ago (3 children)

That's a lot of words for "I don't understand the borrow checker"

In all seriousness, yeah rust users are annoying, but I think rust is a welcome change over C/C++

[–] [email protected] 46 points 1 month ago (2 children)

Hey I'm both an annoying Rust user and I also don't understand the borrow checker. I just put & and * in front of things until it works.

[–] [email protected] 14 points 1 month ago

I found this tutorial pretty helpful for that: http://intorust.com/

You can presumably skip the first two chapters...

load more comments (1 replies)
[–] [email protected] 38 points 1 month ago

Speaking as an annoying Rust user, you're being bigoted. I'm annoying, but the vast majority of Rust users are normal people who you wouldn't even know are using Rust.

Don't lump all the others in with me, they don't deserve that.

[–] [email protected] 15 points 1 month ago (1 children)

While the borrow checker has its downsides, so its legitimate uses. A few people in the D community were thinking about implementing it as a library.

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

Didn't know D still had an active community, that's pretty awesome. Wonder if someone has ever worked on a borrow checker for Nim.

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

D seems to getting traction yet again, and some stuff might get better (D3, new GC, new standard library, etc).

[–] [email protected] 122 points 1 month ago (13 children)

It is so weird when people idolize programming languages. They are all flawed and they all encourage some bad design patterns. Just chill and pick yours.

[–] [email protected] 15 points 1 month ago (4 children)

Have you actually ever seen an example of such an annoying rust dev? Cause I haven't, only a ton of people who see rust as their enemy number 1 because of such people. Those who are "annoyed" are way more annoying…

[–] [email protected] 15 points 1 month ago

I have. You just don't hang out in the "right" places

[–] [email protected] 9 points 1 month ago

I have made experiences with annoying PHP devs and I don't hate them.

My critic wasn't towards rust devs or any devs of any language but towards idolization of a language instead of studying the nature of those languages the flaws and advantages and use the best tool available or attempting to create a better tool.

load more comments (2 replies)
[–] [email protected] 2 points 1 month ago (2 children)

...but what if I pick the one with all the furries? :3

[–] [email protected] 3 points 1 month ago

I am proud of you and wish you happiness in your little corner of this world.

load more comments (1 replies)
[–] [email protected] 87 points 1 month ago* (last edited 1 month ago) (14 children)

Yeah, but that makes it sound like they're all equal, and there hasn't been any progression, which is untrue. You're either insane or a historical reenactor if you write something new in COBOL.

I think Rust is genuinely a huge leap forwards compared to C/C++. Maybe one day it will be shitty and obsolete, and at the very least it will become a boring standard option, but for now...

[–] [email protected] -2 points 1 month ago (1 children)

There have been "improvements" but fundamentally in my perspective, these "improvements" could be revealed to be a mistake down the line.

Assembly has produced some insane pieces of software that couldn't be produced like that with anything else.

Maybe types in programming languages are bad because they are kinda misleading as the computer doesn't even give a shit about what is data and what is code.

Maybe big projects are just a bad idea in software development and any kind of dependency management is the wrong way.

I like modern languages, types and libraries are nice to have, but I am not the student of the future but of the past.

[–] [email protected] 12 points 1 month ago (1 children)

That's a valid argument, but a very weak one. If we are not completely sure something is an improvement in all aspects are we just to dismiss it altogether?

[–] [email protected] 7 points 1 month ago* (last edited 1 month ago) (1 children)

Yeah, you could dismiss combustion engines for the same reason, or like, carpentry. You wouldn't be wrong, they have caused problems down the line at various points (modern climate change, medieval deforestation), but you bet I'd still call them an advance on mule power, or on no carpentry.

This is pretty much an nullification of the idea of technological progress existing at all, which is a kinda hot take.

@[email protected], so you can reply in the right place.

[–] [email protected] 3 points 1 month ago (1 children)

I see your perspective and I think you kinda miss my perspective which I am to blame for.

I don't say there weren't improvements. I am saying that given the uncertainty of "goodness". Maybe we shouldn't idolize it. You can appreciate the attempt of creating memory safe code through a programing language without thinking the bare metal code should be written in that language. You can like a typeless easy to write language like Js without thinking desktop app should be written in it. You can like the idea behind functional programming while believing that any application is in the end about side effects and therefore a purely functional application impossible.

You can approach the whole topic as an area of study and possible technological advances instead of a dogma.

[–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (1 children)

Oh, well I can agree with that.

You can like the idea behind functional programming while believing that any application is in the end about side effects and therefore a purely functional application impossible.

It's a bit of a tangent, but if you're doing something completely deterministic and non-interactive, like computing a digit of pi, it's great in practice as well. I use Haskell semi-regularly for that kind of thing.

You could argue printing the output is a side effect, but is a side effect followed by termination really "side"?

load more comments (1 replies)
[–] [email protected] 15 points 1 month ago (1 children)

I now want a community led historical reenactment of loose tie wearing software devs in the 60s where they are just chain smoking and banging out COBOL or Fortran punch cards

[–] [email protected] 9 points 1 month ago

[email protected]

I don't think much happens in person, but the community for it definitely exists.

[–] [email protected] 15 points 1 month ago (1 children)

Rust is already obsolete, compared to Stingpie's excellent assembly language, paired with object oriented programming!

This is the SEALPOOP specification:

  1. an assembler must create a binary program which satisfies the programmer's specifications.
  2. a compiler must translate the programmer's code into SEALPOOP's parallel instruction set source, which should be fed into the SEALPOOP PISS assembler.
[–] [email protected] 3 points 1 month ago (1 children)

Well that's going to get cancelled. Think of the non binary folk out there!

load more comments (1 replies)
load more comments (11 replies)
load more comments (10 replies)
[–] [email protected] 29 points 1 month ago (2 children)
[–] [email protected] 25 points 1 month ago

Some of these people are Javascript web developers idealizing system development and the C language.

load more comments (1 replies)
[–] [email protected] 42 points 1 month ago

That’s insanely dumb

[–] [email protected] 23 points 1 month ago* (last edited 1 month ago)
[–] [email protected] 58 points 1 month ago

It really whips the crab's ass.

[–] [email protected] 14 points 1 month ago (1 children)
[–] [email protected] 1 points 1 month ago
load more comments
view more: ‹ prev next ›