3 ms·
It's worth noting that the "self-hosted compiler" thing here is a red herring. E.g. the JVM is a C++ project, but you can easily read the HashMap implementatio
by pdpi 10mo ago
It's worth noting that the "self-hosted compiler" thing here is a red herring.
E.g. the JVM is a C++ project, but you can easily read the HashMap implementation, because it's part of the standard library, not part of the runtime.
- vips7L 10mo agoFWIW javac is self-hosted.
- pdpi 10mo agoRight, but the point stands — javac could've been implemented in whatever language you like, it doesn't have to be the same language as the JVM itself, and neither of those affect the fact that HashMap is a plain old java class, not a builtin type.
- f311a 10mo agoIn Go, hashmap implementation is pretty low level. Even linker carries some parts of its implementation details.
- pdpi 10mo agoHuh, that's pretty cool. Do you happen to have any links pointing at any of that stuff?
- f311a 10mo agohttps://github.com/golang/go/blob/7ecb1f36acab7b48d77991d58d456a34074a2d0e/src/cmd/link/internal/ld/deadcode.go#L562 https://github.com/golang/go/blob/7ecb1f36acab7b48d77991d58d... Here linker relies on the current memory layout. Changing it requires updating linker code as well.