6 ms·
Sounds like another win for languages with an LLVM backend. Definitely excited to see this language grow, especially as it has generics already. Does anybody u
by cfors 6y ago
Sounds like another win for languages with an LLVM backend. Definitely excited to see this language grow, especially as it has generics already.
Does anybody use Crystal professionally here? Any thoughts so far if so?
- kyrra 6y agoI'd be interested to see these same benchmarks with the Go LLVM frontend. https://go.googlesource.com/gollvm/ https://go.googlesource.com/gollvm/
- mauricio 6y agoWe run it in production. Our apps are mostly Ruby but we have been rewriting services in Crystal. Originally we were attracted by the speed and type checks, but one surprising benefit has also been the reduced memory consumption. It's difficult to compare directly, but in some cases it cosumes 10x less memory and performs around 20-35x better. Even I/O bound services are sped up since we can take advantage of Crystal's concurrent fibers (rumored to come in Ruby 3.0). The main downside has been the somewhat frequent deprecations of methods and changes to the standard lib. But it's mostly due to the preparation to launch 1.0.
- Exuma 6y agoIs there any web framework for it, like rails? That's really the main reason I use ruby is because as a single developer it's amazingly fast to set up new apps (admin panels, reporting panels, sales funnels, etc). The out-of-the-box functionality of rails makes this super painless. I'd LOVE to use something faster but I don't really want to have to custom write a lot of things (CSRF, sessions, cookies, blah blah). Also, how do you handle jobs with Crystal? Sidekiq being the common one for ruby.
- obahareth 6y agoThere are a couple but I think the most Rails-like are Amber or Lucky: https://amberframework.org/ https://amberframework.org/ https://luckyframework.org/ https://luckyframework.org/ There's also sidekiq.cr from the same person who made Sidekiq for Ruby: https://github.com/mperham/sidekiq.cr https://github.com/mperham/sidekiq.cr
- ksec 6y agoI just dont think Amber or Lucky's ORM are anywhere near as good / clear / concise as ActiveRecord. But both are still very early stage of dev. Is Amber still being developed? Edit: Looks like Amber had a new release a few days ago, and GitHub got a new design?
- paulcsmith 6y agoauthor of Lucky here. Would love to hear what you don't like about Lucky's ORM (Avram). It is not quite as feature complete as ActiveRecord, but in some ways it has more features (like being able to do more advanced queries in Crystal `>`, `ILIKE`, etc.
- iomcr 6y agoclear is also an ORM you could check out. https://clear.gitbook.io/project/ https://clear.gitbook.io/project/
- awb 6y agoKemal is Sinatra-like: https://kemalcr.com/ https://kemalcr.com/
- paulcsmith 6y agoHello! I'm the creator of the Lucky web framework https://luckyframework.org https://luckyframework.org. I've been building it for about 3 years and we've got a number of people using it in production. It still lacks some features found in bigger frameworks, but is nearing 1.0 and gaining many new contributors that are helping us fill in the gaps. Feel free to hop on our chatroom to ask questions about it. We try to be super friendly and love answering questions and getting feedback https://gitter.im/luckyframework/Lobby https://gitter.im/luckyframework/Lobby
- Exuma 6y agoAwesome, thanks!! What would you say the top 2-3 missing things are currently?
- paulcsmith 6y agoRight now I'd say we need to make it easier to work with nested params so you can easily save Parent + (n) children. Easier handling of uploaded files is another big one. It's being actively worked on right now. There are a few more escape hatches that are needed when you need to break out of the framework. But overall it is fairly full featured. You can check out our roadmap to 1.0 here: https://docs.google.com/document/d/1EYzx37Kq5h7iLH9SQTFyXNwby2xVvzuRUlMuxcoktx8/edit https://docs.google.com/document/d/1EYzx37Kq5h7iLH9SQTFyXNwb...
- etherio 6y agoI really liked amber, very similar to rails. Lucky is a bit more different so a bigger learning curve coming from raila
- AlchemistCamp 6y agoAmber: https://amberframework.org/ https://amberframework.org/
- silasb 6y agoAnother downside is the long compile times.
- hootbootscoot 6y agoYes, we run several production services on it. Much like Go, it's built for the web, and it's standard library will handle most things (files, http, memory io, ffi to c, compression and image formats, etc... quite extensive.) There's the likelihood that many future users will encounter it via a "from soup to nuts complete" web application framework like amber or lucky (ROR-like) that include scaffolding for models and migrations and such, or possibly with the sinatra/express'esque kemal framework that mostly concentrates on routing and exposing the request/response cycle, allowing you to inline middleware and pass the request context through your own stuff. .ecr templating (syntactically similar to .erb templates) is built into the standard library and compiles to actual crystal code. macros resolve to actual crystal code at compile time, so some of the ruby meta-programming requires a rethink. While some folks eagerly await true parallelism, which I THINK was here already and then revoked temporarily, but I might be mistaken, I'm quite content to build distributed applications with Crystal communicating over standard protocols or directly via some kind of socket (sockets network and local also being part of standard library) It's executables are fast, small, and don't use much ram (12megs is one anecdotal totally context-less number I'll throw at you, lol...) I use crenv for controlling the version churn, as someone else pointed out, they are ramping up to v1.0, and they now claim to have largely finished breaking changes on 0.35.1 and are prepping for 1.0.0 already on the basis of where we are at now. I also tend to use local shards (specific versions) to ensure build reproducability. Any specific questions?
- Exuma 6y agoI'll repaste my questions from another comment, thanks so much: Is there any web framework for it, like rails? That's really the main reason I use ruby is because as a single developer it's amazingly fast to set up new apps (admin panels, reporting panels, sales funnels, etc). The out-of-the-box functionality of rails makes this super painless. I'd LOVE to use something faster but I don't really want to have to custom write a lot of things (CSRF, sessions, cookies, blah blah). Also, how do you handle jobs with Crystal? Sidekiq being the common one for ruby.
- ckluis 6y agoParent post calls out: amber & lucky.
- deleted 6y ago[deleted]
- rvz 6y agoI came across this article from one of the Crystal project sponsors which is Nikola Motor Company (NKLA) that uses Crystal for their dashboards on their electric trucks this year. https://manas.tech/blog/2020/02/11/nikola-motor-company/ https://manas.tech/blog/2020/02/11/nikola-motor-company/
- devmunchies 6y agoI started my little company on it about 18 months ago. It's a single server running the main app and processing 7 figures of revenue. My biggest gripes would be major API changes (like the JSON mapping), but that's expected with a young language and better in the long run. Another problem is compilation time and compilation memory. waiting a couple of seconds every time i make a change during development sucks, but not a big deal. I've had my deployment server fail deployment a couple times because it ran out of memory when compiling. A solution to compilation times is to split up your app when it gets huge, so that you have smaller apps to compile. I don't use many external dependencies, not even for the http server. The stdlib is very good. I would probably be using OCaml instead if the stdlib were as modern and clean as Crystal.
- jiofih 6y agoCan you share the project?
- devmunchies 6y agohttps://cravecookie.com https://cravecookie.com Most of the code is on the admin side. I've basically been building something akin to shopify but for managing local orders and delivery logistics.
- verisimilidude 6y agoFor what it's worth, I love the visual design of your site. It's stylish, distinct, straight-forward, and communicates purpose/process well.
- superdisk 6y agoThe site looks cool. Pardon me if I sound doubtful, but I just wanted to clarify that you're making 7 figures from this? If so then my hat is off to you.
- devmunchies 6y ago
- throwaway894345 6y agoThese are microbenchmarks; they don't tell you much of anything about real world performance.
- eikenberry 6y agoLLVM is known for trading developer time for run time speed (code runs fast, compiler doesn't). So this is generally the expected results as any decent LLVM based language should beat Go considering Go makes the opposite trade off.
- nimmer 6y agoNim uses GCC and normal, idiomatic Nim competes very well with Crystal in performance and memory usage.
- yahyaheee 6y agoExcept the compilation time of course
- iomcr 6y agoI'm hoping to put a side project into production soon, crystal the language is basically perfect, biggest issue is that I often have to write my own shards, but every shard I write is a shard someone else won't have to write and sometimes npm/gems can easily be converted. The performance and type system working in ecr templates gave me confidence that I could write a higher quality lowjs webapp with a better dev experience than my default stack, which was going to be an uphill battle getting typescript Frankenstein'd into vuejs with a backend in laravel or Frankensteining typescript into a nodejs library (I didnt find any typescript-first nodejs http webservers that I actually liked _and_ also didn't require infinite yakshaving just to get tsconfig, tests, vuejs SSR, etc. working).