r/Compilers • • 17d ago

Spectre - A design-by-contract programming language with an explicit allocator-centric API that outperforms Zig by up to 6x on General Purpose Benchmarks

https://spectrelang.org/
0 Upvotes

14 comments sorted by

View all comments

Show parent comment

-2

u/Top_Marionberry_4413 17d ago

The JSON stuff isn't really relevant, it's just stdlib vs stdlib, and Zig's stdlib is not very optimized, or mature, despite its 10 years of existence. More relevantly, the sort of u64 values benchmark is literally line-for-line identical, and Spectre outperforms Zig by 5x.

2

u/AustinVelonaut 17d ago

Ok, well that is due to Spectre's use of a specialized radix-sort with 64K count bins when the sorted type is u64. Again, not very general, although it is cute.

0

u/Top_Marionberry_4413 17d ago

So...you're complaining that the implementation is optimized...? Isn't that Zig's fault for not optimizing? It seems you're being a contrarian dickhead for no reason.

3

u/AustinVelonaut 17d ago

No, I'm complaining about your hyped benchmarking methodology, saying something is a general purpose benchmark when it is obviously a hand-picked and hand-tuned special case. Nothing wrong with actually having those algorithms in your stdlib (although I don't think I've seen an actual use of sorting just u64s in actual code other than benchmarking), but you should make mention of it in your benchmark report.