grokking_algorithms icon indicating copy to clipboard operation
grokking_algorithms copied to clipboard

Update examples for Zig

Open kind84 opened this issue 1 year ago • 0 comments
trafficstars

This PR updates the code examples for the Zig programming language.

Those examples where introduced in #242 but, since the Zig language is evolving at fast pace, they needed some adjustments:

  • Replaced var with const for non-mutated variables
  • Better implementation for Dijkstra's algorithm
  • Removed async/await syntax as it is (temporarily) not provided any more by the language. Replaced by threads
  • Updated standard library names and signatures
  • Other small improvements

The code has been tested using zig version 0.14.0-dev.577+3344ed8b8.

kind84 avatar Aug 02 '24 21:08 kind84