170 karma · joined Mar 22, 2021 (5y ago) · 41 submissions
comment 1mo ago · link · parent
In the previous release (1.21) we enabled Execution Contexts as a parallelism engine. https://crystal-lang.org/2026/07/12/releasing-execution-cont...
It's even more flexible than Go because you can tune different contexts for specific workloads. Go still has more advanced optimizations and overall better thread-safety in libraries. But we're working on that...
2.
Tracking Down Progressively-Enhanceable APIs in Crystal's Stdlib(willhbr.net ↗)
7 points · by straight-shoota · 1y ago · discuss
comment 2y ago · link · parent
We've been wondering about why it's worth the money for these sponsors. The links ideally shouldn't have much effect because they're marked as `sponsored`. Anybody got any ideas?
Either way, it's money that helps the project so we're fine with accepting it.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
Simple soldering irons often don't even have temperature selection. And their predetermined temperature drops significantly when heat is transferred into the soldering pieces.
I can dial the Pinecil very accurately to anywhere between 100° C and 400° C, to provide the optimal temperature for the soldering job and it meticulously maintains that temperature (given the power supply is beefy enough).
Another nice feature is automatic stand-by when the tool isn't used. This preserves the tip, saves energy and lowers the risk of accidentally setting anything on fire. It automatically heats up blazingly fast when I pick it up again.
comment 2y ago · link · parent
And this thing generates so much torque, I feel kinda worried about twisting my wrist to select the direction.
comment 2y ago · link · parent
comment 3y ago · link · parent
I think Crystal shines with these focus points, except 3. which needs some love (but it's on our radar).
1. C bindings are nice and easy
2. The integrated spec framework builds on the syntax of rspec and is quite capable. Of course it's opinionated, and there are alternatives in the ecosystem.
3. There are some IDE plugins with basic features. Context awareness in source code is an intricate problem because it requires a lot of semantic analysis. So it needs a bit more effort to iron out.
4. Crystal feels like a dynamic language, yet it's fully statically typed. Features like type inference and union types make this possible.
comment 3y ago · link · parent
comment 3y ago · link · parent
Crystal has static type checking though.
comment 4y ago · link · parent
To celebrate that there is going to be a live event next Monday: https://forum.crystal-lang.org/t/10-years-of-crystal-celebra...
We're exploring the history and future of the language with past and current core contributors as well as industry guests.
comment 4y ago · link · parent
comment 4y ago · link · parent
Crystal's concurrency is based on fibers (green threads) which works very well even on a single thread (it scales to multiple threads, as well)
And for many use cases with high parallelization and little shared state (including web applications such as a search engine), multi-threading isn't necessary. Synchronization overhead is a serious performance killer. You can get much more performance out of running N processes with a single thread instead of a single process running N threads.
comment 4y ago · link · parent
I feel like this is a bit strongly influenced by the macro experience. Macros are an advanced and powerful feature and naturally more complex to debug. In general, Crystal's error messages are often praised for their clarity and helpfulness (especially compared to dynamically typed languages, of course).
> 4. Weak HTTP server implementation -- making things such as a fetching POST params or uploads incredibly frustrating. Once read the request body cannot be read again.
The stdlib implementation of `HTTP::Server` is intentionally very bare-bones (many programming languages don't even have such a practically usable feature in stdlib). Specialized web server implementations are available as shards (https://shardbox.org/categories/Web_Frameworks). They're based on the foundation in stdlib and provide more advanced features.
> 5. Weak/non-existent Windows support
Windows support is pretty stable and almost complete by now.
> 6. No multicore support
Crystal has supported multi-threading as opt-in via the `-Dpreview_mt` flag. It's considered a preview, because it's to be used with care when dealing with data structures that are not thread-safe. But it has proven to work well in production use.
> 8. Nil handling takes a bit getting used to (coming from Ruby)
But once you're used to it, it's sooo much helpful. It just helps to avoid a lot of potential bugs which you would have to take extra care for in Ruby.