5 ms·
> , but now having Go and Rust If you go for Go or Rust you would never go for something like Crystal regardless, as they have different focuses. Just like Rub
by capableweb 3y ago
> , but now having Go and Rust
If you go for Go or Rust you would never go for something like Crystal regardless, as they have different focuses. Just like Ruby, Crystal optimizes for code legibility and expressiveness, which both Go and Rust never really cared about, as it's about stability + performance (in the case of Golang) or safety + performance (in the case of Rust). Both of Go and Rust have horrible syntax compared to Ruby/Crystal, which is a fine tradeoff to make in cases.
- bcrosby95 3y agoRust is pretty expressive. Horrible syntax... that's just a subjective measure. I wish programmers would get over it, because it's a huge hindrance to trying a large number of languages out there with lots of nice things. But people are gonna be people, so it won't happen.
- capableweb 3y agoYeah, I agree that it's highly subjective. And I don't mean that people shouldn't chose something just based on one variable, it obviously depends. No language is perfect for every use case. Personally I use Rust for a lot of things, even though I'm more productive in other languages, but sometimes it's just a really good fit for the problem. Pseudo-code, but this is how I see the difference in expressiveness and syntax: 3.times { println('Foobar') } for i in 0..3 { println!("Foobar") } Both of them makes sense though, so not a huge difference, but it's the same way in lots of ways in Rust in general. > because it's a huge hindrance to trying a large number of languages out there with lots of nice things I know exactly what you're talking about, as most of the time I work in Clojure, and trying to show Clojure to other programmers who are used to C-like languages and never heard of any lisp-like language is a constant struggle, as their first reaction is always "eww, parenthesizes everywhere!" even though their favorite language usually has the same amount or even more.
- shrimp_emoji 3y agoRust is spiky, like a crab.
- JohnFen 3y agoI've been learning Rust over the last few months, because it seems like a good language to have on my CV. It's certainly a taste thing, but I am not enjoying it at all. I find it unpleasant. I think it's going to join the short list of "languages I can use but would prefer not to". I've never learned Crystal, but if it's like Ruby, then I think I'd enjoy it just fine.
- nicoburns 3y agoIt's funny how taste works. I love writing Rust. To the point that almost all of my personal projects are now in the Rust.
- kmac_ 3y agoRuby is fine until your large application starts to include more and more dependencies. There is no coherent API across, every library has it's own mini DSL and the mess starts to build up. Then it comes method_missing, monkey patching and strings and dictionaries passing in all the places. True horror. All Ruby's readability dissapears. Small apps look beautiful, but large ones quickly become a mess. On top of that resource utilization is atrocious. But there are places where Ruby shines like RSpec, Rails, pry in runtime (I miss that one).
- moe 3y agoThat's one of the aspects in which Crystal shines. It retains most of the flexibility and DSL capabilities, but the type- and nil-safety allow you to leverage them without nasty surprises at runtime. Not having to guess what a method or block returns and instead having the compiler tell you when you get it wrong makes an enormous difference.
- aatd86 3y agoThat must be subjective because Go's syntax is pretty fine to me. To illustrate, when I started learning Go, I implemented Concurrent Hash Array Mapped Tries from some PhD thesis and the pseudo code algorithm actually looked pretty much like the Go code. A testament to how legible it is. Then again, I have never tried ruby so I can't compare.
- caseyohara 3y agoApples and oranges. Ruby is very, very expressive compared to Go. Go's legibility comes from the simplicity of its syntax, Ruby's legibility comes from its expressive syntax.
- galangalalgol 3y agoCan you give either an example or explanation of what you mean by expressive syntax? People talk about it but I don't really know what they mean.
- ghotli 3y agoRuby was one of my first languages and for awhile I described it as 'programming in english' especially Rails with the ActiveSupport gem. I often just fired up IRB (the repl) and guessed what function names I could use on a given object and it worked. I think this is why a lot of DSLs ended up in Ruby (chef, etc) plus the method_missing idiom allowed for a lot of this sort of expressivity at the expense of sometimes being thoroughly confused as to where a method was defined. Overall I ended up writing more performance oriented applications and ruby (at least at the time) wasn't worth the 'it's pleasant to read and write' vs 'this ruby script that used to take a day now takes 15mins written in a language more suited for the task'. The other language I'd consider less expressive just in a less optimized-for-the-human-while-writing kind of way. Crystal seemed nice in the respect that it might be the best of both worlds, but like mentioned elsewhere here it's still fairly niche.
- galangalalgol 3y ago