News for hackers. Stuff that matters.
Re:Crystal 1.0 – What to expect by neya on Tuesday March 23, 2021 @02:37AM (#26551773)
Just curious, as an avid user of Elixir lang, which has most of these anyway, what should be a compelling reason for someone like me to start using Crystal (more)?

Thank you

Re:Crystal 1.0 – What to expect by IfOnlyYouKnew on Tuesday March 23, 2021 @02:53AM (#26551859)
It’s blazingly fast for pure number / text crunching. As in: I use it to ingest terabytes of data files / JSON / logs at speeds indistinguishable from C but with the convenience of programming in something like ruby.

Once replaced a python script while it was running. Expected time, python: 12 hours. Time to get it running in Crystal: 20 min. Time to finish in Crystal: 12 minutes.

Re:Crystal 1.0 – What to expect by happy-go-lucky on Tuesday March 23, 2021 @03:25AM (#26552058)
> Once replaced a python script while it was running. Expected time, python: 12 hours. Time to get it running in Crystal: 20 min. Time to finish in Crystal: 12 minutes.

Can you please elaborate on this?

Re:Crystal 1.0 – What to expect by antupis on Tuesday March 23, 2021 @03:58AM (#26552265)
Reallity probably is that code was not optimized python which was writen as POC and not touched after initial write. Python is usually fast enough when using numpy,scipy etc.
Re:Crystal 1.0 – What to expect by pcl on Tuesday March 23, 2021 @04:24AM (#26552425)
At that point, you're not really "writing Python", though. You're really using Python to orchestrate a bunch of native transformations.
Re:Crystal 1.0 – What to expect by iomcr on Tuesday March 23, 2021 @09:40AM (#26554820)
> Python is usually fast enough when not using python

Agreed.

Re:Crystal 1.0 – What to expect by IfOnlyYouKnew on Tuesday March 23, 2021 @11:40AM (#26556316)
These are the python scripts: https://github.com/jonadsimon/entendrepreneur/tree/master/pr...

I don’t do enough python to judge them. But, then again, I had even less experience in Crystal back when I worked on this.

Re:Crystal 1.0 – What to expect by iomcr on Tuesday March 23, 2021 @09:38AM (#26554802)
Crystal does a better job with making portable binaries. For example I have written an app that's a 20MB alpine docker container. A comparable app written in Elixir used an 800MB alpine docker container.

I think Elixir is one of crystal's top competitors, but only for servers. Probably you'd never leave Elixir to write a webserver in Crystal. That's just Erlang's specialty. You would leave golang, Ruby, python, PHP, etc. for crystal though, because of the type system, performance, threads, binary, etc..

I've actually started using crystal to write the kinds of scripts people would normally use python for, despite it not being a scripting language.