text
stringlengths
0
1.82k
• Discussion of Zap, a structured logging framework from Uber
• Comparison to Heka for backups
• Mention of NSQ, a distributed queue tool from Bitly
• Introduction and recommendation of iTerm2 terminal emulator
• RethinkDB database discussed as used by Raphael's team
• Appreciation for companies that support employee-led open source projects
• Brief discussion of RocksDB, a log-structured merge-tree database
• Recap of various tools and databases mentioned on the show
• Goodbyes exchanged between Thompson and Raphaël Simon.
**Erik St. Martin:** It's Go Time! A weekly podcast where we discuss interesting topics around the Go programming language, the community and everything in between. If you currently write Go or aspire to, this is the show for you.
Alright everybody, welcome back for another episode of Go Time. It is episode number 7. Today we have Brian Ketelsen here with us. Say hello, Brian.
**Brian Ketelsen:** Hello.
**Erik St. Martin:** And Carlisia Campos is also here.
**Carlisia Thompson:** Glad to be here, hi everybody.
**Erik St. Martin:** And we also have a special guest here with us, Raphael Simon, who is the creator of a framework called Goa for generating APIs, which Brian is particularly excited about.
**Raphaël Simon:** Hello.
**Erik St. Martin:** You want to give us a little bit of background, Raphael?
**Raphaël Simon:** Sure, yeah. So let's start with my who am I. So I'm a platform architect at [RightScale](www.rightscale.com). RightScale is a cloud management platform. I've been working there for almost eight years. When I started, the whole product was basically a single Rails app, and the platform has grown a lot...
Part of going from this single Rails app to all those distributed services, we felt a lot of pain in having to design API's the right way. What I mean by that is being able to come up with APIs that are consistent and have standards that are enforceable, so that we can come up and say, "Yep, that API looks good. It fol...
As you probably know, once an API is alive it's almost impossible to change it. Once you have customers that start using it or once your internal services rely on it, then that API is gonna be there forever. So it is very important that you spend the time designing it properly.
When we looked at what was available to do that, there just wasn't much. There were a few tools here and there, but nothing that we felt would be enough for us. So we ended up creating a framework at the time, a framework in Ruby called [Praxis](http://praxis-framework.io), that basically allowed you to write the desig...
Going fast forward, RightScale kind of shifted towards Go, and I thought it will be good to see if we could do something like that in Go. To be honest, I wasn't sure initially that will be possible. We played around with a few things, and it took me about a year really to come up with something that started to look lik...
\[03:51\] The second realization was that the design should be written in a DSL, so that the language used to describe the API used the right terms. You want to talk about resources, actions, responses, requests, and you don't want to have to deal with programming language artifacts, so that DSL will have to be a Goa D...
Fast forward a year and a half, I have to say that the result turned out a lot better than I thought it would be, and I think the credit goes to the Go language. The Go language provides a very simple and powerful mechanism to create the DSL. It also has as very good code analysis support, which is essential and a very...
So all of that put together, I think, we end up today with something that is actually very interesting, and we have started using Goa fairly extensively here at RightScale.
**Erik St. Martin:** That's great. So just kind of like a high-level detail... So Goa is a framework for using a kind of DSL that's written in Go to generate HTTP APIs?
**Raphaël Simon:** Yeah, exactly. From that design, from that DSL which is Go code... Basically the DSL you can think of it as a lot of package-level functions that you invoke and that are recursive. So you call a top-level function, let's say Core API, and you then embed other function codes in it while you define eve...
Goa comes with a few built-in code generation outputs. One is the glue code that bridges the role of an HTTP server with the user-provided handlers, and that code takes care of validating the incoming requests according to the validation rules describing language. It also builds convenient data structures for accessing...
The Go agent tool that comes with Goa, which is the code generation tool, also generates a client package and a client tool. That's also been very neat, because one issue is when you create an API, obviously the point is for the API to be consumed, and what tends to happen is that every team consuming the tool will dev...
\[08:16\] So having that being generated automatically means that the team that provides the API also provides the client, and everybody uses that one client, and so it makes everything consistent and helps other teams consume the API.
GoAgent also generates documentation in the form of Swagger and JSON schema so that you can at any point in time share the design to other people that may not be familiar with the Goa DSL. You can use that also to document the API once it's in running production; so all of that makes for a very nice way of developing A...
**Brian Ketelsen:** So I have two comments. I found Goa in October or November, I guess, of last year and two things struck me immediately when I saw Goa. The first was that the generated code looked hand-written, and I have to commend you for that, because for me, that was the most impressive part of the project; all ...
**Raphaël Simon:** Well, thank you. Yeah, I mean that was definitely a design goal. When I started Goa I was a little bit - not afraid, but I was a bit worried about the reception that the Go community will have, because I know that the Go programmers are very, not picky, but they like the Go code to be idiomatic. They...
**Erik St. Martin:** Now, speaking of the kind of idiomatic Go and reception from the community, what's the reception like for the actual DSL itself? Because I've seen the generated code, which I think is highly idiomatic, but I don't know whether the DSL is so much. Do you get a lot of slack about that or are people p...
**Raphaël Simon:** Yeah, so there has been a few comments on the repo on GitHub of people trying to make it look more like Go, but then I'm always very... I kind of have a hard line, saying "This is not Go, it's a DSL. It's a different language. It's implemented in Go, but it's not Go." So for example one thing that yo...
\[11:47\] You should think about it, some of the target outputs for the DSL is documentation. There is also a JavaScript client that you can generate from that DSL. And in the future there can be pretty easily written to generate clients in other languages. So if the language has to be agnostic, it has to remain indepe...
**Erik St. Martin:** Right. So people just need to disconnect a little better, right? It's kind of like gRPC; the DSL is essentially the protobufs, and then the generator generates from that, and yours just happens to be...
**Raphaël Simon:** Yeah... You see, if you write Swagger then it's completely different from your programming language. It's the same idea.
**Brian Ketelsen:** Well, that leads me to the second thing that I noticed about Goa, which was the approachability of the DSL. I've seen many DSLs in the past... Being a former Ruby developer, everything we did in Ruby was a DSL in one way or another, so seeing a DSL in Goa that was approachable and understandable was...
**Raphaël Simon:** Thank you. Yeah, that took a while to get right. And actually you mentioned [Ginkgo and Gomega](https://onsi.github.io/ginkgo/) because they were definitely a big inspiration for the Goa DSL. I went through different iterations... In one iteration I was using literal data structures to define a DSL, ...
I think it clicked once I saw the trick of basically having an anonymous function, being an argument; that's really the trick. Once you see that, once you understand that, then everything kind of falls together. Then it's easy to sort of embed those function calls and make it look like it's just a series of instruction...
**Brian Ketelsen:** So what has surprised you most about the explosion of Goa adoption?
**Raphaël Simon:** I was very, very impressed by how the Go community and you, especially, really embraced Goa. It was more for sort of personal research, interesting projects, see what could happen... Also with the potential of maybe being used at RightScale but that was about it. And then I guess you stumbled on it a...
**Brian Ketelsen:** And I wrote a blog post.
**Raphaël Simon:** Yeah, you put me into the Slack channel and it's been awesome. I mean, I think there is no way that Goa would be what it is today without that community, without all the input. That's just not code, it's the ideas, the requirements, the numerous bug fixes, I mean... That to me was like waking up in t...
**Brian Ketelsen:** So it's only appropriate that we talk about that blog post that I wrote, because on this show we have a habit at the end of every show of talking about the [Free Software Friday](https://open sourcefriday.com) movement that we're trying to portray here, and that was the blog post in... I wanna say i...
**Raphaël Simon:** \[16:04\] No, that made me laugh. That made me have to retrieve my lost Twitter password. \[laughter\] Yeah, I wasn't on Twitter at the time and it was a colleague of mine that saw that tweet and told me about it, and I had a good laugh. It's been great. I really appreciate all the support that you'v...
**Erik St. Martin:** I know it was probably a few months ago, but you went to a refactoring to kind of support pluggable... To create kind of plugins for stuff, because I know Brian ended up going to and creating a plugin for ORM integration.
**Raphaël Simon:** Yeah, I think Goa may have caused Brian to kind of rewrite the same thing seven times in a row, or something like that... \[laughter\] So sorry about that. But yeah, I mean, it was basically an exercise of trying to make it possible for plugins to be added to Goa at the same time that the big plugin ...
But yeah, I was working on trying to make plugins work in Goa in the same times that Brian was working on Gorma, so I must have brought him program Gorma maybe 200 times, or something like that.
**Brian Ketelsen:** It was sure a fun process though, it's okay.
**Raphaël Simon:** Yeah, and I think the end result is nice. I think anybody that now writes a plugin for Goa has to thank you. I think that should be the rule.
**Brian Ketelsen:** So what's been the most surprising plugin that you've seen, or the most surprising contribution to Goa?
**Raphaël Simon:** I think Gorma is definitely up there. Once you think about it, it's a use case that's really important, I just hadn't thought about it, and once you think, "Oh, yeah, obviously", the next thing you need to do after you get your request is to start it. Well, you're gonna need to talk to some database,...
**Erik St. Martin:** So I guess it's kind of hard to go into detail about the actual DSL itself, because it is all audio based. I mean, we can draw stuff on our own individual whiteboards if we wanted to, \[laughter\] but somehow I don't think that's gonna help the listeners. One thing I would like to talk about though...