Live data from Hacker News

Let’s sunset C/C++

trevorjim.com

31–40 of 137 posts

Re: Let’s sunset C/C++

#32
As of yet, a browser (in particular the JavaScript JIT) cannot be implemented in a safe language.

It is not even clear how a safe language that would permit this would look like.

Thinking that banning C/C++ magically solves all problems is naive.

Re: Let’s sunset C/C++

#34
post #23

So what language to you propose we use to rewrite all video and audio software? Javascript, Lua, Brainfuck, what? Sure make every numeric value a double, nobody ever wants a char. Don't allow contiguous blocks of memory. Or if you do check every access is within the bounds. Its all safe! Nobody cares that suddenly we can't decode an MP3 in realtime. Are you going to outlaw assembly too? What utter insanity.

I suppose the answer would be Rust or similar because they aim to be as fast as C/++; however, that is currently only a goal and most certainly not the reality (according to some source I read a month or two back that I can no longer find). I also hope to end C/++, but it's simply not time yet.

Please show me how to implement a graph library without using unsafe in Rust.

Re: Let’s sunset C/C++

#36

So what language to you propose we use to rewrite all video and audio software? Javascript, Lua, Brainfuck, what? Sure make every numeric value a double, nobody ever wants a char. Don't allow contiguous blocks of memory. Or if you do check every access is within the bounds. Its all safe! Nobody cares that suddenly we can't decode an MP3 in realtime. Are you going to outlaw assembly too? What utter insanity.

Never panic early. Look e.g. at Rust - just as efficient, much more secure.

Re: Let’s sunset C/C++

#37

So what language to you propose we use to rewrite all video and audio software? Javascript, Lua, Brainfuck, what? Sure make every numeric value a double, nobody ever wants a char. Don't allow contiguous blocks of memory. Or if you do check every access is within the bounds. Its all safe! Nobody cares that suddenly we can't decode an MP3 in realtime. Are you going to outlaw assembly too? What utter insanity.

I say every language except Logo should be banned. Programmers can't be trusted with memory and all these weird things!

Also processors should directly interpret Logo. And operating systems too. And memory access isn't allowed. Memory is dangerous.

Re: Let’s sunset C/C++

#38

Excuse my french, but: What a load of bullshit. It's not the language, it's the tools. Add a static analyzer pass to each C/C++ compiler which is switched on by default. Add clang-address-sanitizer-style code when compiling in debug mode, and also offer runtime checks as option for release-compiled code. Both combined would have caught 99% of memory safety issues that pop up now and then. If necessary extend the lang…

If by "tools" you mean "user" then, yes, you are correct. This author is a tool.

In French, your first line would be, "Oh, hell no!"

Re: Let’s sunset C/C++

#39
I'm confused when the author says the DOM is garbage collected only in IE/Blink. How is DOM memory managed elsewhere? At first guess, I thought the JavaScript runtime (which surely always uses garbage collection) would manage the DOM, but I'm guessing that's not actually the case. Who is typically in charge of memory management at that layer?

Re: Let’s sunset C/C++

#40
C++ is safe enough, provided you use the tools like Intel Inspector, valgrind, and static analyzers. With C++11 memory corruptions became a somewhat rare occurence.
Post reply on HN