How to learn a new (programming) language

...by leveraging your existing knowledge to rebuild something you've already built. A Case study in Hare

(Cold open)

I watch a lot of “edutainment” on Youtube. And when a video on Portal 2 being turned into a webserver crossed my feed, I had to watch.

Combining that with this “webserver in 25 lines” from Computerphile I saw the previous year, I got inspired to write a webserver in Zsh.

Here’s the immediate result is what came out of that. Even though it’s single-threaded, it’s still reasonably scalable, since I’m poll()ing all open connections (using the Zsh builtin zselect).

And a toy webserver like this is a great project to take to a new language.

[Read More]
code  zsh  harelang  web