4 ms·
Yeah I can understand why. Though I still prefer C in some ways simply because of its minimalism in the language, while still allowing for the kinds of things y
by olodus 6y ago
Yeah I can understand why. Though I still prefer C in some ways simply because of its minimalism in the language, while still allowing for the kinds of things you want to be able to do if you wanna push your code to the limits. It is a bit scary sometimes writing in C though and sometimes I get a bit annoyed at how some things work or not work in it. I personally am hoping Zig can soon fill this minimalism trait in langs for me. C will probably always be the standard though and I do think more programmers should learn C better to become better programmers.
Rust is a good lang though. I am glad something else is pushing up there for the top spots. And more competition in performance is a good thing.
You don't always have to pick your sides. I just want to be able to write good code and be happy writing it :)
- dnautics 6y agoYou'll be happy to know I implemented the n-body benchmarks game in zig 0.6.0 and it absolutely thrashed the rust version. Submitted it, but they don't take PLs not on the board currently.
- adamnemecek 6y agoBut how much? Do you have an idea why?
- dnautics 6y agoHonestly I have no idea. You can try it yourself, or put it through godbolt: https://gist.github.com/ityonemo/f34e0d3b4891f481863980a31426f1ca https://gist.github.com/ityonemo/f34e0d3b4891f481863980a3142... Note it could also be platform dependent. I'll give it a whirl on my own (new) machine.
- huhnmonster 6y agoDo you think that it may be caused by use of comptime? I have not looked at the benchmark implementations, but that kind of struck me as a reason
- dnautics 6y agoWell, I ran it again and now it's 10% slower than rust (the best rust impls have gotten better since I last tried); I think there's a simd optimization I'm missing, I'm not doing simd operations in the "pairs" phase