Hacker News new | ask | show | jobs
by meinfuhrer 1864 days ago
This has been my experience. I love the fact that the standard library itself is written in Go, so it's easy to see what exactly is going on and even learn some idioms that way. It's refreshing for me personally as I had a JavaScript background before learning Go
1 comments

Aren't most languages these days self-hosted? Which don't have a stdlib written in the language itself?
Is the primary Python implementation self hosting? Ruby? JavaScript? PHP? Perl? It's common for compiled languages to be self hosted, but less common for scripting languages. (Not that Go is a scripting language, just pointing out that many popular languages aren't self hosting.)

Even beyond the question of self hosting, I would say that it's rare for much of a scripting language's standard library to be written in that language... especially performance critical parts of the standard library. There would just be too much performance left on the table.

The person you're responding to specifically mentioned they came from JavaScript, where the standard library implementations weren't written in JavaScript.

(PyPy is a notable exception to this rule of thumb... perhaps as part of its desire to prove how good the JIT is, it seems to be mostly written in Python, which is neat.)

Yet decades old dynamically typed language like scheme and lisp are all self-hosted, even their own compilers. I can bet you that quite a few scheme implementations will beat python in performance.
Though that might be easier, given that for example Scheme is doing much less dynamic dispatch at runtime.
Fair point, I supposed I was thinking of compiled languages like Go.
Various parts of Python's standard library are implemented in C for performance. E.g. see https://lwn.net/Articles/725114/ under "Optimizations"