I want to use Golang as a main language. To be able to do that, I would like to have blueprints for everything that I normally do in say node/Javascript for Golang.
Deploying Golang
First problem is I normally use vercel to freely deploy my side projects. Go can be used for their serverless runtime, but its much more limiting and I’d keep my go server up all the time, since go is such a resource efficient language.
Luckily I already have the solution and I was already using this solution with node. I started deploying node apps to Railway, which costed me about $6/mo to run per app. This is because node has a 300mb memory footprint. I tried rewriting it in Golang and go had a 7mb memory footprint, which cut my costs substantially.
Note, the go version isn’t a full implementation yet so it doesn’t have the same traffic.
I would also like to experiment with Fly.io, I think it would be similar to railway but it might be better. Fly.io sponsors other languages that I want to learn this year, namely: Gleam and Elixir.
End-to-End type safety
Typescript on the frontend and backed allows for sharing types, but this can be achieved in other languages too if you use RPC or Graphql.
I had asked on Twitter what people used for this and got some very helpful responses.
Fullstack JS/TS frameworks have ruined me. I want to use golang on the backend, but want that sweet e2e type safety.
— Sam (@metruzanca) July 11, 2024
So I think my choices are Graphql or gRPC.
I also want SSR, so I can't use a SPA. So I guess HTMX & Web-components?
- RPC
- Graphql
API
Echo
Web Scraping
- cheerio -> https://github.com/PuerkitoBio/goquery
DaaS
Turso, pocketbase
SSR
Templ, HTMX
CLI
Charm stack e.g. BubbleTea