weaviate / weaviate-cli

CLI tool for Weaviate
https://weaviate.io/developers/weaviate/client-libraries/cli
BSD 3-Clause "New" or "Revised" License
11 stars 11 forks source link

Suggestion: Rewrite in Golang #15

Closed etiennedi closed 3 years ago

etiennedi commented 5 years ago

The current version of the CLI tool resulted as a "we need something quick" prototype and is currently written in Python. I'm proposing to rewrite it in Golang for the following reasons:

Why Golang?

Why not Golang?

cc @bobvanluijt @fefi42

etiennedi commented 5 years ago

By the way I opened this issue not because I think we should do this urgently. Instead I want us to have the discussion soon and be aligned early. Then we can find a point in time when such a rewrite would make sense.

bobvanluijt commented 5 years ago

I’m completely agnostic on this. So, if @fefi42 agrees I’m all for it.

PS: For what it's worth, Python was used for prototyping because of the gcloud cli-software also uses P.

fefi42 commented 5 years ago

For now my Go-lang skills are very small so for high priority features it might be unavoidable to stay on python for a little while until I build these skills. From an engineering perspective I totally see the side that we want to have one technology stack. On the other side it is probably way easier to find programmers that have experience with python than with go.

etiennedi commented 5 years ago

For now my Go-lang skills are very small so for high priority features it might be unavoidable to stay on python for a little while until I build these skills.

Fair point. As mentioned above, I don't see any urgency in doing such a rewrite urgently. We also shouldn't postpone it too long though, as the tool is still relatively small and would be considerably easier to rewrite now than later. Completely agree with still adding features in Python if they are high prio.

A more interesting change could be the UX changes outlined in #14. Depending on what the strategy is on when to publicly announce and promote the CLI (@bobvanluijt?), I'd strongly suggest to do the UX improvements which are all breaking changes first.

I don't have a strong preference of whether we do "Tech-Rewrite and UX changes" in a single run or do them separately. If we go "UX changes first. Then Rewrite", we'll probably touch everything twice though. Having said that because of the small code-base the cost would be limited.

From an engineering perspective I totally see the side that we want to have one technology stack

cool 👍

On the other side it is probably way easier to find programmers that have experience with python than with go.

I'm not too worried about this. Go is designed to be easy to be picked up. The skills that you need to write good Go code (proper architecture patterns, isolation, abstraction, testability, test coverage etc.) aren't language specific. Someone who writes high-quality Python code will also write high-quality Go code after a bit of training.

For what it's worth, Python was used for prototyping because of the gcloud cli-software also uses P.

I was hoping I could find a blog post or something about why they made that decision, but can't find anything. My - completely made up- theory would be that Python was quite common among Infra engineers for automation already. So they got started with what was common. Not so sure if Google would still choose Python today if they started building the tool from scratch. ;-)

fefi42 commented 3 years ago

The CLI is now pip installable and uses the python client as a backend. This make the installment and publishing very easy and results in an extremely slim codebase within the CLI project itself. The CLI should even work on windows although I have not had the chance to test that.

From a one technology stack perspective python currently plays a big role within SeMI and will probably do so for a while with solution facing challenges.