Live data from Hacker News

Show HN: Stencil – Simple code templating for Go

laddoo.net

1–7 of 7 posts

Re: Show HN: Stencil – Simple code templating for Go

#2
This is really really cool!

As an aside though, I feel like we need some protocol for on-save junk. GoImports, GoFmt, Stencil, ... all are trying to implement a bunch of functionality on save.

Is there a good way to handle this? Both GoImports and Stencil implement GoFmt (I believe), what's a better way to do this?

Re: Show HN: Stencil – Simple code templating for Go

#3

This is really really cool! As an aside though, I feel like we need some protocol for on-save junk. GoImports, GoFmt, Stencil, ... all are trying to implement a bunch of functionality on save. Is there a good way to handle this? Both GoImports and Stencil implement GoFmt (I believe) , what's a better way to do this?

On-save should support unix-style pipe-lining. That's the time tested pattern. I guess it depends on which editor you use.

Re: Show HN: Stencil – Simple code templating for Go

#4

This is really really cool! As an aside though, I feel like we need some protocol for on-save junk. GoImports, GoFmt, Stencil, ... all are trying to implement a bunch of functionality on save. Is there a good way to handle this? Both GoImports and Stencil implement GoFmt (I believe) , what's a better way to do this?

Stencil implements GoImports formatting which is basically GoFmt with a slightly different import ordering. And yes, it would be useful to standardize this somehow, the way go generate is standardized.

Re: Show HN: Stencil – Simple code templating for Go

#5

This is really really cool! As an aside though, I feel like we need some protocol for on-save junk. GoImports, GoFmt, Stencil, ... all are trying to implement a bunch of functionality on save. Is there a good way to handle this? Both GoImports and Stencil implement GoFmt (I believe) , what's a better way to do this?

On-save should support unix-style pipe-lining. That's the time tested pattern. I guess it depends on which editor you use.

You mean piping into editors? I'm working on something related; most editors don't handle cursor repositioning very well when you dumbly refresh the content without going through editor-specific APIs.

Re: Show HN: Stencil – Simple code templating for Go

#6
My question is: do we really need to complicate tools to replace a language missing feature that someone keep telling we don't need? Does it really worth it? I'm not against the author, his work is amazing! I'm just pointing out that we are here, writing "language patches" that's shouldn't exists at all...