28 ms·
It feels like Crystal it took all the best things from the languages I love, and put them together into one, beautiful language: - Elegance of Ruby - Statical
by ibraheemdev 6y ago
It feels like Crystal it took all the best things from the languages I love, and put them together into one, beautiful language:
- Elegance of Ruby
- Statically type checked + global type inference
- No Nulls
- Go-like concurrency
- Easy C ffi
- High performance
I really hope the Crystal succeeds and the language goes mainstream - this release is a huge step forward towards that. Congrats to the Crystal team for reaching the 1.0 milestone!
- amir734jj 6y agoVery well said. Elegance of ruby I think is very important for ruby developers who need a performant typed language.
- vinceguidry 6y agoWhy would rubyists need elegance in a different language for perf? Do what everyone else does, and write a C extension.
- Cort3z 6y agoThe point is that they / we don't want to write c.
- vinceguidry 6y agoSpeaking personally, I don't want to write in anything else but Ruby. If I have to code in something else, well, anything's fine. I don't want "elegance" in that language. I don't need other languages to try to be Ruby. I already have Ruby. I just want to get it done so I can build on that work... in Ruby. I just don't understand why other people seem to think Ruby isn't enough.
- straight-shoota 6y agoI like Ruby, too. But Crystal is like Ruby, and better in many regards. Performance is a huge issue with any computational intensive tasks. Crystal's static typing also avoids many simple errors you would only catch in Ruby with an extensive spec suite for many edge cases.
- vinceguidry 6y agoThis is a Crystal discussion, and I hate it when Crystal people show up in Ruby discussions and talk crap about Ruby so I won't argue against you, other than to say that Crystal is only like Ruby in that it's syntax is superficially similar.
- jiofih 6y ago“Ruby developers” should not exist. You use the right tool for the job. It’s great to have an option that is (partially) familiar, but as a developer you should not be limited by syntax choice.
- benbristow 6y ago> No Nulls Does it not? It has 'nil', just like Ruby. Basically the same thing, the docs literally say it's 'similar to null in other languages'. https://crystal-lang.org/reference/syntax_and_semantics/literals/nil.html https://crystal-lang.org/reference/syntax_and_semantics/lite...
- TylerE 6y agoIt has a Nil type, not a Nil Value. So a function might return an Int or a Nil, but if you then try to, say, invoke a function expecting an Int on a Nil, it predictably blows up. An Int cannot be Nil itself.
- mumblemumble 6y agoTo expand on that, Crystal's Nil goes hand-in-hand with its union types. So, if you want to allow a function's argument to be either an integer or nil, then the parameter type is "Int | Nil". It's not entirely unlike how algebraic data types with a "None" case work in the ML family of languages.
- brundolf 6y agoOr TypeScript, for a more well-known example
- nielsbot 6y agoI think ad-hoc union types is one of TypeScript's best features.
- eyelidlessness 6y agoI think it would be more straightforward to say expressions (/bindings/return types etc) can be null, but not implicitly so, and must be checked for a value before attempting to use the value. Or as a sibling comment said, in TypeScript terms, `strictNullChecks`.
- KMag 6y ago
- pjmlp 6y agoMe too. I don't have any use for it, however as language geek it is quite nice to see ecosystems blossom.
- The_rationalist 6y agoAll of those points are already met and in a better way by mature languages like e.g Kotlin. Really the only argument would be the "Ruby elegance" (or familiarity?) which I don't know. What make ruby/crystal more "elegant" (I would prefer the term readable) than the competition?
- nine_k 6y agoKotlin mostly requires JVM, Crystal does not. Kotlin is heavily oriented towards Java familiarity and interoperability, Crystal is heavily oriented towards Ruby familiarity, and C interoperability. Also, Crystal was first released in 2014, when Kotlin was like 3 years old, and 100% JVM-bound.
- The_rationalist 6y agoKotlin mostly requires JVM, Crystal does not. With Kotlin native, Kotlin js and most importantly Graal native this is plain wrong.
- nine_k 6y agoThis is correct today. This was not the case when Crystal development started.
- The_rationalist 6y agoTranslation: Crystal had a value proposition but now it's gone, before the product launch.
- iomcr 6y agoReality: Kotlin's value proposition is android development.
- The_rationalist 6y ago
- christophilus 6y agoFast compilation times are one of the best things from the languages I love. I’d really love to see OCaml get true parallelism, green threads, and a decent HTTP server story. Then, I don’t think I’d look anywhere else.
- AlchemistCamp 6y agoThen Caramel just might end your search! https://caramel.run/ https://caramel.run/
- eikenberry 6y agoAre you saying Crystal has fast compile times or that it doesn't? You seem to be saying that it does, that that is one of the things you love about it but others below are saying it is slow.
- christophilus 6y agoIt was really slow last time I tried it. I really like Crystal and wish it the best, but it's hard for me to imagine using a sluggish compiler as a daily driver.
- deleted 6y ago[deleted]
- rbjorklin 6y agoIn case you haven’t been following along with the community the last prerequisite for parallelism will land with 4.13 in the next 3-6 months (guesstimate). Once that lands 5.0 is next which will have true parallelism.
- Can_Not 6y agoAlso, it produces binaries (probably similar to golang) which are a reasonable size considering there is a garbage collector. No giant interpretors or VMs required. And macros.
- rjzzleep 6y agoWhat is the compilation speed like? EDIT: also forgot to ask if Crystal has a "killer app" yet? Ruby had Rails, Python had scipy/pandas(several others), Rust had servo etc.
- aidenn0 6y agoYeah, I like everything on your list except the first one. Maybe Crystal will be compelling enough to get me comfortable with ruby-style language syntax & semantics.
- neya 6y agoJust 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
- IfOnlyYouKnew 6y agoIt’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.
- happy-go-lucky 6y ago> 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?
- IfOnlyYouKnew 6y agoThese are the python scripts: https://github.com/jonadsimon/entendrepreneur/tree/master/preprocessing_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.
- antupis 6y agoReallity 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.
- pcl 6y agoAt that point, you're not really "writing Python", though. You're really using Python to orchestrate a bunch of native transformations.
- renox 6y agoD and Nim looks like competition here except for the Ruby look-alike syntax of course.