Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Was Go considered as the language to write Pingora in? If so, why was Rust chosen?


Not from Cloudflare, but at a guess:

* They already have some pretty deep Rust experience on staff

* They were already dissatisfied with the performance penalty from Lua's GC, so Go's GC was presumably unattractive as well

* Rust is worth more internet points than Go (just kidding, mostly)


Well, rust's async ecosystem is top-notch as long as you're writing a network load balancer...


Rust's ecosystem is usually fantastic for CLI tools and specialized network servers. Large REST API servers aren't quite as solid (but perfectly doable for basic cases), and GUIs are nowhere near mature.

In several major areas, I actually like the available Rust crates for a given task more than I like the available npm modules. Rust has many fewer third-party libraries available, but the quality is often good.


Oh, I know. I was just joking that async rust is heavily geared towards build some kind of L7 proxy.


Right now the idiomatic Go approach to handle networking is 2-goroutine per socket (one for reading and the other for writing). Goroutines are very lightweight userspace threads, but they're not free: each costs you a small amount of memory. At Cloudflare's scale, this overhead quickly adds up. So resource-wise, Go isn't ideal for very large scale use cases.

There is a more-than-6-year-old proposal to introduce non-blocking I/O API (https://github.com/golang/go/issues/15735) but so far it's not gaining much traction. Maybe in Go2.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: