logo
esrever
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
logo
esrever
-
Zig 0.9.0
> it cannot leave the input data as an undecoded bag of bytes
But all it's doing here is taking a hex string (which is entirely ASCII) and converting it into the respective hex representation. Since ASCII translates unambiguously to bytes, it doesn't really matter if `str[0]` is operating on a byte stream, codepoint stream or grapheme stream, because in utf8, they're all the same thing as long as we're within the ASCII range.
Where things get hairy is stuff like `str.reverse()` over arbitrary strings that may or may not be in ASCII. This repo[0] talks about some of the challenges associated with conflating characters with either bytes or codepoints. The problem is that programming languages often approach strings from the wrong angle: you can't just tack on handling of multi-byte codepoints on top of ascii handling; you lose O(1) random access and you don't actually model the linguistic domain properly by doing so, because in the first place, humans think of characters not in terms of bytes or codepoints, but in terms of grapheme clusters. Clustering correctness falls deep in the realm of linguistics, and is therefore arguably more suitable to be handled by a library than a programming language.
[0] https://github.com/mathiasbynens/esrever
-
Awesome javascript one-liners to look like a pro
Here's a take on the first snippet (string reversal) by Mathias Bynens (Staff engineer at Google): https://github.com/mathiasbynens/esrever . If you read that README you'll quickly realize that readability of the code isn't all that high in the list of priorities: making it work correctly in the first place is actually a huge can of worms!
What are some alternatives?
arocc - A C compiler written in Zig.