White House urges developers to dump C and C++ (www.infoworld.com)
from L4s@lemmy.world to technology@lemmy.world on 28 Feb 2024 18:00
https://lemmy.world/post/12522532

White House urges developers to dump C and C++::Biden administration calls for developers to embrace memory-safe programing languages and move away from those that cause buffer overflows and other memory access vulnerabilities.

#technology

threaded - newest

CaptainSpaceman@lemmy.world on 28 Feb 2024 18:34 next collapse

Good luck with that, C/C++ are still crazy popular

eager_eagle@lemmy.world on 28 Feb 2024 22:45 next collapse

well… that’s the point - if they weren’t this wouldn’t be a concern

fruitycoder@sh.itjust.works on 29 Feb 2024 20:15 collapse

We really need to get the kids to stop programming with punch cards. /s

AA5B@lemmy.world on 01 Mar 2024 04:12 collapse

Damn, it’s been like 25 years since I touched either of those. Aside from OS development, do people really do that anymore?

CaptainSpaceman@lemmy.world on 01 Mar 2024 04:47 next collapse

geekboots.com/…/why-c-is-so-popular-and-still-the…

Basically, C runs the modern world. WiFi, MacOS, Windows, Linux, and so much more

ArmainAP@programming.dev on 01 Mar 2024 05:01 next collapse

C++ is also the standard in game dev. You may see some C# here and there, but most engines, public available or otherwise, are built on C++.

If it is a AAA game, I can assure you it is most likely made with C++.

poopsmith@lemmy.world on 01 Mar 2024 05:12 next collapse

Most of the embedded world uses those.

Subverb@lemmy.world on 01 Mar 2024 14:34 next collapse

Embedded systems developer here. If you’re programming on ARM or one of the other big microcontrollers there aren’t many well supported options. ARM’s official Keil compiler and libraries are C and C++ and I see no official movement to change that.

They have literally decades in building those tools.

Microsoft’s multithreaded OS ThreadX is C code. They just bought it for a large undisclosed amount in 2018. It ain’t going anywhere soon.

AWS’s FreeRTOS is C. Not going anywhere.

Embedded development toolchains are very slow to change.

flatpandisk@lemm.ee on 01 Mar 2024 22:20 collapse

A large chunk of not most of robotic development is C and C++. Since working with a mixture of hardware, software, and even performance software here comes C and C++.

darkevilmac@lemmy.zip on 28 Feb 2024 18:36 next collapse

Probably a good idea, plenty of languages out there that can give good performance while being memory safe nowadays.

hagelslager@feddit.nl on 29 Feb 2024 00:45 collapse

Such as? (Non-programmer here, so I don’t know the ins and outs of programming languages.)

darkevilmac@lemmy.zip on 29 Feb 2024 01:04 next collapse

Zig and Rust come to mind, at least for replacements for low level languages.

parens@programming.dev on 29 Feb 2024 15:05 collapse

Zig isn’t memory-safe

darkevilmac@lemmy.zip on 29 Feb 2024 16:17 collapse

My bad, I was thinking of Nim but wrote Zig for some reason. Long day yesterday 🙃

Jakeroxs@sh.itjust.works on 29 Feb 2024 07:45 next collapse

C#

scharf_2x40@lemmy.world on 29 Feb 2024 08:31 next collapse

Isn’t that only microsoft exclusive and closed source? Also does compiling it really yield the same speed as C, it is garbage collected isn’t it?

lemann@lemmy.dbzer0.com on 29 Feb 2024 09:48 collapse

Was always possible to compile+run C# on Linux using the Mono project. Until Microsoft “bought them out” and created .NET Core, a cross platform version of .NET that MS now encourages people to use instead…

Microsoft’s new linux compile tools rub me the wrong way slightly, with the telemetry that’s opt-in by default.

Mono is still extremely valuable for older .NET Framework apps under WINE though, way easier to setup compared to the official installers from what i’ve experienced.

No idea how compiled C# compares to C…

sunbeam60@lemmy.one on 29 Feb 2024 19:59 collapse

Compiled C# is about half the speed of C/C++

…pages.debian.net/…/box-plot-summary-charts.html

Jakeroxs@sh.itjust.works on 01 Mar 2024 17:50 collapse

But it also doesn’t have memory leaks lol

sunbeam60@lemmy.one on 01 Mar 2024 20:26 collapse

Definitely. I’ve worked professionally in both. They both have a time and place. I’d be fine with moving all the low level stuff to Rust, but transitions don’t happen by decree so C/C++ will be around for the next 100 years too.

Jakeroxs@sh.itjust.works on 01 Mar 2024 20:32 collapse

True that, I’m only at the beginning of my programming journey, so I have a very rough understanding of the differences, pros/cons, and best use cases for various languages.

Asifall@lemmy.world on 01 Mar 2024 15:37 collapse

*proceeds to wrap everything in unsafe {}

lolcatnip@reddthat.com on 01 Mar 2024 18:31 collapse

Rust is the main one for the kind of code that’s typically written in C++. Most memory-safe languages make big compromises on performance, but Rust code tends to run about as fast as comparable C++ code.

JoMomma@lemm.ee on 28 Feb 2024 19:05 next collapse

Gov is getting rusty

omega_x3@lemmy.world on 28 Feb 2024 23:15 next collapse

Team Fortran raise up, but not too fast our old bones aren’t as strong as they used to be.

BigDanishGuy@sh.itjust.works on 29 Feb 2024 19:56 next collapse

Maybe you can use Team COBOL’s wheelchairs as walkers?

TunaLobster@lemmy.world on 01 Mar 2024 15:43 collapse

I updated an internal library from 77 to 90 last week. We’re working quickly these days!

treadful@lemmy.zip on 28 Feb 2024 23:19 next collapse

“We, as a nation, have the ability—and the responsibility—to reduce the attack surface in cyberspace and prevent entire classes of security bugs from entering the digital ecosystem but that means we need to tackle the hard problem of moving to memory safe programming languages,” National Cyber Director Harry Coker said in the White House news release.

o7

Imgonnatrythis@sh.itjust.works on 28 Feb 2024 23:38 next collapse

I think we should politicize code. It seems so unfettered by politics so far while so many other things are nicely split amongst party lines. Seems like maybe the Republicans should embrace C and the democrats can have python or something.

sexual_tomato@lemmy.dbzer0.com on 29 Feb 2024 00:01 next collapse

Republicans get C, Java, Lua, and C++; Democrats get Ada, Rust, C#, and Python; Libertarians get Zig, TCL, Julia, and Ocaml for some reason.

rottingleaf@lemmy.zip on 29 Feb 2024 05:12 next collapse

I thought this is a tech space, but you’ve just made a lot of people Republicans.

One would also expect Ada to be Republican.

And can libertarians please have Common Lisp?

Sylvartas@lemmy.world on 29 Feb 2024 17:38 collapse

Ada could never be republican, on the basis that it’s named after a british woman scientist. I don’t think she’s on record as a feminist, but that’s about the only thing that would make her “worse” in their eyes

Also why do the democrats only get languages for people who don’t care about performances ? /s ^(it’s just a prank bro)

rottingleaf@lemmy.zip on 29 Feb 2024 18:27 collapse

I was thinking about the association of the Ada language with defense stuff, and also her being Byron’s daughter, which is more specific than being British, I’m not sure she’d complain about associations with Republicanism, but then this can also be interpreted in favor of libertarians.

No, the question is valid about weird selection of languages for Democrats. I think what they meant is that separation of various issues between parties is orthogonal to any sane logic, so we should do this with programming languages too.

Also I want to know who gets Erlang.

WelcomeBear@lemmy.world on 29 Feb 2024 06:24 next collapse

Ruby is just one guy, Vermin Supreme

TORFdot0@lemmy.world on 29 Feb 2024 07:04 next collapse

Ruby-off-the-rails

yuriy@lemmy.world on 29 Feb 2024 19:07 collapse

Vermin Supreme still stands by his pony plan doesn’t he? You KNOW he’s out here using FiM++

WelcomeBear@lemmy.world on 29 Feb 2024 19:41 collapse

I stand corrected!

mods_are_assholes@lemmy.world on 29 Feb 2024 10:47 next collapse

haha as if repugnicunts code…

Mango@lemmy.world on 29 Feb 2024 20:40 collapse

Why do Republicans get the good stuff?

NeatNit@discuss.tchncs.de on 29 Feb 2024 10:04 collapse

Can I both upvote and downvote you? Seems most appropriate

OutrageousUmpire@lemmy.world on 29 Feb 2024 01:13 next collapse

I’m not sure what to think about this. It’s bizarre, the White House making any recommendations on programming languages.

They’re definitely not seen as an authority in this field. Why would anyone care what recommendation they make? And so why make one at all?

mox@lemmy.sdf.org on 29 Feb 2024 02:14 next collapse

They’re definitely not seen as an authority in this field. Why would anyone care what recommendation they make?

It’s possible that they are acting on the advice of advisors who are authorities in this field.

And so why make one at all?

I expect it’s because information and industrial security are components of national security, which is of great concern to them, and those things depend on software.

I’m not surprised to see this, given that state-sponsored electronic attacks are on the rise these days.

EatATaco@lemm.ee on 29 Feb 2024 19:20 collapse

This is exactly why people sound sophomoric when they say “lobbying needs to go!” There are some drastic problems with lobbying as it is allowed now, but the last thing we need is the government regulating things they know nothing about without the input of experts. On top of that, it’s nonsense that I can’t pass my local councilman on the street and stop and push them to spend more time addressing important issues like climate change.

mox@lemmy.sdf.org on 29 Feb 2024 19:43 next collapse

It’s important to remember that the argument against lobbying isn’t about the broadest sense of the word “lobbying”, but rather about corporations and other moneyed interests having unfair and unhealthy influence over the laws that govern everyone else.

The people who decry lobbying probably agree with you; they’re just using the word in an implicitly narrow context.

EatATaco@lemm.ee on 29 Feb 2024 20:55 collapse

they’re just using the word in an implicitly narrow context.

I think we mostly agree, but disagree on this point. I think it’s just that most people haven’t given it any thought. Like they are just ignorantly going along with the popular opinion.

mox@lemmy.sdf.org on 29 Feb 2024 21:14 collapse

I suppose mob mentality is likely to play some part in every widely shared view.

At the very least, I can guarantee that one of said people has given it thought. :)

porous_grey_matter@lemmy.ml on 01 Mar 2024 10:03 collapse

I don’t think your argument quite holds up. The directionality is important. It’s true that the government can’t always know about technical things directly, but I think it’s fine for the government to be expected to know which experts they need to consult, and for that process not to just be open to everyone (which just means more open to those with more money).

EatATaco@lemm.ee on 01 Mar 2024 14:05 collapse

it’s fine for the government to be expected to know which experts they need to consult

What happens if they don’t even know it’s a problem? Or they don’t realize the severity of the problem so it gets a lower priority?

And it also sounds like you’re arguing that I can’t talk to my local representative about what I think are the important issues that need to be addressed. If they have to seek me out, I would have zero input.

phoneymouse@lemmy.world on 29 Feb 2024 06:24 next collapse

It’s a national security threat

parens@programming.dev on 29 Feb 2024 15:04 collapse

C/C++ is a threat to mental stability

someacnt_@lemmy.world on 29 Feb 2024 10:18 next collapse

There have been words around this, like how software should be safe by design, but the regulation should come from the governing entity. This is simply materialized now, but there has been momentum.

phillaholic@lemm.ee on 29 Feb 2024 17:58 next collapse

NIST are the experts guiding the White House.

Sweetpeaches69@lemmy.world on 01 Mar 2024 15:25 collapse

NIST is mentioned

confused and angry screaming

Mango@lemmy.world on 29 Feb 2024 20:39 collapse

They can’t even figure out language for human interpretation much less computer interpretation.

_NetNomad@kbin.run on 29 Feb 2024 03:42 next collapse

segmentation fault (c and c++ dumped)

ricdeh@lemmy.world on 01 Mar 2024 15:56 collapse

Just write memory safe code lol

makozuma@lemmy.world on 29 Feb 2024 04:55 next collapse

Can’t we just bring back Forth and call it a day?

rottingleaf@lemmy.zip on 29 Feb 2024 05:05 next collapse

I agree, let’s start with dumping Windows.

foobaz@lemmy.world on 29 Feb 2024 15:09 collapse

Done, next the Linux kernel? 😱

rottingleaf@lemmy.zip on 29 Feb 2024 16:30 collapse

It’s a hard sacrifice to make, but if that means killing Windows, then mwahahaha… I mean, MS’s power lies in supporting all that legacy.

Aopen@discuss.tchncs.de on 29 Feb 2024 14:54 next collapse

whitehouse.gov/…/Final-ONCD-Technical-Report.pdf

parens@programming.dev on 29 Feb 2024 15:06 next collapse

C/C++: so bad that even the white house takes notice 😂

mox@lemmy.sdf.org on 29 Feb 2024 21:35 collapse

C isn’t bad. It has been a good portable assembly language for ages, and remains so today. What’s problematic is continuing to use it where more advanced languages now make more sense.

I won’t defend C++, though. I’m happy to kick it to the curb now that better alternatives are gaining traction.

Rednax@lemmy.world on 01 Mar 2024 18:11 collapse

The problem with C++ is not the lack of safety features. It’s the ever lasting backwards compatibility that is keeping it both alive and down at the same time.

Having to support 50 year old code, is going to limit any restriction you place. But it is usually the restrictions that make a language good.

Example: You can write perfectly good modern C++ code without any pointers. But pointers are so ingrained into the language, that it is impossible to remove them.

badbytes@lemmy.world on 29 Feb 2024 22:02 next collapse

Good reason to not drop C and C++

Dzeimis@lemmy.world on 01 Mar 2024 04:56 next collapse

Wtf, I thought this was a meme…

frankenswine@lemmy.world on 01 Mar 2024 14:36 next collapse

sad stroustroup noises

ricdeh@lemmy.world on 01 Mar 2024 15:53 next collapse

C is not the problem, it’s sloppy “programmers” who cannot handle direct memory control and who do not understand the underlying system architecture and how a microprocessor operates. People who are good at writing C can make code just as safe as the safest Rust code.

daddy32@lemmy.world on 01 Mar 2024 15:58 next collapse

It is just too easy to shoot yourself in the foot when using a foot gun… Sure the experts can avoid it, but that doesn’t mean the foot gun is a good tool in general.

CatLikeLemming@lemmy.blahaj.zone on 01 Mar 2024 16:01 next collapse

If you’re an expert tightrope walker, you’re likely not gonna fall off. You can just do it without too much issue. When you’re doing it over a chasm, and you don’t plan on dying, you’d still probably prefer a harness though, wouldn’t you?

Edit: I’m not saying C is a bad language or anything, but for important applications the safety of actually memory safe languages is vital for lower-skilled programmers and still a good assistance for higher-skilled programmers, as we’re all humans and it doesn’t hurt to try and avoid the mistakes we will eventually make.

lolcatnip@reddthat.com on 01 Mar 2024 18:25 collapse

I’ll say it. C is a bad language. There was a time when it needed needed to exist and using it was a smart choice, but it has outlived its usefulness for anything but legacy code and niche use cases like FFI. It’s in essentially the same category as Cobol.

mariusafa@lemmy.sdf.org on 01 Mar 2024 18:46 collapse

The bad language that all successor languages copied?

Edit: spell.

Crozekiel@lemmy.zip on 01 Mar 2024 19:02 next collapse

Did you mean predecessor, like the languages that came before it?

mariusafa@lemmy.sdf.org on 01 Mar 2024 20:02 collapse

Fuck I meant successor

lolcatnip@reddthat.com on 01 Mar 2024 21:42 collapse

It wasn’t bad at the time relative to what else was around.

And I don’t even know what you’re getting at by saying “all” successor languages copied it. Are you referring to how many languages use curly braces as block delimiters? Because that’s not what’s wrong with C.

dejected_warp_core@lemmy.world on 01 Mar 2024 17:00 next collapse

While this is technically correct, it’s tantamount to saying “just don’t make mistakes”, or arguing that a seatbelt is unnecessary because many are good enough drivers to not need it.

Languages like C and C++ do not prohibit the kinds of mistakes that the NSA told us two years ago lead to software vulnerabilities.

Other languages, like Rust, have higher guardrails built in and make it much more difficult to accidentally create the same failure modes.

wolf@lemmy.zip on 01 Mar 2024 17:24 next collapse

I love C, but C definitely is the problem.

While one disciplined programmer can in theory write correct code, once there is a small group of even good C programmers and a code base with more than around 3000-5000 LOC, there will be bugs. There is a good reason for tools like Valgrind etc.

While I think C and C++ are the problem, I don’t think Rust is the solution, tho.

lolcatnip@reddthat.com on 01 Mar 2024 18:22 collapse

Your take is objectively false. This issue has been studied and the conclusion every time is that real programmers make memory-related mistakes all the time. Even if there are a few superhuman programmers who never get tired, have a bad day, or misunderstand an API, firing the 99.99% of programmers who aren’t superheroes isn’t a realistic solution to anything.

TypicalHog@lemm.ee on 01 Mar 2024 18:31 collapse

I’m like absolutely convinced Rust is the shit!