Earlier quoted context omitted.
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…
Can't help but agree. I write Go professionally now and it's just not a productive language. The concepts are there, but the execution was frankly quite lazy and inconsistent. Never panic in an external API, but closing closed channels and random number functions panic in the same way Java throws checked exceptions. Generics aren't important, except for slices, maps, and channels which are generic. Really minor thing…
Hero – A handy, fast and powerful Go template engine
41–50 of 55 posts
Re: Hero – A handy, fast and powerful Go template engine
#42Re: Hero – A handy, fast and powerful Go template engine
#43Emacs users, I've just added compatibility to web-mode.el (see http://web-mode.org ) Screenshot: http://imgur.com/rlb2VWB
Re: Hero – A handy, fast and powerful Go template engine
#44Is 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.
Re: Hero – A handy, fast and powerful Go template engine
#45http://www.more-magic.net/posts/structurally-fixing-injectio...
Re: Hero – A handy, fast and powerful Go template engine
#46I've seen a few articles from Golang users saying that, after trying to fight the standard library in many ways, they just end up using it since they realise it's the best balance between usable and extensible. Taking how great the Golang templating engine is, I'm not sure this is a step forward.
Disclaimer: I wrote a template engine (https://github.com/eknkc/amber) to make this easier (and I like that Jade syntax)
Re: Hero – A handy, fast and powerful Go template engine
#47Is 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.
If you are using a front end framework, even this is not an issue.
Re: Hero – A handy, fast and powerful Go template engine
#48The 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
#49I've seen a few articles from Golang users saying that, after trying to fight the standard library in many ways, they just end up using it since they realise it's the best balance between usable and extensible. Taking how great the Golang templating engine is, I'm not sure this is a step forward.
I don't like Go Templates. My issue is that you can't have small calculations easily. You'd have to add a lot of helper functions or prepare everything before passing to template engine. Now there is too much coupling. And not that fun. This one allowing inline Go code solves that issue. Disclaimer: I wrote a template engine ( https://github.com/eknkc/amber ) to make this easier (and I like that Jade syntax)
Re: Hero – A handy, fast and powerful Go template engine
#50Adding 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…
Doesn't https://golang.org/pkg/html/template/#ParseGlob do exactly that?