I love Ruby and I love Rails, but I’ve found myself searching for something more. Something fast so I don’t need to add caching. Something type-safe so customers see fewer bugs. Something fun to use so I actually enjoy building applications.

Would Elixir scratch my itch? It was a good start. It made it fun to write beautiful code, but I still encountered bugs in production that could have been caught with a better type system.

There’s Elm. It’s beautiful. Fun. But only available on the front-end.

I played briefly with Go and Rust, but I felt like the type-system and syntax was too unfriendly for me to enjoy using them.

Finally, I tried Crystal

At first, I was pretty put-off by Crystal. It looked almost identical to Ruby, so why would I try it?

Well eventually I did try it, and I fell in love 💙

Though Crystal looks similar to Ruby, Crystal is a different beast. It’s familiar enough to get started quickly, but new enough that it will challenge you in interesting ways. Some things I love about Crystal:

  1. Beautiful syntax — unashamedly Ruby-like. Some people might not like it, but I love it.
  2. Catch bugs at compile time — It gives me anxiety just writing this: Undefined method on Nil . I’ve seen this far too many times. Crystal helps catch these bugs at compile time, so they never see the light of day.
  3. Meta-programming with macros — Crystal uses macros to generate code for you. Bye-bye boilerplate.
  4. Incredibly fast — in many benchmarks Crystal beats Go, Elixir and sometimes raw C code. It’s quick.

Introducing Lucky, the web framework written for Crystal

The goal: prevent bugs, forget about most performance issues, and spend more time on code instead of debugging and writing tests.

In summary, make writing stunning web applications fast, fun, and easy.

Why should you try it?

  1. Easy to pick up — intuitive APIs and helpful compile time errors help make things simpler. Guides and our helpful chat room can help if you get stuck.
  2. Batteries included — no more cobbling together a million libraries. Lucky includes what most apps need. Emails, an ORM for working with the database, templates, webpack setup for you, automated browser testing, authentication, and easy deployment.
  3. Lightning fast — stop worrying about performance and how many servers you need. Most responses with lots of HTML and multiple database requests handle thousands of requests per second on moderately priced servers.
  4. Catches bugs for you — spend less time worrying about test coverage and sneaky type errors. Let the Crystal compiler help you out.
  5. Flexible — Build server rendered HTML, use the built-in webpack config for an SPA, or build a JSON API by initializing your project with --api
  6. No more N+1 issues — Lucky prevents slow N+1 queries by raising during development if you accidentally forget to preload associations.

Bullet points are boring, what’s it look like?

Handling an HTTP request

Setting up a model

Querying the database

Preventing the dreaded N+1 query

Rendering HTML

Get started with Lucky

Here are some ways you can get started

Apprehensions

There’s always a catch, and that’s true with Crystal and Lucky too.

Neither Lucky nor Crystal are at 1.0, which means with some new versions you’ll have to make changes when upgrading. There are also fewer libraries and tutorials than in Ruby and other more mature languages.

For some people, this is a fun opportunity to get in at the ground floor and help shape the community, but it’s not for everyone.

If you’re interested, but not quite ready to make the leap, follow @luckyframework on twitter and throw us a star on GitHub.