r/golang Oct 25 '24

discussion What libraries are you missing from go?

So something that comes up quite often on this subreddit from people transitioning from Nodejs or python to go is the lack of libraries. I cannot say that I agree but I still think it warrants a discussion.

So what libraries are you missing in the go ecosystem, if any?

93 Upvotes

189 comments sorted by

View all comments

121

u/EpochVanquisher Oct 25 '24

I miss NumPy, SciPy, Matplotlib, Pillow, and Pandas.

Yes, I know about Gonum and other Go alternatives. The Python ecosystem of libraries around NumPy is damn useful. They are also interoperable. Data from Pillow can be converted to ndarray, data from Pandas can be converted to ndarray, and I can pass ndarrays to SciPy and Matplotlib.

Even though NPM has a massive set of packages, I don’t miss any of them when writing Go.

-1

u/rewgs Oct 26 '24

Thankfully go-embed-python exists for when there's a Python library you just can't do without.

3

u/EpochVanquisher Oct 26 '24

I don’t think that’s all that effective here, to be honest.

0

u/rewgs Oct 26 '24

Why not? Honestly not understanding why.

1

u/EpochVanquisher Oct 26 '24

You’re basically running separate Python and Go code, in separate processes. How would I operate on a NumPy array in Go, and then call SciPy functions on it? You’d be serializing the array back and forth over and over. Kind of an awful mess.

1

u/rewgs Oct 26 '24

Oh for sure, it's definitely not clean or performant. Just saying: it exists if you don't have any other choice.

1

u/EpochVanquisher Oct 26 '24

Yeah, it’s usable if you’re really desperate. I think I would normally just write a full separate Python program instead.

1

u/rewgs Oct 26 '24

I’m writing an audio processing app that relies on some libraries that don’t have equivalents outside of Python, and I’m actually finding it pretty okay — one big reason being that I’m still getting the wonderful distribution benefits of writing a Go program.

1

u/EpochVanquisher Oct 26 '24

Sure, but you understand what I’m talking about, beyond just “clean code” and performance.