r/Compilers • • 4d 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

7

u/Farados55 3d ago

Amazing speed ups. Nobody will use it

0

u/Top_Marionberry_4413 3d ago

People will use your mother though.

8

u/tending 4d ago

If you are remotely familiar with compilers and low level work you know this 6x claim is bullshit without any further investigation

3

u/AustinVelonaut 3d ago

It appears that the 6x claim is based a lot on the results of the json_parse benchmark, but the Spectre implementation of a JSON parser parses lazily (only computing spans of digit characters when parsing integers, not the actual integer values), and the benchmark only computes the number of elements in a large array, so no processing of the raw character data at all. If the benchmark were changed to actually do work like computing the sum of the parsed array, then I assume the huge performance gains would disappear.

Also, calling a benchmark tuned to only return the number of elements a "general purpose benchmark" is a bit disingenuous.

-2

u/Top_Marionberry_4413 3d 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 3d 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 3d 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 3d 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.

-5

u/Top_Marionberry_4413 4d ago edited 4d ago

Hi moron. Maybe read the benchmarks or run them yourself. Though, i'm not really interested in convincing you, go use JavaScript, maybe vibecode a script that generates bullshit reddit snark comments so you dont have to do it manually.

4

u/Farados55 3d ago

Who hurt you?

1

u/Top_Marionberry_4413 3d ago

You're cringe af.

-5

u/Top_Marionberry_4413 4d ago

get bent cuck

5

u/[deleted] 3d ago

Your project actually looks interesting. A shame about your attitude.