|
|
|
|
|
by SleekoNiko
589 days ago
|
|
I've tried going down this route myself by using libraries like fp-go[1]. I think this particular project has done a great job, but I ultimately opted not to pursue functional programming in Go for a few reasons: - Ergonomics weren't the greatest when working with monads such as options and results. I think pattern matching is needed here, but concepts like those go against Go's core design philosophy. - I suspect there are several cases where runtime performance is an issue, but admittedly did not investigate this. - Perhaps most importantly, it deviates from the way most people read and write Go, and less importantly, LLMs struggle too. Because of these reasons, I came to the conclusion that the advantages were not worth the trade-offs. Perhaps somebody will create a garbage-collected Rust-like language in the future and bridge the gap between the two languages. [1] - https://github.com/IBM/fp-go |
|
Gleam is pretty nice in that regard I think, I can see some parallels with Go in terms of simplicity and Rust in terms of basic syntax, it does currently lack a native target that produces a Go-like single binary though.