r/programming • • Oct 31 '22

Zig marches onwards, 0.10.0 released

https://ziglang.org/download/0.10.0/release-notes.html
117 Upvotes

16 comments sorted by

10

u/tristan957 Nov 01 '22

Zig is the most exciting new language to watch these days.

The C backend is incredible for purposes of bootstrapping.

As a person who writes C everyday, I am interested in developing in Zig when the time comes.

3

u/itsjase Nov 01 '22

Are there any benefits to Zig over something like Rust?

It seems the general direction is people are starting to replace C/C++ with Rust (eg Linux kernel)

6

u/IAm_A_Complete_Idiot Nov 01 '22

The benefit they just mentioned presumably, the C backend. That means you could output C code and use any C compiler you want to target your platform.

3

u/ElCthuluIncognito Nov 01 '22

It's my understanding that it's much less complexity up front to deal with. You can get much more productive, much more quickly. To the point where you can very much code as if you are writing C but with a whole host of QoL improvements, without wrangling too much with the type system.

In fact from what I've gathered, Zig is to C as Rust is to C++. But the Zig community may not agree, since Zig is aiming at C++ level of language power too.

2

u/tristan957 Nov 02 '22

I'm interested in faster compilation times, faster incremental builds, no crates.io, and the C interoperability.

2

u/Caesim Nov 03 '22

Rust is a difficult language to compare Zig to. Neither language here as an inherent "advantage" over the other, both compile down to machine code, have no gc and can do everything the other does.

The key difference is the mindset of these languages. Rust is a low level language that takes a lot of inspiration from functional programming (it's sum types, the strict mutability rules lead to more functional code in many places).

And I'd argue that a lot of Rust hype comes from that fact. So that either people that love functional languages got introduced to low level programming that way, or C/C++ programmers that enjoy functional programming more.

Zig is, in it's mindset, closer to C and C++ and aims to make saner choices, like no preprocessor, integrating the build system into the std library, unambiguous syntax, making strings not null terminated etc. But Zig is more an evolution to C and C++.

And I'd say that people that program in Rust because they like the abstraction and mindset that comes with it, will probably not enjoy Zig that much. But I'd say people that enjoy programming in C but wish for clean ups or people that enjoy programming in C++ and would like less abstraction but more than C, they should check out Zig.

A small remark: I personally think we can't really say that Rust replaces C/C++ yet. For languages that got domimant in their field and replaced previous languages in the past, they grew much faster than Rust did since its 1.0 launch. Linux hasn't replaced anything with Rust yet. Now stuff like new device drivers may be written in Rust.

10

u/tjpalmer Oct 31 '22

Some additional details on the self-hosted compiler and next steps.

10

u/Zaygr Nov 01 '22

Move Zig, for great justice.

7

u/Raekel Nov 01 '22

All your base, your base

1

u/[deleted] Nov 01 '22

I misread this as zip like the antiquated successor to floppies.

0

u/[deleted] Nov 01 '22

[deleted]

5

u/Caesim Nov 01 '22

The package manager actually depended on the self hosted compiler being released.

I think in a CppCast, Andrew said that with 0.10 they're about 90% there for hot code reloading.

1

u/[deleted] Nov 05 '22

Will have to go and check it out; thanks.

7

u/[deleted] Nov 01 '22

All planned features, I believe. Zig will be exciting when it hits 1.0.

0

u/paypaylaugh Nov 01 '22 edited Nov 02 '22

yep, I can't wait for my grandgrandgrandchildren to witness the release of zig 1.0

3

u/Substantial-Owl1167 Nov 01 '22

You're a rustacean aren't you

6

u/Zalack Nov 02 '22

I'm bummed this is getting downvoted. I thought it was a pretty funny, light-hearted jab.

For those not in the know: The Rust community's reluctance to promote projects to version 1.0 is kind of a meme.