
Writing a blog platform in Go - stevela
http://www.steve-lacey.com/2011/03/reinventing_the_wheel
======
cschep
Always fun to read about how someone rolled their own, but as nerds we have to
poke right?

Why write a textile parser in Go? Run the JSON through one that's already
written? Store the posts pre-rendered?

~~~
thomas11
Exactly. He uses Disqus for comments, so it could actually be a static site.
No worries about performance, caching, load, security anymore (almost).

~~~
chrisjsmith
Spot on. I think a hybrid approach would be good however as having maintained
a huge static site, it's a pain in the arse getting templates etc right.

I actually have a static site generator that I wrote that uses Go to apply
reusable templates (using the built in template package) and generate
navigation that outputs static HTML only. The idea is that you store your HTML
static documents in Mercurial, run the site through the site generator and
rsync it to your web root. I really need to clean it up and chuck it on
bitbucket.

~~~
thomas11
I'd be interested in that code. There's lots of static site generators out
there already--and like so many procrastinating nerds I wrote my own--but it'd
be a nice real-world example of Go and its Template package.

~~~
chrisjsmith
I'll clean it up and upload it when I get a chance - probably in the next
couple of weeks. I'll post it to Show HN.

------
programminggeek
You know, sometimes the best way to learn a language is to just have a
relatively straightforward problem to solve (like your own blog) that you
actually care about doing well and will continue to use. Otherwise, you are
just doing tutorials for the sake of tutorials and that doesn't always stick.

~~~
mbreese
I always viewed blog platforms as the "Hello World!" of web apps. They are
non-trivial, but everyone has written one, knows what it should do, and how it
should look. So instead of worrying about how to solve the problem, you can
see how the language or framework works.

------
tintin
_"It's way too slow. Page load times are awful."_

His own blog is also very slow. Sometimes you should not reinvent the wheel
but optimize it.

I don't know why he needs all the Javascript but when I open his page the
whole page kind of rebuilds after 2 seconds.

~~~
stevela
The site doesn't use much js itself (other than to wrap the images which
sometimes seems to look like a rebuild). I should probably just modify the
textile formatter to do that...

The bulk of the js is disqus and a code pretty printer.

For actual performance it seems to be doing pretty well for me. See here for a
before/after: <http://steve-lacey.com/2011/04/perf_improvement>

~~~
tintin
You are doing 20 requests to external Javascripts and 8 requests to external
stylesheets according YSlow. "The page has a total of 61 HTTP requests and a
total weight of 637.2K bytes with empty cache".

When I read about performance issues I just wondered why you are including all
this stuff. That's why I prefer optimizations in the first place before
reinventing the wheel ;)

------
nickik
Im going to reinvent a blogplatform in Clojure mainly to learn do something in
a really restful way and learn a little bit of more about the clojure
webstack.

------
nvictor
how can this guy have so many tags in his tag cloud?!

~~~
damncabbage
Because of tags like this: <http://www.steve-lacey.com/tag/still%20alive/>

------
ysangkok
What's with his impatience? Scala isn't that hard.

