News for hackers. Stuff that matters.
Re:Half a million lines of Go by fastball on Sunday May 16, 2021 @07:17PM (#27178133)
Aren't most languages these days self-hosted? Which don't have a stdlib written in the language itself?
Re:Half a million lines of Go by coder543 on Sunday May 16, 2021 @08:56PM (#27178875)
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.)

Re:Half a million lines of Go by xfer on Sunday May 16, 2021 @11:04PM (#27179688)
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.
Re:Half a million lines of Go by lispm on Monday May 17, 2021 @03:02AM (#27180745)
Though that might be easier, given that for example Scheme is doing much less dynamic dispatch at runtime.
Re:Half a million lines of Go by fastball on Sunday May 16, 2021 @11:11PM (#27179727)
Fair point, I supposed I was thinking of compiled languages like Go.
Re:Half a million lines of Go by uluyol on Sunday May 16, 2021 @08:18PM (#27178642)
Various parts of Python's standard library are implemented in C for performance. E.g. see https://lwn.net/Articles/725114/ under "Optimizations"