4 ms·
This looks simple not only because the article is written well but also because Go is the go-to-language for complex networking situations. Doing things in para
by ktpsns 2y ago
This looks simple not only because the article is written well but also because Go is the go-to-language for complex networking situations. Doing things in parallel, even pipelining? This would make quite some spaghetti algorithm in C/C++, even async rust/python world would not look so clean as in Go. This is clearly a big strength of the language.
- johnisgood 2y ago> Go is the go-to-language for complex networking situations And Elixir / Erlang for serious ones.
- cybrox 2y agoRarely on the client side.
- johnisgood 2y agoWhy though, especially with Phoenix? (HTML HEEx, etc.)
- dataviz1000 2y agoUnfortunately, BEAM VM is very slow compared to multiple other languages including Go. It's great when starting out with a few developers, however, since Go and Rust are much more performant, it is possible to hire several more Go or Rust developers with the server cost savings instead of being tied to Elixir. There is always a trade off between easy to use and high performance. But, yeah, if I was going to bootstrap a startup at the seed level, Elixir is the best choice for backend. If I'm spending $500K+ a year on infrastructure, I'll be looking at Go and Rust.
- cultofmetatron 2y ago> Unfortunately, BEAM VM is very slow compared to multiple other languages including Go. for cpu bound tasks? sure. but we are talking in the context of networking. elixir is going to absolutely smoke go for applications requiring a lot of simultaneous connections. We can already see it in actionable vs phoenix channels. channels supports a magnitude order more simultaneous websocket connections per machine. ps: libraries like rustler exist. you can take the cpu intensive stuff and offload it to a module written in rust when you really need to squeeze some perf out.
- johnisgood 2y agoAnd for CPU-bound tasks one could use NIFs (usually better) or Ports if absolutely necessary. https://stackoverflow.com/questions/42035912/running-c-code-in-elixir-erlang-ports-or-nifs https://stackoverflow.com/questions/42035912/running-c-code-...
- dataviz1000 2y agoElixir lacks the fine grain control for optimizing I/O which Go provides. Moreover, a bit torrent client requires CPU intensive hash verification, encryption/decryption, and data compression/decompression which will greatly slow down Elixir. You can build a connector to Rust or instead of using slow abstraction layers you can build the thing in Rust if you have the skills. Rather then tell me, you are going to have to build a bit torrent client in Elixir and show me. Otherwise, after my years experience working with an Elixir team, I don't believe you.
- deleted 2y ago[deleted]
- cherryteastain 2y agoAgree with C and old style C++, but going off the flowchart [1] in the article this could be done quite cleanly with boost::asio and C++20 coroutines as well. [1] https://blog.jse.li/torrent/download.png https://blog.jse.li/torrent/download.png
- pkolaczk 2y ago> even async rust/python world would not look so clean as in Go. That’s quite debatable and my experience is different. There is a whole lot of high level stuff that can be expressed with eg async streams and functional transformation chains in Rust, that Go has no counter offer for. Same for being able to use any future in select/join not just channels. Also I find cleanup / error handling in Rust much cleaner.
- z0ltan 2y ago[dead]
- neonsunset 2y agoAnd Go is not even the best or fastest language at this either - Goroutines are quite caveman of API, with footguns solved by better languages.
- cultofmetatron 2y ago> Go is the go-to-language for complex networking situations. laughs in elixir