Live data from Hacker News

Gadget: A smallish web framework for Go

redneckbeard.github.io

11–20 of 52 posts

Re: Gadget: A smallish web framework for Go

#11

I would love to hear why I would want something like this, or revel, or goweb, over: angular.js + Go web-service (net/http + Gorilla).

I just don't understand the argument that we should all just use HandlerFuncs for everything. Python and Ruby have stdlib HTTP facilities that are pretty good. They aren't nearly as nice as net/http, but you could totally build websites with them. People still have written lots of web frameworks, because it makes their lives easier. It lets them express programs in a simpler, higher-level way. I feel like this is even more valid now in 2013 since nearly anyone who's building websites has done so with one of those high-level frameworks, and they expect a similar experience.

Lots of people have abandoned Rails for Sinatra, or Django for Flask. That's totally cool, and there are good reasons to do so. There are also very good and obvious reasons to use something that further abstractions common patterns if the software you are building conforms reasonably well to those patterns.

Re: Gadget: A smallish web framework for Go

#12
post #5

Unlike Revel, you don't seem to have watch setup for .go files, which make sense since you want to keep it smallish. Curious on how other gopher trigger app restart from their editor of choice. Anyone have insight for setting up VIM+Tmux for Golang development that enable app restart from single key press? Sample .vimrc will be great.

I totally built a watcher command line app and ditched it because this was more convenient :)

https://github.com/codegangsta/dotfiles/blob/master/vim/vim/...

Re: Gadget: A smallish web framework for Go

#13
post #5

Unlike Revel, you don't seem to have watch setup for .go files, which make sense since you want to keep it smallish. Curious on how other gopher trigger app restart from their editor of choice. Anyone have insight for setting up VIM+Tmux for Golang development that enable app restart from single key press? Sample .vimrc will be great.

Recompiling and restarting the server has yet to become a bottleneck in development for me, or at least it hasn't caused enough friction or irritation to compel me to add something using fsnotify or other solutions. If you told me that you were very interested in using the framework but the lack of this feature was a barrier to adoption, I'd definitely think harder about it.

Re: Gadget: A smallish web framework for Go

#14
As a fan of Flask/Bottle/Sinatra/Express style web frameworks I miss a Go framework that works in a similar fashion. Don't know of any better way to prototype APIs so quickly and with such a small mental effort.

Edit: Just discovered [Martini](https://github.com/codegangsta/martini), that's exactly what I wanted.

Re: Gadget: A smallish web framework for Go

#15

I would love to hear why I would want something like this, or revel, or goweb, over: angular.js + Go web-service (net/http + Gorilla).

If you don't want it then you don't want it. Both Gadget and Martini pretty clearly outline the value that they bring to the table. If that value proposition does not win you over then these frameworks are not for you.

I personally have seen a great improvement in code simplicity, readability, and overall DRYness when projects are written using Martini.

Choosing a framework isn't about following some sort of socially acceptable way to build your web apps. Just build them! If a framework solves a problem for you then use it, otherwise keep using net/http handlers.

Re: Gadget: A smallish web framework for Go

#16

As a fan of Flask/Bottle/Sinatra/Express style web frameworks I miss a Go framework that works in a similar fashion. Don't know of any better way to prototype APIs so quickly and with such a small mental effort. Edit: Just discovered [Martini]( https://github.com/codegangsta/martini ), that's exactly what I wanted.

Have you seen Martini?

https://github.com/codegangsta/martini

Re: Gadget: A smallish web framework for Go

#17

I would love to hear why I would want something like this, or revel, or goweb, over: angular.js + Go web-service (net/http + Gorilla).

I just don't understand the argument that we should all just use HandlerFuncs for everything. Python and Ruby have stdlib HTTP facilities that are pretty good. They aren't nearly as nice as net/http, but you could totally build websites with them. People still have written lots of web frameworks, because it makes their lives easier. It lets them express programs in a simpler, higher-level way. I feel like this is eve…

> feel like this is even more valid now in 2013 since nearly anyone who's building websites has done so with one of those high-level frameworks, and they expect a similar experience.

But in 2013 do I really want to use server side HTML tempalating? Why not just connect a webservice to a HTML/JS presentation layer like I am suggesting? If all you are doing is building a webservice then the abstractions beyond net/http + Gorilla are not buying you much IMHO, but they do come at quite a performance cost: http://www.techempower.com/benchmarks/#section=data-r7&hw=i7...

My first couple Go web applications did things the html/template way and were structured on the way I used to go JSF applications- but since I switched to the above approach my projects have been better performing, faster to develop , better scaling and easier to maintain. As we all know, we seldom get all those things in one technology choice without trade-offs.

Re: Gadget: A smallish web framework for Go

#18

I would love to hear why I would want something like this, or revel, or goweb, over: angular.js + Go web-service (net/http + Gorilla).

If you don't want it then you don't want it. Both Gadget and Martini pretty clearly outline the value that they bring to the table. If that value proposition does not win you over then these frameworks are not for you. I personally have seen a great improvement in code simplicity, readability, and overall DRYness when projects are written using Martini. Choosing a framework isn't about following some sort of socially…

I'm glad you like these frameworks, and I not telling anyone not to use them. Like I said, I was just interested in hearing why I would want something like these frameworks which focus on server side templating, over a HTML/JS frontend + webservice approach. If you are just writing a webservice I think using Gorilla in addition to net/http is pretty much perfect.

Re: Gadget: A smallish web framework for Go

#19

As a fan of Flask/Bottle/Sinatra/Express style web frameworks I miss a Go framework that works in a similar fashion. Don't know of any better way to prototype APIs so quickly and with such a small mental effort. Edit: Just discovered [Martini]( https://github.com/codegangsta/martini ), that's exactly what I wanted.

Have you seen Martini? https://github.com/codegangsta/martini

Yeah just after posting my comment.

BTW, great work, that's exactly what I was looking for.

Re: Gadget: A smallish web framework for Go

#20
post #5

Unlike Revel, you don't seem to have watch setup for .go files, which make sense since you want to keep it smallish. Curious on how other gopher trigger app restart from their editor of choice. Anyone have insight for setting up VIM+Tmux for Golang development that enable app restart from single key press? Sample .vimrc will be great.

Recompiling and restarting the server has yet to become a bottleneck in development for me, or at least it hasn't caused enough friction or irritation to compel me to add something using fsnotify or other solutions. If you told me that you were very interested in using the framework but the lack of this feature was a barrier to adoption, I'd definitely think harder about it.

I write plain handlefuncs, but so far I have a pretty easy to remember command to restart the server for local development (works as well in Acme, where I'm writing most of my go code as in emacs, where I write templates and vim, where I usually just make really quick edits.) It's Cmd-Tab C-c [up] enter.

Just trying to express the same redneckbeard said: until it is a very thin bottleneck, this should be no problem.

Post reply on HN