This Week In Zig

Zig Weekly Update: 2023/1

Covering Jan 1 - Jan 7

  • 4c1007fc0 merged #14002 in which @kcbanner made it so the C backend now produces MSVC compatible code and more.
    • std.math.big.int.Mutable also gets a .convertToTwosComplement() method
  • df5fcf543 merged #14159 in which @Vexu fixed spurious "depends on itself" errors that were popping up recently. No more!
  • 9bcd48e40 Andrew reverts a previous commit that called realpath(3) in the compiler and accidentally caused a build regression in a few BSDs.
  • 8bd734d60 merged #13699 in which @mikdusan makes huge strides in improving the Tier status of many BSDs. See linked issue for more.
  • c9ef277fa merged #13980 by Andrew which introduced an MVP HTTP and TLS client into the standard library 🎊
    • Adds std.crypto.Certificate
    • Adds std.crypto.tls
    • Adds std.http
    • Removes std.x
    • Adds std.Url
    • std.crypto.sha types get .peek() and .finalResult() methods
  • 5bd69c655 zig.h: support GCC compilers that lack __has_builtin
  • 8094fa5d4 merged #14027 in which @mlugg adds std.meta.FieldType.
  • 1de96a2cc merged #14108 by @chrboesch
    • Adds .getLast() and .getLastOrNull() methods to std.ArrayList
  • 93bdd04e8 merged #13316 by @leecannon
    • Adds .logEnabled() and .defaultLogEnabled() inspection functions to std.log
  • a44085dc2 merged #13826 by @gwenzek
    • Adds -fopt-bisect-limit flag to help with debugging LLVM optimization errors
  • 1ec74f1b7 merged #14106 by @jordanlewis
    • Implements std.math.absInt() for integer-backed Vectors
  • 793513576 merged #14157 by @Luukdegram
    • Bunches of WASM related fixes and linker improvements, see linked PR for details.
  • daeb992c7 merged #14166 by @McSinyx
    • Fixes the keyboard shortcut helper in Autodoc to be the write key
  • abd005f30 merged #13017 by @Vexu
    • Fixes the Zig compiler bug: attempted to destroy declaration with an attached error compiler crash. The commit will tell you only 3 bugs were closed as a result of this PR this was an awesome fix by Vexu. This was definitely one of the easier crashes to run into as evidenced by the amount of follow up issues from various folks that were marked as duplicates of those 3 issues. Great work!
  • 8032ecb73 merged #14153 by @mikdusan
    • This passes a flag to the compiler when building stage3 on darwin platforms and fixes building Zig on homebrew
  • 09122650b merged #14179 by @joachimschmidt557
    • This fixes the code generation of small stack items when using the aarch64 native backend
  • 8d64e5283 merged #12586 by @MasterQ32
    • Adds std.heap.MemoryPool
  • fd0fb26ab merged #12590 by @MasterQ32
    • Adds std.heap.ArenaAllocator.reset() which frees all owned allocations but maintains capacity for fast re-alloc. Great for when using an arena in a loop, rather than making a new arena per loop iteration.
  • 2b9478ce1 merged #13853 where @vesim987 implements AVR address spaces
  • 83fd45d82 merged #13786 where @andrewrk stage2: make --color on affect progress bar too
  • 9ed4a93ae merged #14189 where @kcbanner fixes a compile error in the C backend
  • a3e2ee091 merged #14162 where @kcbanner fixes another LockViolation case on Windows
  • 09ff03a57 merged #12740 where @kcbanner fixes std.debug.walkStackWindows
  • ed2361563 merged #14160 where @mikdusan adds behavior test coverage for an old stage1 bug
  • b89158d6f merged #14180 where @Aransentin optimizes std.start to not initialize ThreadLocalStorage on --single-threaded builds
  • e0fb4c29c merged #14201 where @mikdusan fixes f16,f32,f64 NaN @bitCasts in the LLVM backend
  • fe2bd9dda merged #14182 where @BratishkaErik fixes cmake error reporting by adding a workaround for an open bug on upstream
  • f83834993 merged #14181 by @Vexu
    • Adds std.options namespace
    • Moves many root options to root.std_options decl
      • enable_segfault_handler
      • wasiCwd
      • io_mode
      • event_loop
      • event_loop_mode
      • log_level
      • log_scope_levels
      • logFn
      • cryptoRandomSeed
      • crypto_always_getrandom
  • 2d617c482 merged #14076 where @pluick fixed a regression when using --cache-dir
  • c6ea551c7 by @kristoff-it autodoc: fix links to functions in generic types
  • 1878bdfbb by @kristoff-it autodoc: fix bodyless fn type analysis and rendering
  • 176940b50 merged #14214 by @mikdusan zig.h: do not assume __GNUC__ is not clang
  • 301a89849 merged #14215 by @matu3ba build all tools in CI to prevent bitrot
  • c28c38d1e merged #13514 by @kcbanner
    • From-scratch bootstrap of Zig stage3 now works when using MSVC on Windows
  • 6ad92108e merged #14217 by @jedisct1 so now Zig-produced static executables are now able to run properly under the jart/blink x86 emulator
  • b3e495a38 merged #14202 by @andrewrk
    • Adds std.http.Version
    • std.http.Status.class() no longer returns an optional and adheres to the RFC better
    • std.http.Client got a major rework and should work much better
    • std.simd.iota() now calculates answer at comptime
  • a01d2ab0e merged #14210 by @Vexu
    • improve struct/union field error locations
    • only untyped undefined coerces to all types
    • generic function instantiation inherits parent branch quota
    • handle instantiating an enum with a backing integer thats in a variable
  • db7b36f3f merged #14220 by @mikdusan zig.h: do not assume __GNUC__ is not clang #2
  • 7a2d7ff62 merged #14224 by @andrewrk
    • Adds std.http.TransferEncoding
    • std.http.Client now supports transfer-encoding: chunked requests
  • 24b4e643f merged #14134 by @brendandburns which implement some more environment variable functions when targetting WASI
  • 0507ced8c merged #14225 by @mikdusan stage3 bsd: support dynamic libstdc++/libc++
  • 87b223428 merged #14207 by @MasterQ32
    • replaces std.Url with std.Uri
    • implementation is now RFC 3986 compliant

Congrats to all the contributors and thanks for reading! See you next week 👋