3 ms·
> Can you share a Go program that uses the Go stdlib functions and cannot be trivially ported to use the Zig stdlib functions Heres an easy one: https://go.de
by svnpenn 5y ago
> Can you share a Go program that uses the Go stdlib functions and cannot be trivially ported to use the Zig stdlib functions
Heres an easy one:
https://go.dev/play/p/JFIvQYTF3R8 https://go.dev/play/p/JFIvQYTF3R8
- anonymoushn 5y agoAlright, I guess your objection is 100% about the function that accepts a 32-bit integer and encodes it as UTF-8 then.
- anonymoushn 5y agoPlease let me know the ways this does not do the right thing. Thanks. https://www.godbolt.org/z/Y3z8rhzrq https://www.godbolt.org/z/Y3z8rhzrq
- svnpenn 5y agoIm not sure how a 50 line program is better than a 5 line program, but OK. Also it seems you had to write functions to get the same result. My original comment, was that Andrew has a habit of shitting on other languages without proper references or examples. Nothing you can really say is going to change Andrews behavior, so maybe you should stop, unless you can justify Andrews comments.
- anonymoushn 5y agoYour original program which is claimed not-possible-to-port is 14 LOC. This comparable program is 18 LOC: https://www.godbolt.org/z/xf4Tdr1Ps https://www.godbolt.org/z/xf4Tdr1Ps Most of the difference comes from the demand that we represent unicode codepoints as integers at some point in the program, which is a nonsensical thing to do, because unicode codepoints don't correspond to anything useful in the actual text being represented. You seem to have a habit of making false claims about the standard libraries of languages you dislike, and when pressed on the matter ask other people to do your homework. I certainly should stop doing other people's homework.
- svnpenn 5y agoYou seem to have a habit of getting off topic. This thread was never about Zig, it was about Andrew shitting on other languages without justification. I think you can agree that for the basic example I gave, the Go language is easier, more streamline, more comfortable to work with. It allows to get the task done quickly. So for Andrew to shit on Go string handling with not a single example is rude, and frankly just wrong as I have demonstrated.