Closed austinpray closed 8 years ago
Unconvincing argument. PHP > Go. :trollface:
I am going to go forward with the decision to use Go for this project.
Does this mean it's actually open for discussion?
@kalenjohnson Yeah it's absolutely open for discussion. However, in the meantime I will be slinging some Go so we can prototype the CLI out and help flush out the requirements. I'm not afraid of porting <500 sloc if it comes to that haha.
:clap: :clap: :clap:
Can't wait to Go. ;) Count me in for beta testing.
🙌
@austinpray just listened to your podcast, I think you guys are on the right track with this. I know you are busy dudes, but was just wondering how stable this was and if you had any precompiled binaries? How much more do you have to go?
@cmosguy we have done literally nothing.
In response to some questions and concerns about using Go that came up internally and externally: I thought it would be a good idea to discuss why we are using Go for this project.
Concerns about Go
The primary concern about using Go is that by using a language unfamiliar to our target audience (WP devs), we will discourage external contributions. Also: I am the only one on the team who has experience with Go in production.
Another concern is that our projects already require three languages locally: Python, PHP, and JavaScript. So it follows that we should reuse the existing requirements and education so as not to add yet another burden of knowledge on our users.
What problems am I solving by using Go?
Our projects do not rely on any particular runtime, so this project cannot rely on any particular runtime
Our full stack of tools (roots-example-project) touches a lot of tools and runtimes. Trellis requires Python to run Ansible. Sage requires Node and NPM for its build process. Bedrock requires PHP for Composer. One thing we have done a really good job of doing is putting out projects that have low coupling and high cohesion. Although Bedrock, Sage, and Trellis gel extremely nicely together, people can and do use these projects without each other.
If people can use these projects without each other, then it follows that they will use the functions of the CLI independently. For instance: a theme builder might use the CLI to scaffold out a new Sage project with their desired CSS framework. A full-stack or DevOps developer might use the CLI exclusively for its Trellis orchestration capabilities.
Go is a compiled language. As such, it spits out a self-contained binary. A user does not have to know anything about the implementation of our program to run it. They simply have to download the binary (or have a package manager download it).
The Roots CLI not having any dependencies besides itself is a huge, huge benefit for our intended use-case. Let's make our CLI extremely easy to install and then have it act as our agent as far as getting people started with our projects. When starting a new project with the CLI, we can do things like check for the proper dependencies and walk the user through the steps on how to install them. If their dependencies are failing, we can even direct them to discourse and tell them not to file an issue. Hell, we could even have it search our discourse for the error message and spit back helpful results.
The entire Roots team knows how much trouble we have supporting our user's problems with NPM. Let's make the CLI our first line of defense against this type of stuff. We can't do this if we use Python, Node, or PHP. Go is uniquely suited for this task.
Go has a rich standard library for CLI type applications
Go is built with CLI apps in mind.
We have a great body of work to look at for inspiration as well
External contributions problem
A valid argument is that using Go will discourage external contributions. However, I am not concerned about this.
Conclusion
I am going to go forward with the decision to use Go for this project. For the current requirements and requirements on the horizon, Go is uniquely suited for the job.
Let me know what feedback you guys have!