text
stringlengths
0
1.17k
[428.32 --> 432.30] and you wrote a post that ended up kind of making the rounds at least in the tech community
[432.30 --> 438.94] um around your switch from ruby to go um specifically i think it was around command line applications
[438.94 --> 447.86] yeah oh yeah yeah so uh this is kind of how like hacker news operates if you write a post that is
[447.86 --> 456.14] even remotely could even possibly be somewhat controversial it will be on the front page and
[456.14 --> 462.98] stay on the front page and that's precisely what happened basically um i wrote a post titled
[462.98 --> 468.74] on distributing command command line applications why i switched from ruby to go you know that sounds
[468.74 --> 475.02] very uh it still sounds very nice it still sounds very civil but instead hacker news chopped off that
[475.02 --> 481.68] front part and just titled it why i switched from ruby to go oh my gosh flame bait and uh yeah
[481.68 --> 488.32] definitely got a discussion going um there was no intention to be controversial whatsoever um i i
[488.32 --> 492.80] simply came from a place where i was writing a lot of command line apps in ruby um specifically like
[492.80 --> 498.06] production facing command line apps that we were distributing to users who were not who are not rubyists
[498.06 --> 504.88] um so to uh one we didn't want to distribute it as a ruby gem because why why be like just use
[504.88 --> 513.44] ruby gems to a guy who's not writing ruby and uh so we had to do all these crazy things like vendor our
[513.44 --> 519.36] gems and you know distribute our own version of ruby package it up in an installer and like cross your
[519.36 --> 525.56] fingers and hope it all works on you know somebody's distribution um and that was just a very very painful
[525.56 --> 532.32] process to work out just to get ruby running um on somebody's machine so i looked into some other
[532.32 --> 538.94] alternatives and it seemed like go is uh very you know very unix focused so it means it's probably
[538.94 --> 546.74] pretty good for the command line and i just loved how simple it was to construct uh really good command
[546.74 --> 552.54] line applications that ran fast that were compiled into a single binary and could be cross compiled to
[552.54 --> 558.46] multiple os's so that's that's mainly why i wrote that uh wrote that blog post and wrote a library called
[558.46 --> 563.12] cli um and it seems to be people seem to be following in that same sentiment that's like
[563.12 --> 568.40] if you're not writing a tool for rubyists to use while they're developing ruby you probably don't
[568.40 --> 573.04] want to write a command line tool in ruby it's just it's too painful which i think i mean just
[573.04 --> 580.26] we're hearkening back uh to katrina again she had a similar experience with her exorcism command line
[580.26 --> 587.40] client where she wanted exorcism to be not just ruby focused but you know there's python uh exercises
[587.40 --> 592.72] there's haskell i think now copy script there's all sorts of languages and so she wanted to remove
[592.72 --> 599.36] that dependency for people to use her tool from the command line the ruby dependency so she ended up
[599.36 --> 604.34] rewriting her command line piece and go so let me ask you this then if you're moving from
[604.34 --> 610.96] distributing is a ruby gem and not requiring ruby you're distributing is go but is it still required
[610.96 --> 618.42] then is go required uh no go allows you to cross compile um basically to a standalone binary which
[618.42 --> 625.56] is really great um because it'll it'll basically work on any os that has libc pretty much and so
[625.56 --> 629.22] drop it into your bin folder hopefully you got that in your path and you're good to go yep exactly
[629.22 --> 637.02] um and the great part i mentioned cross compiling um uh in general it is dependent on what you do but
[637.02 --> 643.30] in general you can cross compile most applications um meaning like on my on my mac box i can compile for
[643.30 --> 650.96] windows and different flavors of of linux and my mac as well um and even stuff like arm and that way i
[650.96 --> 655.72] can just like here's a distribution here's a release and i just like build it all on one computer which
[655.72 --> 664.02] is which is really great nice so yeah the fruit of that came uh your project cli.go are you still
[664.02 --> 668.48] maintaining that is it ongoing or is it kind of a finished thing and maybe explain exactly what it
[668.48 --> 675.00] what it provides yeah so i am maintaining it um there are going to be small little additions to it
[675.00 --> 680.96] the way the api is structured it's not uh it's not meant to be changed a lot and and it kind of
[680.96 --> 688.02] falls in line with the philosophy behind go packages currently um which is keep master always
[688.02 --> 694.40] backwards compatible um and i haven't there's been edge cases obviously to try to fix and and some
[694.40 --> 698.58] edge case problems but in general most people seem to be pretty happy with it and it seems to be a very
[698.58 --> 704.50] good starting point for creating command line apps and generating help docs and everything like that but
[704.50 --> 709.60] i'll be honest it's not the most extensible framework in the world it was really just meant to be like
[709.60 --> 714.64] i don't want to think about you know help docs and parsing sub commands and parsing flags i just want to
[714.64 --> 719.48] start writing the actual meat of the code and so that's what it does and it does it tends to do it
[719.48 --> 725.92] pretty well and so i think that's where the popularity of the library came from right on so
[725.92 --> 731.68] you just kind of triggered a a tangential question that i've been waiting to ask somebody who's who's
[731.68 --> 738.66] in the go community what's the the package management story in go um how does that fit into like if
[738.66 --> 745.48] you're building a command line application or even with martini um is there i know there's go get is
[745.48 --> 753.44] that the is that the whole story yeah so uh right now the package solution or the the the package
[753.44 --> 758.72] management solution for for go is it just a very simple one it's a very primitive one you use go get
[758.72 --> 765.62] you can import uh libraries with go get the the great part about how imports and go get works
[765.62 --> 772.96] is that um a path is a path is a path meaning my library when i imported my code is github.com
[772.96 --> 779.48] slash code gangsta slash cli um that way if it will first check locally on your computer if you have it
[779.48 --> 784.96] and if you don't it will go and pull it down so um it's cool to have that kind of uniform identifier
[784.96 --> 790.48] uh with your code so that's why you've got to keep master good yes that's why you got to keep
[790.48 --> 796.08] master good is there's no um as of right now there's no built-in idea of versioning and that
[796.08 --> 803.58] is intentional uh it is intentional at least for the moment um because a lot of the go maintainers
[803.58 --> 809.16] want you to build packages that are useful and that do uh that are small that do you know a certain
[809.16 --> 816.02] set of things very well that aren't going to be you know completely innovative innovated and iterated
[816.02 --> 823.98] upon during its development cycle um there are some there are some initiatives for bringing in
[823.98 --> 829.56] things like versioning because we realize that's like theoretically a really cool idea but in practice
[829.56 --> 835.70] it's it it can be harmful depending on you know how many dependencies you're pulling in and how you're
[835.70 --> 840.14] managing those and i know there are external tools for doing them that i use for certain projects
[840.14 --> 846.52] and there's some other solutions that i've been uh working on as well uh specifically with regards
[846.52 --> 851.90] to martini and cli um to be able to iterate on those packages for people to be able to pull in
[851.90 --> 858.90] versions uh that are different so you mentioned jared you mentioned go get and are you going to
[858.90 --> 865.80] allude to the fact of like go unget because i don't know how to not get long story short i don't
[865.80 --> 870.00] either you know what i mean like if i if i if i go get something i want to like let's say uninstall
[870.00 --> 876.06] remove it how do you uninstall things um you remove the folder where it's at see that's what i thought
[876.06 --> 880.66] and that's what i was doing i was like am i an idiot or something so at least i'm not an idiot hey man
[880.66 --> 886.96] you're doing it right yeah is that the i mean is that really the way that is it just because go is
[886.96 --> 891.88] somewhat new and the things are still kind of evolving how things should work and yep i think i think
[891.88 --> 899.02] we're since go is still a fairly new language fairly new technology um and it's very grounded
[899.02 --> 904.26] in unix philosophy so a pure unix guy would be like yeah there's no problem deleting a folder that's
[904.26 --> 907.90] what you do that's what folders are for that's what directories are for and that's what the file
[907.90 --> 913.30] system's for um but i could understand it being a roadblock for people who are used to having tools
[913.30 --> 918.38] take care of a lot of things for them i think even though the folder it comes in has a bunch of
[918.38 --> 924.22] other stuff in it so i'm like should i delete that stuff you know i guess as a someone coming
[924.22 --> 931.40] in that with lack of experience in it i'm like you kind of have a an immediate bit of fear you know
[931.40 --> 936.90] should i do that well what was the cause of it or what would happen if i do do that and then next
[936.90 --> 941.68] thing you know you've got your go directory that's got bin package and source in there and you got like
[941.68 --> 947.30] do i just delete it all like some of it and you're you know that's that's where i that's where i was
[947.30 --> 953.20] like i'm not sure adam i think the answer for you is you keep jeremy available on skype okay and
[953.20 --> 958.02] then you just throw these questions at him as you go that's right you'll just right i'm here all
[958.02 --> 965.10] night so you so so you do this command line app and you enjoy distributing command line applications
[965.10 --> 970.64] with go are you doing this for your for your work as well or is it all for play uh for command
[970.64 --> 978.40] line stuff it's all for play in general uh we do use some of the tools uh one of them um one of them
[978.40 --> 984.52] i'm working on is called envy it's an environment bootstrapper and it if you're used to working with
[984.52 --> 992.10] web frameworks like you know express and node.js or or rails and ruby there's a concept of a .env file
[992.10 --> 996.70] which is basically saying we want to store our configuration in in our environment we don't
[996.70 --> 1001.90] want to like run a run a shell script every time to like bootstrap our environment and we obviously
[1001.90 --> 1006.86] don't want to like have anything checked into the repo um for that stuff because we're dealing with
[1006.86 --> 1014.38] passwords and you know tokens for authentication for certain services so you have a .env file that
[1014.38 --> 1018.86] declares all that stuff and it's local to your machine um so you can set it up and manipulate it
[1018.86 --> 1026.50] however you want uh so this this env bootstrapper called envy allows you to do this in a generic way
[1026.50 --> 1031.36] most .env implementations are tied to the language you use them in like node.js or
[1031.36 --> 1039.68] uh javascript for node.js or ruby for rails this one's very generic all you do is you call envy and