News for hackers. Stuff that matters.
Re:I love coding in C by twoodfin on Thursday December 26, 2019 @12:31PM (#21885315)
I’m sympathetic to the argument that C isn’t realistically a “high-level assembler” any more, but if there is low-hanging performance fruit available for a language free to dispense with C’s PDP-11-flavored abstractions, I haven’t seen practical examples of it.

If anything, more modern languages (eg Java) have to contort their data representations to build, say, “structs of arrays” that are highly efficient on modern CPUs (and trivial to express in C!)

I’m very curious to hear of any recent languages that are designed expressly with “mechanical sympathy” in mind.

Re:I love coding in C by user234683 on Thursday December 26, 2019 @01:04PM (#21885528)
The ISPC language by Intel is designed to give enough information to the compiler so as to allow auto SIMD-vectorization of programs [1]. It opts for an explicitly parallel model of programming, unlike C [2]. It also has easier support for SOA and AOSOA [3].

[1] https://ispc.github.io/

[2] https://ispc.github.io/ispc.html#the-ispc-parallel-execution...

[3] https://ispc.github.io/ispc.html#structure-of-array-types

Re:I love coding in C by ChrisSD on Thursday December 26, 2019 @12:50PM (#21885440)
The trouble is both processor instructions and compilers have been optimized for C (well C and FORTRAN). So no matter how good or bad C is, we're mostly "stuck" with its PDP-11 computing model unless someone does a lot more work than just making a new programming language.
Re:I love coding in C by nemo1618 on Thursday December 26, 2019 @12:39PM (#21885370)
Regarding your SoA example, Jai has explicit support for switching between SoA and AoS without having to rewrite everything: https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md...
Re:I love coding in C by polityagent on Friday December 27, 2019 @09:53AM (#21891621)
I believe jblow removed this in more recent versions.
Re:I love coding in C by aratakareigen on Thursday December 26, 2019 @12:36PM (#21885349)
How are structs of arrays more natural in C than in Java?