News for hackers. Stuff that matters.
Re:An Introduction to Crystal by tutfbhuf on Sunday February 21, 2021 @04:20PM (#26217324)
The biggest selling point of Crystal is being a very high level language, but at the same time very performant. Think of a Ruby variant with Go speed.

I would like to have something similar for Python.

Re:An Introduction to Crystal by RaycatRakittra on Sunday February 21, 2021 @04:25PM (#26217371)
Have you taken a look at Nim? https://nim-lang.org
Re:An Introduction to Crystal by tutfbhuf on Monday February 22, 2021 @11:15AM (#26226193)
Not yet, but I have it on my watchlist. I wait for wider (rust-like) adoption of Nim, because most of my programming tasks are heavily dependent on the ecosystem and requires a fair amount of libraries.
Re:An Introduction to Crystal by cb321 on Monday February 22, 2021 @11:47AM (#26226619)
Do you have any specific libraries that you are missing? The packages list [1] has almost 1600 packages.

Also, the FFI in Nim is basically just declaring some C function as a `proc`. So, wrapping existing C libraries is as easy as Cython for Python. You can even jump start things by running `c2nim` on a header file.

[1] https://github.com/nim-lang/packages

Re:An Introduction to Crystal by tutfbhuf on Monday February 22, 2021 @03:48PM (#26230379)
We use the Neo4j graph database quite extensively, so a Neo4j driver / client SDK would be nice. And for intra service messaging we need a google cloud pubsub client library.
Re:An Introduction to Crystal by cb321 on Monday February 22, 2021 @04:07PM (#26230622)
Not sure how well it works (and I have no setup to test), but there is this [1]. It's pretty old and Nim has evolved quite a bit in the last 4 years. It probably doesn't compile, but it might not be hard to spruce it up (not that this would be a great "intro project"). { EDIT: Open source is often pretty thankless. It might be that if you asked nicely of that repo owner that he would do the sprucing! :-) }

I know there are a few different protobuf impls floating around. Not sure how much google pubsub needs beyond that. It's probably not so far away. Maybe you can be the one to do the pubsub wrapper. :-) (I'm only trying to encourage, not enlist/conscript.)

[1] https://github.com/cmacmackin/nim-neo4j

Re:An Introduction to Crystal by tutfbhuf on Monday February 22, 2021 @04:19PM (#26230778)
I appreciate your effort, I also have a hacker spirit / hands on mentality for my own hobby projects. But in this case I simply cannot "sell" it to my team. We really need something already production ready with community support behind it.
Re:An Introduction to Crystal by cb321 on Monday February 22, 2021 @04:32PM (#26230944)
Oh, and, FWIW, most of the time Nim code runs much faster than Go. More like C/C++/Rust speed.
Re:An Introduction to Crystal by cb321 on Monday February 22, 2021 @04:25PM (#26230863)
Ok. Well, then...maybe your next hobby project should be in Nim. :-)
Re:An Introduction to Crystal by tutfbhuf on Monday February 22, 2021 @04:44PM (#26231075)
Yup, I'll consider that.
Re:An Introduction to Crystal by phillipcarter on Sunday February 21, 2021 @09:00PM (#26219843)
> I would like to have something similar for Python.

Depending on the application, F# is a fantastic alternative to Python if you want some succinct code (with advanced types too) and fast runtime performance.

Re:An Introduction to Crystal by dunefox on Sunday February 21, 2021 @07:10PM (#26218757)
> I would like to have something similar for Python.

For anything 'scientific' there is Julia (with PyCall and RCall).

Re:An Introduction to Crystal by eigenspace on Sunday February 21, 2021 @08:12PM (#26219380)
Julia is not just for scientific computing, though a lot of it's ecosystem is built up for that. It's a general purpose language.

That said, it's a completely different language from Python, so the comparison to Ruby/Crystal is not very apt.

Re:An Introduction to Crystal by sidkshatriya on Sunday February 21, 2021 @04:24PM (#26217365)
I’ve heard the compiler is very slow. Is it? Go has a crazy fast compiler.
Re:An Introduction to Crystal by Jenz on Sunday February 21, 2021 @04:56PM (#26217642)
This is true, Crystal does compile pretty slowly, but this is the cost of its great static type system. The balance between Crystals expressiveness and performance is truly wonderful and a joy to program with
Re:An Introduction to Crystal by ranit on Sunday February 21, 2021 @04:44PM (#26217550)
GP meant Go run-time speed, not its compiler’s.
Re:An Introduction to Crystal by forde on Sunday February 21, 2021 @04:29PM (#26217403)
Yeah crystal is an awesome language
Re:An Introduction to Crystal by komuher on Sunday February 21, 2021 @04:24PM (#26217363)
nim-lang