Hacker News new | past | comments | ask | show | jobs | submit login

You don't even need a framework with Crystal. The stdlib gives you all that you need. I personally do not use any frameworks at all.

Coming to your question, Amber is pretty much dead. Lucky or Kemal are the big ones to use. There are also Athena and Azu toolkit.




> The stdlib gives you all that you need

Url with variables routing? Csrf generation? Session loading? Forms processing? Templating? ORM? Assets pipeline integration?

If you're doing a very simple api, maybe stdlib will do. But for actual interactive webapp, it's not even close with what is normally used from web frameworks.


> Url with variables routing?

No. But then I find that trivial to implement. Takes around 10 lines of code.

> Csrf generation?

Yes. You can generate secure tokens and send them in headers.

> Session loading?

No. And this one is a pain point. But then I didn't find any session libs in go or nodejs that fitted my needs, so I have no issues rolling my own.

> Forms processing?

Not sure whats the need here. Do you mean validating the inputs? Again thats just a few lines of code.

> Templating?

ECR Templating in stdlib works well.

> ORM? I do not use ORMs as I prefer to write my sql queries by hand. Crystal provides object mapping with query results by default.

> Assets pipeline integration?

Not very sure what you mean here.

Overall, I personally feel that I can get all that i need for my app in about a couple of dozen lines of code and I don't really need the emntal overhead of learning a new framework. But I suppose others will have a different view point.

Here are some of my repos which can give an idea of how I do things in crystal; https://github.com/rishavs/kaipi https://github.com/rishavs/cove


Writing boilerplate code manually is not something that should be touted as best practice esp if you intend to reinvent the wheel every time you want a use case implemented that was probably covered thoroughly by a framework somewhere else.

With frameworks esp the ones like RoR, the Convention over Configuration (CoC) consideration trumps all the purported benefits that may arise from building your own framework from scratch.

You just learn the fundamentals of one of the most robust and well-established frameworks once, and forget about all the fluff and cruft for good, and just focus on building the business logic and satisfying the user's/customer's needs.

The Not Invented There (NIT) anti-pattern is one hell of a drug!


well one of the weakest point of crystal is it's slow compiling time. A full-featured framework for crystal looks nice on paper, but after your app grow it will become a hinder instead, solely for the additional compiling time overhead of all the nice features the framework provided.

It hurts my productivity so bad I have to split the code base to multi independent services, each one use a simple server to serve some part of the system. After this those frameworks just cease to being helpful.


It's 10 lines here, 10 lines there. But they're not really 10 - in practice that's going to be 100 once you get past the most trivial use case and add good error handling. Then there are tests to make sure it works. Once you write all of those bits you need properly and start sharing it with your next web app and add some generalisation/config... you've created half a custom framework.


gorilla/session is nice


But Amber's Latest release: v1.3.0 - 10/26/2022




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: