Zig gets improved float parser/formatter

182 points46 comments9 hours ago
mitchellh

Based on Russ Cox's work. I take every opportunity I get to implore people who care about computer science and/or software engineering to read everything Russ Cox writes anywhere and everywhere, but starting on his blog is good: https://research.swtch.com/

show comments
mi_lk

Call software development dead however you want. It just peaces my mind knowing there’re still people hand-crafting serious software engineering

show comments
karlmcguire

Russ Cox inspired me 10+ years ago to get into programming (and Go). I'm glad he's still making breakthroughs. If you haven't already, check out his tour of the Acme editor:

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

paaloeye
OneManHorde

Crazy-better in particular for 128-bit floats! Nice.

The commentary on the change is nice as well; some good improvements being deferred to a later moment, as they introduce API changes, etc.

zokier

> I've also compared to a zig implementation of zmij which is generally considered the fastest formatting implementation and found it to be generally about the same speed.

This seems somewhat unexpected. Most benchmarks I've seen put zmij significantly faster than uscale, so does this imply that the zig port of zmij is sufficiently slower to put them on more equal footing? Or did the author find additional speedups for uscale?

I do fully agree with the author on speed not being everything and adaptability etc can definitely be valid reasons to prefer this.

cromka

Honest question: given the popularity of Rust with AI projects and how things have turned upside down in general, isn’t Zig doomed at this point?

show comments