Live data from Hacker News

Crystal 0.25.1 released

crystal-lang.org

31–40 of 154 posts

Re: Crystal 0.25.1 released

#31

Anyone using Crystal in production? What do you use it for?

At BlockVue we use crystal for v2 of most of our core infrastructure (the old version of our app is Rails-based), and we also use crystal heavily in Google Cloud Functions via our gcf.cr (open source) tool. So mainly we use amber and gcf.cr in conjunction with one another. We host everything on Google App Engine and GCP.

Re: Crystal 0.25.1 released

#32
post #9

Earlier quoted context omitted.

Crystal has had concurrency, almost identical to goroutines, for a long time. It's just as if you're always running with GOMAXPROCS=1. And you can still get some excellent performance on IO bound workloads with a single core. The challenge is expanding what crystal is already good at to CPU bound parallelizable workloads by implementing parallelism. This work should be done before 1.0, we have a lot more resources to…

Thanks for the response. I'm no expert but when you have a server, would each request be handled concurrently by a separate thread (/fibre?)? So in that sense would the server's I/O be non-blocking? (I know each thread would be blocked as it waits for the response). Do you have a rough time frame for parallel concurrency? What's your view on the maturity of the language?

No, each request is handled concurrently in the same thread using evented IO. You spawn fibers, which are the analogue to go's goroutines, and many of those run in one thread. Just like nodejs (without callbacks/promises/async/await) and similar to go with GOMAXPROCS=1.

Unfortunately, I don't have a timeframe for parallelism, it's not my area of crystal and it's a fairly tricky issue.

My (biased, i'm a core developer) view on Crystal's maturity, after using it in a few of my own side-projects, is that once crystal code compiles, it runs pretty much rock solid in production. Compiler bugs are fairly rare too, although the compiler clearly isn't as mature as gcc. The main issue you face is lack of available libraries, and being forced to make a few changes every couple months when a new release comes out with breaking changes. Depending on the size of your codebase, that could be a big issue or it could be a 5 minute easy commit.

Re: Crystal 0.25.1 released

#33
post #10

Crystal looks interesting although I decided to learn Golang instead. It's more mature and the WIP features described below made me cautious (i.e. what other features are immature). Anyone know when Crystal will get concurrency-a-la-golang? i.e. running concurrent processes in parallel? At the moment I think it's still single-threaded. https://crystal-lang.org/docs/guides/concurrency.html Still no windows support: ht…

What do you think of Nim?

No opinion as I didn't look at it. I was more focused on more mature languages and Crystal came up on my radar so I read around it.

Re: Crystal 0.25.1 released

#34

Earlier quoted context omitted.

We use Crystal at RainforestQA to replace our heavy-load / slowish Ruby microservices. It's been great so far and we love it. We're also increasing the adoption to Crystal inside the organization. Also Crystal has a dedicated a wiki page for production users Used in production: https://github.com/crystal-lang/crystal/wiki/Used-in-product...

What drew you to Crystal? If you'll forgive the snark, you've moved from one obscure language, to an even more obscure language that even fewer developers know. What is it about Crystal that outweighs the very boring practical downsides of production use of obscure and immature languages?

In silicon valley and among most of the startup community, Ruby still dominates the landscape, even when compared with Node.js, Python, etc. There's plenty of talk of companies re-writing their infrastructure in node, but why would you do that when you can have Rails and/or Crystal? Furthermore, if you ever need something from NPM, you can just throw it in a Google Cloud Function or in Lambda.

https://medium.com/@yoelblum_45935/demand-for-ruby-on-rails-...

Re: Crystal 0.25.1 released

#35
post #6

Anyone using Crystal in production? What do you use it for?

I'm not sure why anyone would actually use it in the current state, unstable, lack of libraries, lack of community and the biggest problem no multi-threading / windows support

We use it in production. The web framework side of crystal is IMO more mature than what you find in Node.js, Python, etc. About a year ago we tried moving everything to Express because it's super easy to find fledgling js developers, but Express simply lacked most of the features we needed, even when supplemented by npm, whereas Amber did everything we needed literally out of the box.

Edit: Sails is not what it claims to be, and doesn't live up to the dream at all

Re: Crystal 0.25.1 released

#36
post #32

Earlier quoted context omitted.

Thanks for the response. I'm no expert but when you have a server, would each request be handled concurrently by a separate thread (/fibre?)? So in that sense would the server's I/O be non-blocking? (I know each thread would be blocked as it waits for the response). Do you have a rough time frame for parallel concurrency? What's your view on the maturity of the language?

No, each request is handled concurrently in the same thread using evented IO. You spawn fibers, which are the analogue to go's goroutines, and many of those run in one thread. Just like nodejs (without callbacks/promises/async/await) and similar to go with GOMAXPROCS=1. Unfortunately, I don't have a timeframe for parallelism, it's not my area of crystal and it's a fairly tricky issue. My (biased, i'm a core developer…

Thank you for adding more color around Crystal.

I'm somewhat new to this so bear with me. With regards to the I/O, is it like node.js? i.e. all requests are handled inside a single thread (until Crystal gets parallelism) and when the thread waits for an I/O response (i.e. a database call), it will process some of the other requests?

Re: Crystal 0.25.1 released

#37
post #32

Earlier quoted context omitted.

No, each request is handled concurrently in the same thread using evented IO. You spawn fibers, which are the analogue to go's goroutines, and many of those run in one thread. Just like nodejs (without callbacks/promises/async/await) and similar to go with GOMAXPROCS=1. Unfortunately, I don't have a timeframe for parallelism, it's not my area of crystal and it's a fairly tricky issue. My (biased, i'm a core developer…

Thank you for adding more color around Crystal. I'm somewhat new to this so bear with me. With regards to the I/O, is it like node.js? i.e. all requests are handled inside a single thread (until Crystal gets parallelism) and when the thread waits for an I/O response (i.e. a database call), it will process some of the other requests?

Yep, exactly like that.

Re: Crystal 0.25.1 released

#38
post #26

Earlier quoted context omitted.

What drew you to Crystal? If you'll forgive the snark, you've moved from one obscure language, to an even more obscure language that even fewer developers know. What is it about Crystal that outweighs the very boring practical downsides of production use of obscure and immature languages?

Probably because they loved the language. Humans are humans, and not everything is made with a rational financial decision. If you use the language, and like ruby and static typing, you'll find that there's a lot to love.

I see your point, but I sympathise with it less and less as time goes on. Programming languages are just tools. Software development should strive to be a proper, rational, engineering discipline.

Humans aren't robots, but one's choice of development tools is steered by real forces, both technical and business. I don't see that whim, unconstrained by such forces, has any place in the decision. Same goes for curiosity.

If it were my decision to choose a language to use in production, I'd want to go with a safe boring choice like Python/Java. Mature and stable on lots of platforms, easy to hire for, plenty of libraries and tooling.

Taking a risk is sometimes the right thing to do, but I don't see choice of programming language as being one of those times.

It's not that I don't like neat languages like Crystal - I really do - and I'm certainly not trying to put them down. I just wouldn't want to try to argue to management that using it is in the company's best interest.

Re: Crystal 0.25.1 released

#39
post #24

Earlier quoted context omitted.

What drew you to Crystal? If you'll forgive the snark, you've moved from one obscure language, to an even more obscure language that even fewer developers know. What is it about Crystal that outweighs the very boring practical downsides of production use of obscure and immature languages?

How is Ruby an obscure language...? Their developers are already proficient in Ruby. Crystal is a very, very close cousin of Ruby, syntactically and structurally. This isn't like jumping from Java to Haskell.

I didn't know it was that similar. Neat idea for a language.

The 'Boo' language does the same for Python.

Re: Crystal 0.25.1 released

#40
post #10

Earlier quoted context omitted.

What do you think of Nim?

No opinion as I didn't look at it. I was more focused on more mature languages and Crystal came up on my radar so I read around it.

Hrm. Your post implies that Crystal is more mature than Nim, is that intentional? If so, what makes you think that?
Post reply on HN