Live data from Hacker News

Ask HN: Anyone here switch to Go for building (REST) APIs?

news.ycombinator.com

21–30 of 51 posts

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#21
post #19
post #10

First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST. Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We…

Can you elaborate on why HTTP APIs cannot be REST APIs? I know a lot of http services are misclassified as REST, but why can they by definition not be?

This is one of my favorite posts about it.

https://www.unixsheikh.com/articles/no-your-api-isnt-rest.ht...

The author got Roy T. Fielding, one of the principle authors of the HTTP specification and the originator of the Representational State Transfer (REST), to comment on this issue by email (was since removed when the author changed his blog).

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#22
I switched from Python to Go for API development and never looked back. Performance is great, deployment is a breeze and the compiler and type system are good enough that my code normally works on the first try. I've also been building AWS Lambda backends and Go is great in that role as well. Workloads complete much more quickly than equivalent Python code and use a fraction of the memory.

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#23
post #10

First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST. Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We…

After reading the article you linked in another sibling comment's response, can you point to an example of what a true RESTful service looks like.

I see how under that definition an API can't be RESTful, but what service then can be? And how do clients interact with it?

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#24
post #10

First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST. Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We…

I’m glad some people, even though not many, still know what REST implies.

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#26
I made a few APIs on Golang and it was fine. It was easy and it performed well in production for many years.

Today, I would go with Rust instead because of personal preferences. But if my code base has to be shared with not very experienced developers, perhaps Golang again.

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#27
post #10

First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST. Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We…

After reading the article you linked in another sibling comment's response, can you point to an example of what a true RESTful service looks like. I see how under that definition an API can't be RESTful, but what service then can be? And how do clients interact with it?

> can you point to an example of what a true RESTful service looks like.

Not OP, but there was an interesting article & discussion recently here: https://news.ycombinator.com/item?id=32141027

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#29
post #10

First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST. Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We…

Can I ask about the choice to not use any libraries? As in your go.mod file is empty? I understand the desire to keep dependencies to a minimum but surely there are use cases where it is better to import existing code rather than writing something from scratch no?

Do you use internal libraries?

Re: Ask HN: Anyone here switch to Go for building (REST) APIs?

#30

Yes, in 2017 and 3 companies later I've never looked back. Current application is an event-sourced system that includes a REST API, asynchronous event processing over SSE, and a scheduled job runner. It's been great. We don't use any frameworks, just the http package. It's blazing fast and highly reliable (low bug occurrence and easy refactors due to the safety provided by strong typing).

What were you using before Go? I notice in the relies that a lot of people are coming from Python. Did you consider using Java? And if so what made you use Go in the end?
Post reply on HN