Hacker News new | ask | show | jobs
by mhh__ 1567 days ago
D is the closest thing to a "I write generic code which is then optimal for all the situations I can think of" language that I have found so far.

Writing a type that automatically becomes SOA vs. AOS is relatively easy in D, almost impossible in C i.e. please stop writing "fast" code in C.

2 comments

> Writing a type that automatically becomes SOA vs. AOS is relatively easy in D

There's a library (which I haven't tried out) for doing this in C++20: https://github.com/celtera/ahsohtoa

(The author is an HN regular, jcelerier.)

D is nice. I find Nim even nicer (the static introspection is more complete, and syntactic chatter/noise is lower). https://nim-lang.org/

Several people have done the entity component system (ECS) thing.