Slim vs. Haml for a New Project

This was a decision that was stumping me for a bit.

Haml: http://haml.info/
Slim: http://slim-lang.com/

I’m not going to go into the details of what each does. If you got to this point, you probably already have an idea and they are very similar.

So here’s the main points:

Haml

  1. More widely used
  2. Better supported by tools such as RubyMine and haml-lint
  3. A bit slower

Slim

  1. More momentum than Haml
  2. RubyMine now has support for Slim, but it’s still a bit buggy when it comes to refactoring
  3. A bit faster
  4. More modern, slightly better syntax

This discussion set me over the edge:

Shane da Silva (sds on github)

Yes, if given the option I would choose Slim for new projects. Its use of the Temple library was a solid design decision (given my experience diving into the HAML project’s code). Granted, HAML works great as well, I just see Slim as more extensible given the framework it was built on top of.

Maybe I’ll find some time to spike on a quick proof of concept to get the ball rolling. Given Temple simply returns Sexps, it should be easy to get started with.

slim is my personal preference too, but in the last project I started I chose haml just because there’s haml-lint.

slim-lint has been on my “personal project candidate list” for a while, so I’ll be willing to help if this is actually started and I get some spare time.

Thus, I’m going with Slim for new projects for server side rendering, unless I’m going to be using ReactJs.

+1 for slim - IMHO the RubyMine support for slim is pretty decent

The linting is no longer an issue for slim:

Justin have a look at this great talk:

and check the FAML repo:

OMG, amazing, @stefansoc! Thanks for the post!

Why does Akira Matsuda think Slim looks weird? It takes a tiny bit of “getting used to”.

I posted the question to Twitter.

@justin glad you enjoyed the talk, Akira gave a few other ones really cool and informative.
Post back here when Akira answers on twitter :smile:

Have a great day :smile:

How do you guys feel about productivity when you have a bigger team like 4-5 people that no necessarily know the syntax and they used to make pure HTML, I still doubt that templates improve productivity, I can get used to the syntax but with the time using reactjs and jsx it’s hard for me to come back to slim or haml.

@joseluistorres I’d say it really depends on the developers. I don’t mind switching amongst HAML/ SLIM and JSX.