bakape / shamichan

anonymous realtime imageboard focused on high performance and transparent moderation
Other
434 stars 74 forks source link

Question: Choice of Rust over Go #1330

Open ECHibiki opened 1 year ago

ECHibiki commented 1 year ago

Three questions: 1) I'm wondering why you reduced the usage of Golang in the project and instead are doing a horizontal mix of Golang, Rust and NGINX? 2) What issues were you resolving that could not be handled by Go? 3) I've considered the hypothetical of using Go with Rust bindings in HTTP imageboards and might experiment with it one day, would that have been an option in your opinion? Though maybe one should just go to CGO instead of tinkering around with strange ideas... the third question could be said as "why did you not use Go Bindings if one of your reasons was better performance?"

bakape commented 1 year ago

It's a middle ground, given I have sizable Go libraries and not enough reasons to port them to Rust. The websocket server benefits heavily from Rust though.

You can read up on the advantages of Rust over Go anywhere, but the tipping point for me was reviewing non-trivial concurrent code from other people. Go is not much less of a footgun than C with any concurrency pattern more complex than fan in and fan out.

On Tue, 2 Aug 2022, 12:14 ECHibiki, @.***> wrote:

I'm wondering why you reduced the usage of Golang in the project and instead are doing a horizontal mix of Golang, Rust and NGINX? What issues were you resolving that could not be handled by Go? I've considered the hypothetical of using Go with Rust bindings https://words.filippo.io/rustgo/ in HTTP imageboards and might experiment with it one day, would that have been an option in your opinion?

— Reply to this email directly, view it on GitHub https://github.com/bakape/shamichan/issues/1330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MC2N7FOSTSRQWYX7PLVXDRF5ANCNFSM55KMICBQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ECHibiki commented 1 year ago

Thanks for the response. I will keep Rust in mind for any socket related expansions, Golang has it's limitations though it's a very useful language. In my opinion imageboards, contrary to the liveboard, require instant-messaging or traffic goes offsite into IRCs or discord: Places where the more drawn out style of posting is less preferable to a fast paced environment.

Your information is helpful in future planning.