Live data from Hacker News

Hero – A handy, fast and powerful Go template engine

github.com

11–20 of 55 posts

Re: Hero – A handy, fast and powerful Go template engine

#11
post #6

Earlier quoted context omitted.

It shouldn't be. I prefer template engines that I like the syntax and documentation the most. For low traffic efficacy doesn't matter, for high traffic you should always cache the templates.

Ideally, a template should be compiled into native code.

There is a web framework (vibed.org) written in the D programming language that does compile templates to native code.

Re: Hero – A handy, fast and powerful Go template engine

#12
Adding a whole dependency to shave a few milliseconds off serve times (at most) seems like a bad deal to me.

All the usual bad stuff that comes with dependencies: will it be maintained? Will it have breaking changes? Will it leftpad?

And everyone knows the standard library template format, all the editors support it, if another coder joins the team they'll know it.

Meh, maybe I'm just not the target market for this...

Re: Hero – A handy, fast and powerful Go template engine

#14
post #4

I acknowledge the capability of the engine which seems rather impressive. But unfortunately it's basically obsolete. How exactly are designers supposed to easily update? Why reinvent the wheel when far more matured templating engines exist? As the web moves to the front end, this seems like a step backwards

Depends on the point of view, I see as a step backwards to dump a pile of JavaScript on the browser.

Many web sites are perfectly fine with pure HTML/CSS.

Re: Hero – A handy, fast and powerful Go template engine

#15

The benchmarks in the README show a whole lot of templating engines, but weirdly omit the standard library module: https://golang.org/pkg/text/template That's more than enough to raise my eyebrow.

I think "Golang" is the standard library. Or maybe I'm misunderstanding the graph because they don't list import paths on the bottom axis...

Re: Hero – A handy, fast and powerful Go template engine

#16
post #2

Is template parsing a major bottleneck ? What I know, most web apps need template parsing only at the beginning. Once initial startup is done, delivery of content is mostly constant.

It shouldn't be. I prefer template engines that I like the syntax and documentation the most. For low traffic efficacy doesn't matter, for high traffic you should always cache the templates.

Exactly, I used django and jinja templates. Those two are feature rich. Golang template engine is mostly minimal with enough feature to do things.

The problem with Golang, most developers look for performance instead of the features. People who use python or ruby look for better features and ease of development. So, Golang engineers develop applications and libraries which doesn't help anyone.

Re: Hero – A handy, fast and powerful Go template engine

#17

Adding a whole dependency to shave a few milliseconds off serve times (at most) seems like a bad deal to me. All the usual bad stuff that comes with dependencies: will it be maintained? Will it have breaking changes? Will it leftpad? And everyone knows the standard library template format, all the editors support it, if another coder joins the team they'll know it. Meh, maybe I'm just not the target market for this..…

These are not even milliseconds, the charts are in microseconds and a reduction of 40 to I agree it's not worth the focus on fast, they should be focussed on improving the API for the stdlib templates (for example loading templates is not obvious, what I'd like to do is point it at a directory and load all templates under that dir, being able to set layouts and partials would be nice etc). Speed is not a big problem with the existing templating.

Re: Hero – A handy, fast and powerful Go template engine

#18

The benchmarks in the README show a whole lot of templating engines, but weirdly omit the standard library module: https://golang.org/pkg/text/template That's more than enough to raise my eyebrow.

"Golang" is the standard library. And the code is here https://github.com/SlinSo/goTemplateBenchmark/tree/master/go.

Re: Hero – A handy, fast and powerful Go template engine

#19

Earlier quoted context omitted.

It shouldn't be. I prefer template engines that I like the syntax and documentation the most. For low traffic efficacy doesn't matter, for high traffic you should always cache the templates.

Exactly, I used django and jinja templates. Those two are feature rich. Golang template engine is mostly minimal with enough feature to do things. The problem with Golang, most developers look for performance instead of the features. People who use python or ruby look for better features and ease of development. So, Golang engineers develop applications and libraries which doesn't help anyone.

Go template language has a nice context sensitive escape mechanism. But the syntax is kind of garbage and it's very limited when it comes to features ( no template inheritance, curb-some API for plugins ... ). Like everything in Go it gets you 50% there and but it's PITA to do something complex with it. Go is really bait+switch . You can get started fast but then you run into a vast amount of issues when it's time to deliver a professional product with std lib. It's true for testing,logging,writing web-apps, debugging and even concurrency. I hope the more Google rely on it, the more the maintainers will be pressured withing Google to fix its shortcomings.
Post reply on HN