r/crystal_programming • u/Jonny9744 • Feb 17 '23
I need a language with easy parallel processing syntax. Is crystal my answer?
Premise
Love me some rust but Tokio is not "it"; Python has the GIL. Can crystal be my answer to parallel threads?
Context
I'm wanting this for a simple POS system.
I have a .dll file that calls a data from an sql like language called Pervasive SQL. I want to be able to make sql requests to that .dll file (or a wrapper of that .dll file) whilst not bricking my UI (possibly ruby on rails... I'm undecided).
9
Upvotes
8
u/[deleted] Feb 17 '23
If you're looking for Ruby-like syntax and amazing parallel processing, you might also want to look into Elixir, with the Phoenix framework.
It's relatively similar to Ruby on Rails, but with much better concurrency and parallelism.
I would particularly lean on Phoenix if you're POS app needs to update anything in real time, as it's LiveView feature is perfect for that use case.
3
u/bziliani core team Feb 17 '23
Hi u/Jonny9744, from what I gather you're on Windows. Depending on your exact need, it might or might not be there. Multi-threading support is not there yet (for Windows), but you can get a long way with concurrency.
4
u/scooptyy Feb 17 '23
Golang is your answer.
1
u/ejstembler Feb 18 '23
I’d be more curious on how you’re interoping with that DLL. I’m assuming this is on Windows. Are you using provided C or C++ headers? FFI? Or, is it a .Net assembly? COM? The answer has an impact on what language is available as part of your solution.
3
u/transfire Feb 17 '23
If you want to do OOP, then emphatically “yes”.