Live data from Hacker News

Zig – SPIR-V Backend Progress

ziglang.org

61–70 of 75 posts

Re: Zig – SPIR-V Backend Progress

#61
post #6

Earlier quoted context omitted.

I think Zig would do better than Go at things like kernels, drivers, game engines, lower level sorts of things. Edited to add the obvious: SPIR-V, for instance. Of course there’s lots of programming that can afford to pay for GC side effects, if there weren’t we wouldn’t have invented GC, but it’s a little less universal, a little less ‘system’. For me, I came to Zig after horrible cross-platform experiences led me t…

>I think Zig would do better than Go at things like kernels, drivers, game engines, lower level sorts of things. Edited to add the obvious: SPIR-V, for instance. But people don't write those in Go, they use Rust for it

My specific reply was to laszlojamf saying “it seems like go, but with manual allocation”.

To your point though, if Rust is getting it done, go for it. A lot of people still write those in C though.

Re: Zig – SPIR-V Backend Progress

#62

I really love everything about zig except the language itself. The governance, the culture, all of it seem really cool, but reading https://ziglang.org/learn/why_zig_rust_d_cpp/ I still don't get _why_ I would use it. To an untrained eye, it seems like go, but with manual allocation. Or an imperative-only rust. Like it has some features of all the languages it competes with, but not the ones that would make me reach…

If you want something better than C you aren't going to reach for Go (GC) or Rust (complexity). Zig looks like a good middle ground.

Indeed, I would have reached for Modula-2 or Object Pascal.

Re: Zig – SPIR-V Backend Progress

#64

I've read some part of this thread, but I didn't see anyone mentioning D as a better C.

ah, downvoter fuckster hners who cant handle anyone who thinks differently from their shitty hive mind ...

Welcome to the club, according to those folks this is impossible.

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

https://worrydream.com/refs/Swinehart_1985_-_The_Structure_o...

Re: Zig – SPIR-V Backend Progress

#65

I've read some part of this thread, but I didn't see anyone mentioning D as a better C.

Because the blog post is not about a "better C", but about Zig's SPIRV backend? As far as I'm aware, D isn't nor is it planning to be a shading language.

Besides, D is usually brought up in every HN thread about a non-D programming language, usually by the author himself and I'm surprised he hasn't shown up yet ;)

Also D being a better C is vastly overblown IMHO, D has become a complicated kitchen-sink language where each concept seems to be implemented in three different ways (at least that was my impression when looking at D's memory management, and the toolchain situation is more than confusing).

Re: Zig – SPIR-V Backend Progress

#66
post #42

LLVM? Ok it is over. Bye.

What's that even supposed to mean? LLVM isn't mentioned once in the post, instead it's about updates to Zig's "inhouse" SPIRV backend, not the LLVM SPIRV backend.

While browsing the articel, I saw a big title with LLVM: insta good bye, no thanks.

Re: Zig – SPIR-V Backend Progress

#67
post #66

Earlier quoted context omitted.

What's that even supposed to mean? LLVM isn't mentioned once in the post, instead it's about updates to Zig's "inhouse" SPIRV backend, not the LLVM SPIRV backend.

While browsing the articel, I saw a big title with LLVM: insta good bye, no thanks.

> While browsing the articel, I saw a big title with LLVM

...that's an entirely different article.

But if it makes you feel any better (and at the risk of trying to talk to a troll because you sure sound like one):

Zig is in the process of getting rid of the integrated LLVM backend - the compiler will still be able to emit LLVM bitcode as an option though which then can be fed into an externally provided LLVM backend (LLVM's optimizer passes are still hard to beat).

Re: Zig – SPIR-V Backend Progress

#68
post #6

Earlier quoted context omitted.

I think Zig would do better than Go at things like kernels, drivers, game engines, lower level sorts of things. Edited to add the obvious: SPIR-V, for instance. Of course there’s lots of programming that can afford to pay for GC side effects, if there weren’t we wouldn’t have invented GC, but it’s a little less universal, a little less ‘system’. For me, I came to Zig after horrible cross-platform experiences led me t…

>I think Zig would do better than Go at things like kernels, drivers, game engines, lower level sorts of things. Edited to add the obvious: SPIR-V, for instance. But people don't write those in Go, they use Rust for it

Yes they do. Only those with anti-GC bias don't.

Which is why TamaGo, TinyGo and gVisor exist.

Re: Zig – SPIR-V Backend Progress

#69
post #7

Earlier quoted context omitted.

I get the usefulness of allocators, I just don't see them as useful enough where I'd pick zig over another established systems programming language. Do you have an example?

a lot of heavy duty systems have multiple allocator systems. the erlang virtual machine has 12: https://www.erlang.org/docs/25/man/erts_alloc.html jvm has at least 5: https://github.com/openjdk/jdk/blob/master/src/hotspot/share... postgres has at least 8: https://github.com/postgres/postgres/blob/master/src/backend... since zig anoints an allocator interface in its stdlib, your (and the stdlib's) data structures whic…

JVM has surely more than 5, because the ecosystem enjoys multiple implementations.

Re: Zig – SPIR-V Backend Progress

#70

Earlier quoted context omitted.

C is over 50 years old, but it is still more or less the lingua franca of computing. The world benefits from having "C with some improvements from 50 years of learning". The world also benefits from having featureful languages that are a huge divergence from C, but it also just needs a language that provides a thin cross-hardware abstraction over the asm layer and some conveniences over writing raw asm. We don't need…

The problem with this is imho that for a C replacement it doesn't offer enough to C programmers to switch. If you're comfortable with C you will stick with C and benefit from it being the lingua franca, and not struggle to find support or talent. This is true both at work or OS. As a very talented C dev told me, I can see the point or go or Rust that would solve some of my issues, Zig while being an improvement doesn…

Example, Zig's solution to use after free is the same kind of debug allocators that have existed for C since the last 40 years.
Post reply on HN