4 ms·
Crystal has an excellent concurrency story built into the stdlib which is on by default. All io is evented by default, with events being fed into the fiber sche
by RX14 10y ago
Crystal has an excellent concurrency story built into the stdlib which is on by default. All io is evented by default, with events being fed into the fiber scheduler. The nice thing is that the concurrency and evented io is built just using the stdlib in crystal itself, so it's readable and shows that crystal is quite powerful.
You can read more here: https://crystal-lang.org/docs/guides/concurrency.html https://crystal-lang.org/docs/guides/concurrency.html
- AstralStorm 10y agoLack of parallelism will cause similar problems to what python faces due to global interpreter lock, killing performance. It is 2017 (almost), parallelism should be available in any new programming language.
- asterite 10y agoYes, it will be available before 1.0. It's on the roadmap.
- RX14 10y agoParallelism isn't easy, so the core team is expending time to get it done correctly and released before 1.0. Crystal doesn't have anything like the GIL, and the compiler already enforces some simple rules, like type flow not being available on instance variables because they could be changed on another thread. You can't expect the world from any new project straight away.
- fzzzy 10y agoParallelism is available to any language through fork().
- JohnStrange 10y agoBut its concurrency uses green threads only, no proper multicore support? That's such a pity. Lack of built-in parallel programming facilities is a big problem of many otherwise nice languages, many scheme implementations have this limitation, too. A relatively new programming language should really use all cores, ideally it should distribute the green threads across the available cores with its own scheduler automatically and have synchronization primitives like channel work across them.
- asterite 10y agoYes, this is what Crystal 1.0 will look like. Parallelism is on the roadmap.