Spyke
Skullgridreply
lemmy.world

the c++ team is a sacrifice I'm willing to make. can we just shoot Brendan Eich in the head if he's not in there too?

66

I feel like all C++ does these days is badly and very slowly copy other languages. It wouldn't be a huge loss.

12
KSP Atlasreply
sopuli.xyz

C++ is better suited to lower level operations than Go, C++ can have huge control over the environment (allowing it to be run on bare metal with no OS) while Go is limited due to it using a garbage collector

If there was a replacement for C++, the best bet IMO would be Zig

15
stetechreply
lemmy.world

As someone who knows neither of the three: Why Zig over Rust as a Cpp replacement?

2

As someone who just picked through the Zig docs (take this with a mountain of salt), Zig has a few things going for it:

  • spec is simple and closer to C in scope
  • modern language design, toolchain, and overall ergonomics
  • Go-like struct & interface system
  • 1st-class C interoperability

Go foists co-routines on you and the runtime, and Rust has the borrow checker. Both of these things deeply impact language design, standard libraries, and the overall developer experience. So Zig might actually be a "more modern C" in many ways which makes it a contender. That said, it's not a 1:1 comparsion since it lacks everything else that C++ does: you'd have to re-envision your software designs as something other than OOP if that's what you're used to.

4
lemmy.world

Rust has its own issues.

Before the memory safety craze, Rust was hyped as a functional programming language, meaning it not only has lambdas and monads, but also const by default, which will force you to rethink all your programming decisions. Also no classes, so you do even more rethinking.

3

I don't just rethink my programming decision but all my life decisions every night. Seem like Rust is the perfect language for me.

2
lemm.ee

I am currently in the process of completely rewriting the BSD kernel in go.

3
lime!reply
feddit.nu

how are you handling the GC? how are you handling things like interrupts?

6
kattfiskreply
lemmy.dbzer0.com

They've done amazing work trying to turn the clusterfuck they started with into a good language

2
scutigerreply
lemmy.world

That "trying" is doing the heavy lifting in that sentence.

6
kattfiskreply
lemmy.dbzer0.com

What are some of the outstanding issues that haven't been addressed? I feel like there are genuinely good ways of doing everything these days

1
sopuli.xyz

“You and your entire family” means “All life on Earth”.

That should make the decision somewhat easier.

48
Zozanoreply
aussie.zone

By my definition, family is who you treat like family.

11

Ok so this one just isn't fair.

Two possibilities end up with me dead, two end up with millions dead, and one ends up with me being unemployed.

Sorry not sorry Team A and B, sacrifices must be made.

26
BatmanAoDreply
programming.dev

Unless you work for the committee or for ISO somehow, then I don't think that really follows. C++ and JavaScript were both used in production for decades before they had standards, and the dissolution of the standards committee wouldn't cause compiler vendors to stop developing compilers.

1
superkretreply
feddit.org

Assuming it is in the US, at 4.5 million it can only be San Francisco/Oakland/Berkeley.

16
underiskreply
lemmy.ml

would the bomb also kill javascript and C++ or would I have to keep throwing trolleys at it until I get both silicon valley and the JS/C++ devs?

31
jolreply
discuss.tchncs.de

At that distance it also kills you, so it sounds like a good deal. No regrets.

18

I've played enough X-COM to know that 50/50 is actually 100%, I just don't know which way. Better trigger it!!

19

30%? Let me deliver that shot with crit across the map to your teammate hunkered down behind full cover for you!

9

Well, you can take yourself out of the equation because you're not tied down and can just move after flipping the switch.

chooses bottom track

"C'mon...c'mon!"

trolley heads towards committe members

"Dammit!"

runs over and jumps on the nuclear bomb pressure pad

19
Ashelynreply
lemmy.blahaj.zone

You are on track A and the bomb is within sight. If you get the shit end of the 50/50, everyone in the diagram would be vaporized instantly

18
Steve Dicereply
sh.itjust.works

So you're saying there's a 100% chance the comitees get vaporized by choosing the bottom track.

16
Ashelynreply
lemmy.blahaj.zone

Well, no.

In scenario A they are instantly vaporized. In scenario B they are brutally sliced into multiple pieces and crushed to death, rather painfully depending on the speed of the trolley.

7
xmunkreply
sh.itjust.works

Maybe we could use Javascript to direct a simple robot to set the lever while we remain at a safe distance?

Maybe the real solution to this diagram is to nuke it from orbit.

13

There is at least one user here in the superposition of being on two tracks at once.

5

I assumed that the bomb would only kill 4.5 million people but all 8 billion are acceptable too, unless the teams a and b happen to be in the blast radius which seems unlikely. To me the area was only referencing the location of the bomb not the train.

1

Middle track. Then I have plenty of time to hotwire the nuke with my handy dandy mallet

5
lemmy.world

Quickly move the switch while on track, then hope the paths willl be wide enough to stop the trolley.

3

Same as normal but you chose the status quo rather than having it enforced upon you.

4

Am I also in range of the nuclear bomb, or am I safe? Unclear as the image doesn't specify if it is drawn to scale or not. Also which direction are the tracks currently pointing.

1
sga
lemmings.world

my family is dying and i dont like it, atleast get me on the tracks with them, would not be able to live with the guilt anyway

1
Flipperreply
feddit.org

Take another look, you're already standing on the top track.

16