realistschuckle / gohaml

An implementation of the popular XHTML Abstraction Markup Language using the Go language.
MIT License
95 stars 13 forks source link

Simple loader #10

Closed a2800276 closed 11 years ago

a2800276 commented 11 years ago

Hi,

I put together some stuff (which I don't think is particularly controversial) and added it as a pull request, mainly to give you a chance to look through it.

It contains:

Again, I don't think there's anything controversial in this pull, so if you just leave it for a couple of days or send me a quick 'ok' I'll integrate it into master myself.

realistschuckle commented 11 years ago

Man. That's nice. Thanks. "OK".

a2800276 commented 11 years ago

Ok, merged it.

I originally had more elaborate plans:

Both more efficient rendering and a more featureful http handler should probably be implemented at some point in time, but I'll wait for now until these features are actually required ...

realistschuckle commented 11 years ago

I think the first point of your more elaborate plans has some merit. I think I will have time later this week to mess around with the source and that seems like a good feature to implement.

a2800276 commented 11 years ago

I've push my branch up if you want to have a look. In all honestly, I'm a little bit confused by the current implementation, not well versed in yacc.

My attempt is here: https://github.com/a2800276/gohaml/tree/writer_io

Rendering into a bytes.Buffer is about 2x slower than the current implementation. What I find even more puzzling is a the BenchmarkRenderWriter results: there I just have a dummy io.Writer that doesn't do anything and that's another 2X slower than writing to a buffer ...

Incidentally: I've also activated Travis Continuous integration in my fork (I can't change the settings in your repo). It's actually quite nice and will run all the go test test for each push. You just need to configure the repo (http://about.travis-ci.org/docs/user/getting-started/) and push a file name .travis.yaml containing the line: "language: go" ...

realistschuckle commented 11 years ago

Thanks for those easy-to-follow instructions on Travis. Service hooks set up and master building and passing.