Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Simon Brooke
Simon Brooke
@simon_brooke@mastodon.scot  ·  activity timestamp 6 days ago

I have a really big software project which is stalled because I'm hitting bugs I can't resolve trying to write it in C. So I've been thinking for some years about using a different implementation language, and was leaning towards #Rust. Recently, I've started looking seriously at #Zig.

Comparisons between Rust, #Go and Zig:

https://sinclairtarget.com/blog/2025/08/thoughts-on-go-vs.-rust-vs.-zig/
https://dev.to/dev_tips/zig-rust-go-i-tried-3-low-level-languages-and-heres-what-im-sticking-with-4gpp
https://betterstack.com/community/guides/scaling-go/rust-vs-go-vs-zig/
https://ziglang.org/learn/why_zig_rust_d_cpp/

/Continued

Why Zig When There is Already C++, D, and Rust?
⚡
Zig Programming Language

Rust vs Go vs Zig for Systems Programming | Better Stack Community

Compare Rust, Go, and Zig for systems programming. Learn their memory management approaches, performance characteristics, and when to choose each language for your next project.
DEV Community

Zig, Rust, Go?! I tried 3 low-level languages and here’s what I’m sticking with

Opinionated, nerdy, perfect for system devs and hacker crowds. Viral potential: high. Press enter or...

Thoughts on Go vs. Rust vs. Zig

Sinclair Target's personal website.
  • Copy link
  • Flag this post
  • Block
laund
laund
@laund@wetdry.world replied  ·  activity timestamp 6 days ago

@simon_brooke most of the time i read posts like these and end up disappointed by obvious bias, a lack of depth, or a misunderstanding of some parts of a language or another.

This is true for articles 2. 3. and 4. in your list, but i found 1. to be a surprisingly good comparison. Its higher level, not falling into the trap of comparing individual features which are often different enough they probably shouldn't be compared. Thank you for sharing it.

  • Copy link
  • Flag this comment
  • Block
laund
laund
@laund@wetdry.world replied  ·  activity timestamp 6 days ago

@simon_brooke as for my own thoughts: I think Zig is interesting, especially for those coming from C, and it might even be the correct choice depending on your project. However, i still highly recommend spending some time learning Rust, if its at all interesting to you and you can manage finding the time and energy for it. Even if you don't end up using it (much), a common statement to hear from people who have learnt Rust and for whatever reason use a different language is "Learning it made me a better programmer in other languages" - its compiler and common patterns teaches a certain way of thinking about code and what to pay attention to thats surprisingly valuable.

Its also the kind of thing where its inherent structure, constraints, and patterns can really click with some people, especially those who excell at recognizing abstract patterns and transferring them to related areas.

  • Copy link
  • Flag this comment
  • Block
Simon Brooke
Simon Brooke
@simon_brooke@mastodon.scot replied  ·  activity timestamp 6 days ago

@laund I think Rust is the wrong choice for the post-scarcity software environment *because* a lot of what I need to do explicitly in PSSE is to manage memory, to assign processes to processors, and to copy data structures to the processors that need them. I need to be able to do all that explicitly, and Rust wants to do it implicitly. I fear that Rust's memory management and my memory management would end up fighting with each other.

Zig's 'do it yourself' attitude feels like a better fit.

  • Copy link
  • Flag this comment
  • Block
Pete Alex Harris🦡🕸️🌲/∞🪐∫
Pete Alex Harris🦡🕸️🌲/∞🪐∫
@petealexharris@mastodon.scot replied  ·  activity timestamp 6 days ago

@simon_brooke @laund

Hm. I think Rust requires/allows you to be explicit about memory management and the higher-level abstractions like lifetimes, Sync/Send, are to prevent you from carelessly doing a lot of it wrong. But they are only abstractions to provide guarantees for the compiler. How you implement them at the base level (inside an unsafe { } if necessary) is up to you.

  • Copy link
  • Flag this comment
  • Block
laund
laund
@laund@wetdry.world replied  ·  activity timestamp 6 days ago

@petealexharris @simon_brooke Its one of the lesser-discussed parts of Rust: How its possible to build things like kernels, operating systems, and drivers in it.

Rust has a standard library thats mainly built on individual RAII allocations, but you're not locked to that when you want/need to do something else. The idea is to build relatively simple abstractions for the kinds of operations and patterns you want, or which wrap foreign functions and interfaces. In these, you define whats needed to interact with them safely, and then the compiler will hold you to that across an entire complex codebase.

  • Copy link
  • Flag this comment
  • Block
Simon Brooke
Simon Brooke
@simon_brooke@mastodon.scot replied  ·  activity timestamp 6 days ago

But! Compiling the `master` branch of Zig requires LLVM 21, which is not available from @Debian for #Debian13trixie, and the #apt repository at https://apt.llvm.org, which does have the package, has a dodgy signature, so the package won't install.

So either I have to move to an unstable operating system release, which I could do but doesn't thrill me, or I have to compile LLVM 21 from scratch, which seems like a major side project.

Here be dragons.

  • Copy link
  • Flag this comment
  • Block
Hagarashi8
Hagarashi8
@hagarashi8@social.linux.pizza replied  ·  activity timestamp 6 days ago

@simon_brooke Or you can just use binary builds of master on their website.

  • Copy link
  • Flag this comment
  • Block
Simon Brooke
Simon Brooke
@simon_brooke@mastodon.scot replied  ·  activity timestamp 6 days ago

@hagarashi8 Thanks, done that, and making *some* progress.

  • Copy link
  • Flag this comment
  • Block
Simon Brooke
Simon Brooke
@simon_brooke@mastodon.scot replied  ·  activity timestamp 6 days ago

@hagarashi8 thanks, I'll investigate.

  • Copy link
  • Flag this comment
  • Block

BT Free Social

BT Free is a non-profit organization founded by @ozoned@btfree.social . It's goal is for digital privacy rights, advocacy and consulting. This goal will be attained by hosting open platforms to allow others to seamlessly join the Fediverse on moderated instances or by helping others join the Fediverse.

BT Free Social: About · Code of conduct · Privacy ·
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Code of Conduct