text
stringlengths
0
1.82k
**Carlisia Thompson:** I wanted to confirm, that's Gustavo Niemeyer, right? He works at Juju.
**Nate Finch:** Correct, yes. I skipped his last name because I was not sure how to pronounce it.
**Carlisia Thompson:** I actually only know him because he's Brazilian, and I always think he works for Google, but he actually works for Juju. How do you say Juju, anyway? I say Juju because that's how you say in Portuguese, which is so cute... How do you say it?
**Nate Finch:** Juju... It's a word for magic. That's what we think Juju does - magic stuff.
**Carlisia Thompson:** Gummy bears in Brazil are called "jujubinha", so I always think of gummy bears when I see Juju. \[laughter\]
**Erik St. Martin:** So Juju is basically an orchestration platform for tying together different services. I haven't used it myself, but it did look interesting. You guys have the Charms, which are the way applications are tied together.
**Nate Finch:** Yeah, it's very similar to other orchestration platforms such as Kubernetes...
**Erik St. Martin:** ...Docker Swarm, Mesos...
**Nate Finch:** Yeah. We're not so tied to Docker, because we existed before Docker existed, so...
**Erik St. Martin:** You win! \[laughs\]
**Nate Finch:** \[03:47\] Right! There you go, we win. So we do support Docker - if you wanna use Docker, that's fine. If you don't wanna use Docker, that's also fine. What it does is it lets you make a very lightweight wrapper around either your Docker thing, or your raw application, and then you can deploy it to the ...
**Erik St. Martin:** ...most of the time.
**Nate Finch:** Yeah. There's a couple known issues with the way that Mongo works, and if you're careful you can avoid them.
**Erik St. Martin:** With the history of Juju and the length of time it's been around - I know Gustavo was working on it back in 2013-2014, so we're talking early Go days, pre-1.0. There have to be some lessons learned, how things evolved. We were talking the other day on the show about Kubernetes and the etymology... ...
**Nate Finch:** Oh yeah, definitely. A lot of the early developers were more familiar with Python, so there's a lot of Pythonisms, which is sort of worse than Java-isms... Because Java at least is strongly typed, whereas with Python people expect to be able to just curl in whatever... So there's a few spots where there...
I think one of the bigger lessons learned is we use Gustavo's GoCheck, which is a testing framework built on top of GoCast. It adds test suites so that you can have code that runs before a full suite of tests, and then code that comes before each individual test very JUnit, xUnit those things do that, too.
That's actually been kind of a problem, because it means that we have a lot of code that runs that's invisible, which means it's hard to know exactly why a test actually works, because it's all this stuff to set up that you don't see, and then the unit tests take on a piece of machine a good 17-18 minutes. And that's j...
**Erik St. Martin:** So this is just your unit tests and not integration tests, and stuff.
**Nate Finch:** Correct. Our integration tests are even worse, but that's sort of understandable because our integration tests actually bring up machines in the cloud. Those take like four hours. That's doing a lot of work over the network, and machines moving, and so on. But unit tests - it's kind of inexcusable to ha...
\[07:46\] We have a lot of full stack tests that run against an actual Mongo database, which is great for making it a real-world scenario, but it's terrible when you make one small change and you wanna run all the tests. It's hard.
**Erik St. Martin:** The hard part is it's like "What should that number be?" With a 500,000-line codebase, it's going to take a long time to do a good test suite, but 18 minutes does feel probably on the longer side.
So you initially came up -- was this last episode or the one before, Carlisia? Where we were talking about Gorram. How do you pronounce that, anyway?
**Nate Finch:** Gorram. It's from Firefly, it's actually a swear... "Those Gorram thieves!"
**Erik St. Martin:** \[laughs\] That's awesome.
**Carlisia Thompson:** Erik, I don't remember which episode it was, and I don't even remember talking about it, but I also don't remember a lot of things, so I don't know...
**Erik St. Martin:** You're always the one who's... She knows exactly which episode that we talked to which person, she's so good at that stuff.
**Nate Finch:** It was episode \#21, and the reason I know that is because I've listened to it last night. \[laughs\]
**Erik St. Martin:** So it was a couple more episodes ago than I thought it was, but... Yeah, she's so awesome that I'll mention "We talked to somebody..." and she's like "Oh yeah, it was episode such and such."
**Carlisia Thompson:** Oh, thank you... But I guess it doesn't work all the time.
**Erik St. Martin:** If you ask me on Monday, I'll forget who we talked to last week. \[laughs\] So what was the motivation behind creating that? It's a really interesting project.
**Nate Finch:** So it's very simple - there was one definite spot where I said, "I can make this!", and I was working with some JSON at work, and it gets spit out to the CLI in a big mess with no line returns or anything, and I was like "I need to make this look nicer." I was working with someone else and we said, "Let...
I don't want to run Python to do that, I wanna make my thing in Go to do that, because I don't know all the Python libraries and stuff; I'm vaguely familiar with some of them, but I know the Go standards and libraries, so I was like "How can I make this work with Go?"
So first I figured out how it works in Python, because a vague big idea. In Python, each script actually has a bit at the bottom that says, "If I'm being run as main, then do this stuff." It wraps the actual package in some smart logic to do some stuff, and in the case of json.tool, it makes the JSON look nice. So I wa...
I'm a big fan of generating code, because I don't wanna have to write the dumb code that's always mostly the same, I want something to write it for me; that way, I can write the good stuff. So I was like, "Well, okay, I can do that." I think I was lucky that that was my starting point. It was a fairly complicated thing...
\[11:42\] I started poking at Go types, the standard library package that reads code and understands what types are in there. Luckily, much of Go code has a lot of conventions that we can use to understand what type of action this function's gonna take; so like readers and writers, and returning N for the length, and r...
So I just started poking at that for like a week or so, and got some basic things working. Then I've been adding a few new features since then.
**Erik St. Martin:** I just thought it was really cool, because I throw together little tiny Go programs to do stuff like that. Like, "Let me reformat the JSON", and stuff like that... So it was really cool to see that, because then I can actually throw that in my Bash script without having to pass around these little ...
**Nate Finch:** Yup. One thing I noticed you mentioned in the last show was that it works with the standard library - it actually works with anything in your Go path. If you have some third-party thing, it will still work.
**Erik St. Martin:** Oh, cool... So anything that's in the Go path of whatever machine it's being run on.
**Nate Finch:** Yeah.
**Erik St. Martin:** That's awesome. Bill Kennedy was asking us too what your experience with working on large code bases is, with it being that large and not the norm.
**Nate Finch:** It's funny, there's a proposal for Go 1.8 about aliases that is just before support for bigger projects; that kind of a thing actually could be pretty useful for us. We have a lot of lines of code, but also we have a lot of different repos and multiple different applications building off those. So any m...
**Carlisia Thompson:** I wonder... Can either one of you explain what an alias is, so we can frame this issue a little better for people who don't know? I have an idea, but I couldn't explain it well. And after we explain what it is, my question for you, Nate, is do you think it could be overused? I mean, it seems that...
**Nate Finch:** Yeah, I've been following that... So it has been implemented, but there's still time to roll it back if it's decided that we should. What aliases are is you can put a definition in your package that is, for example, "type Fu => some other package's type". The => looks like a right-facing big arrow...
**Erik St. Martin:** That's like the Ruby Hashrocket.
**Nate Finch:** Okay, and what that says is "references to this type and this package are the exact same thing as references to that thing in that package." So a question that takes one, take either. And more complicated constructions like a function that takes a function that takes that thing works with either one. An...
\[16:06\] However, if you have a function that takes a string reader and something else that wants to take a function that takes a function of io.reader, that won't work. It's a little hard to explain without text.
**Erik St. Martin:** Audio definitions of things gets difficult... But I guess the basic explanation of it is it's almost like a symlink where you're referencing one type from another package in your current package. Say you took one big monolithic repo and you needed to split it up. Well, you don't wanna break all the...
I didn't realize that it worked the other way. You said that basically the indirect works both ways, Nate, where if I took the type from the original package or I took the type from the new package, I could use either type pass in?
**Nate Finch:** I'm pretty sure. I'm not one hundred percent sure, but I think that's sort of needed to make sure that you have full compatibility. But I'm not a hundred percent sure.