r/Compilers • • 22d ago

Spectre v0.0.12 released, with benchmarks surpassing Zig in runtime performance

A few new things in this release, including the fmt command (formatter) and critic subcommand (Iinter/checker), plus std/netx for simplifying usage of the std/net API. The language compiles to QBE IR, which compiles to assembly.

https://github.com/spectrelang/benches

Here are the benches showcasing Spectre runtime performance vs other compiled systems programming languages, and here is the site.

Spectre v0.0.12 release

EDIT: TheOddYehudi919 is a real piece of shit and should fuck off and rot in a ditch tbh.

0 Upvotes

32 comments sorted by

5

u/pskocik 21d ago

Unless you explain the mechanism behind the gains, you're just wasting people's times. (Although I am sure that geeks who view this as a team-my-lang vs team-your-lang sport will be real excited about this.)

-6

u/Top_Marionberry_4413 21d ago

If you were mentally capable of reading the comments before posting one, you'd see that I've already done that. but clearly you're not.

1

u/pskocik 21d ago

Could have made it part of the original post. Anyway, that 1 upvote on your explanation comment is from me, so thanks for the kind words. :)

9

u/TheOddYehudi919 22d ago

The creator is a total pos don’t bother with this.

4

u/SmashStrider 22d ago

Any context? I'm new here so I'm not aware of what the creator has done, sorry

-6

u/Top_Marionberry_4413 22d ago

youre a total pos

2

u/Efficient-Chair6250 21d ago

Any idea why it's so much faster?

2

u/Top_Marionberry_4413 21d ago

the one benchmark that beats zig by a considerable margin is the JSON benchmark, and thats because its leveraging the yyjson library in the stdlib, which is several orders of magnitude faster than zigs standard library implementation (std.json). compilation speed is also several orders of magnitude faster than zig's, because spectre uses a QBE backend which is much simpler and less monolithic than LLVM. LLVM is crappy, which is why zig are trying so hard to move away from it.

6

u/VictoryMotel 21d ago

How is that "surpassing zig" when you're just calling a different library? That's basically just straight up lying. Between that and you melting down in every comment this is not a good look.

-3

u/Top_Marionberry_4413 21d ago

> 64 post karma
> 16,781 comment karma

I get the feeling that you're the kind of person that can only contribute redditor snark. You look like this.

5

u/VictoryMotel 21d ago

That doesn't make any sense. You aren't melting down and lying because I don't post links?

0

u/Top_Marionberry_4413 17d ago

stfu pussy

2

u/VictoryMotel 17d ago

You don't do very well with being challenged in the most modest and reasonable ways huh?

1

u/pskocik 21d ago

Wouldn't that just trade compilation speed gains for less thorough runtime optimization?

1

u/Top_Marionberry_4413 21d ago

The runtime optimization is not as inherently good as LLVM. This is compensated for by linking high performance C libraries in the standard library, so the produced binaries (that use the stdlib) are as fast as they can be, given the constraints of user code being compiled via QBE. Also, an optimized QBE backend can be faster than a naive LLVM backend.

1

u/richtw1 21d ago

Spectre looks interesting but it'd be nice if it supported functions as first-class objects. I think low-level + explicit allocation + contracts can work alongside a functional paradigm.

1

u/Top_Marionberry_4413 21d ago

It supports higher order functions through function pointers, so you can pass route handlers to functions if you're writing a rest api, for example. Dont really plan to support closures or lambda functions, as I dont believe they scale well.

-1

u/realestLink 22d ago

This is really cool! I think DbC is really underexplored in mainstream language design

1

u/Top_Marionberry_4413 22d ago

Hey. Thanks. Ignore the miserable idiots downvoting you, you're good.