On Wednesday, 8 June 2022 at 16:27:01 UTC, w0rp wrote:
>Hello there! I mentioned this previously to Andrei in an email as something I was experimenting with for fun. I have ported significant portions of D ranges and algorithms to Go, as Go 1.18 added pretty decent generic typing. Here it is: https://github.com/w0rp/ranges
I didn't implement every function there is, and I limited my initial push of what to implement to InputRange and ForwardRange alone. The README documents the limitations in Go, and one thing I consider an advantage. Generally what you can do in Go will never be as powerful as D's complete template meta-programming functionality, but it is interesting to see just how much can be represented in Go.
Maybe there is something or other in here that someone can learn something from. I just did it entirely for a laugh and to play around with how generics work in Go in a serious way.
Enjoy!
Posts like these belong in the Announce part of the forums, I believe.
Cool project though, haven't ever used Go, so maybe I'll take a look at it :)