ENTRY

[ESC]
1mo160 words4 replies

Today, I recreated SSH from scratch in go. Well, ssh without the s for secure. And really, without most of the other features either. It's mostly just remote use of a shell process, with the output being piped back to the client. Still, that's not nothing! And I learned a bunch more about TCP in the process, which was really the true purpose of the exercise. And about how Go conceptualizes os.Stdin/Stdout via interfaces, which helped understand how some of the tricks I used in my cyberspace client work under the hood.

Btw, did you know that each goroutine gets its own stack? At some point while working I thought about how goroutines continue working even after the function that spawned them returns, which would be a problem if they existed in the same frame-stack. So I looked up whether they get their own and yeah, they do! Feels pretty amazing to figure something like that out from context clues.

4 replies

Log in to read the replies and join the conversation