by lagniappe · 10mo ago · 0 comments
Is it perfect for everything? no. Is it the fastest compiled language out there? no. But, it'll do most things very well, and for me that's good enough. I choose go because when I need to make something, it steps aside and lets me build, and for that I have great respect and appreciation for it.
I will be defering all detractors and negative comments ;)
Coming from Java, I find the standard lib very small. A case in point is the collections library: arrays/slices, map, list, ring, and heap -- that's about as minimal as you can get.
what does this mean? Go lib seems tiny compared to JDK. anytime i review some Go code from adjacent team i'm turned off by weird stuff like append and slices everywhere, as well as a bunch of strange string packages
When I think of a massive stdlib I think of a language like groovy
- JSON: Yup, stdlib is good here
- HTTP client: There is urllib.request, although people maybe reach for requests more.
- HTTP server: No, it's just some super basic thing (it's not even 'nice' to write for local dev). Would never let anything here near production.
- Unit testing: Yes, I think unittest is pretty good (I actually like it a lot, and think pytest is overrated).
- Crypto functions: No, not equivalent. There is hashlib but basically anything else you're pointed at pycrypto or cryptography with all the associated ecosystem nonsense (oh I need a Rust compiler now? Great...).
The difference is Python _has_ all of these things in the standard library, but the quality is super mixed, and not all of them are suitable for real use.
- context
- net/http as a full server framework, not just a request library
- net/http/pprof
- runtime/pprof
- runtime/trace
- embed
- testing as the canonical, required test framework
- net/rpc
- net/http/cgi
- net/http/fcgi
- net/http/httptest
- os/signal with integrated channel-based delivery
- sync/atomic with language-aligned memory model semantics
- runtime as a documented and supported API surface
It seems to be very relative depending on where you come from.