▲ | davidw 6 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Erlang, because of its architecture, has something of a habit of people rewriting various protocols in Erlang itself, rather than calling out to some C library. This has pros and cons. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | toast0 6 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Writing protocol code in Erlang is nice, because the parsing is so easy and clear. And if you want to do something that's not so easy by spawning a command, then you may as well build it in Erlang. And it's fun and symmetric to build both a server and a client... I've not looked at OTP SSH code, but I'd assume the ciphering is still calls to external c libraries, as it is in the OTP TLS code. Of course, easy protocol parsing doesn't do the whole job; state management is required too (and was missed here, clearly). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | innocentoldguy 6 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is probably because C NIFs run in the same process as the Erlang scheduler. If you have a long-running or blocking NIF, it can starve the scheduler and cause significant performance degradation across the system. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|