News for hackers. Stuff that matters.
Re:C Is Not a Low-Level Language by hutzlibu on Tuesday May 01, 2018 @02:41PM (#16970039)
"New projects do use Java or C# rather than C/C++ though."

But not for speed reasons. Java is in no way faster than well written C/C++

Re:C Is Not a Low-Level Language by lmm on Thursday May 03, 2018 @09:24AM (#16985748)
X is not faster than well written Y, for all X and Y; that's not a particularly useful comparison though. I've seen a project pick Java over C/C++ because, based on their previous experience, the memory leaks typical of C/C++ codebases were a worse performance problem than any Java overhead.
Re:C Is Not a Low-Level Language by hutzlibu on Thursday May 03, 2018 @07:21PM (#16990890)
Well written Java is sure to be slower than well written C/C++.

Happy? ;)

But yes, the point you make, is valid, it is much harder to write C/C++ well, because of the burden of memory management. So if you lack the time or skilled people, it might make sense to choose Java out of perfomance reasons.

Re:C Is Not a Low-Level Language by pjmlp on Wednesday May 02, 2018 @02:40AM (#16974652)
Java might not be, but C# is another matter.

Specially after the Midori and Singularity projects, and how it affected the design of C# 7.x low level features and UWP AOT compiler (shared with Visual C++).

Also Unity is porting engine code from C++ to C# thanks to their new native code compiler for their C# subset, HPC#.

Re:C Is Not a Low-Level Language by mattnewport on Wednesday May 02, 2018 @03:01AM (#16974751)
The discussion was about JITs vs AoT compiled native code. Unity is not using a JIT runtime for their new Burst compiler but using LLVM to do AoT native compilation and getting rid of garbage collection. If you get rid of JIT and garbage collection then yes, a subset of C# can be competitive in performance with C++ for some uses.
Re:C Is Not a Low-Level Language by pjmlp on Wednesday May 02, 2018 @04:03AM (#16974969)
JIT vs AOT is an implementation detail, nothing to do with a programming language as such, unless we are speaking about dynamic languages, traditionally very hard to AOT.

In fact C# always supported AOT compilation, just that Microsoft never bothered to actually optimize the generated code, as NGEN usage scenario is fast startup with dynamic linking for desktop applications.

While on Midori, Singularity, Windows 8.x Store, and now .NET Native, C# is always AOT compiled to native code, using static linking in some cases.

As for GC, C# always offered a few ways to avoid allocations, it is a matter for developers to actually learn to use the tools at their disposal.

With C# 7.x language features and the new Span related classes, it is even easier to avoid triggering the GC in high performance paths.

Re:C Is Not a Low-Level Language by kartickv on Sunday May 13, 2018 @12:48AM (#17057402)
For someone who doesn't develop for the MS stack but is still curious, what are these ways to avoid allocations and GC in performance-critical paths?