6 ms·
I'm looking for something beautiful like Ruby but fast like Go. Do you think Crystal fits this bill? Also, are there packages/libs/gems for Crystal? What are t
by sergiotapia 11y ago
I'm looking for something beautiful like Ruby but fast like Go. Do you think Crystal fits this bill?
Also, are there packages/libs/gems for Crystal? What are they called? What do I google for?
One of the major reasons why I dumped Go is that it's just too verbose and makes me write too much boilerplate code. I want to sort a collection and I have to write the same algorithm every single time for every single type. It's just boring and my time could be better spent elsewhere.
I appreciate the feedback HN!
- seunosewa 11y agoYou're looking for Scala. The "good parts".
- zak_mc_kracken 11y agoStill looking for them ;)
- Dewie3 11y agoYou're sounding like a broken record by now, Cedric.
- robertodelori 11y agoWhat's your desired use case? I have same problem, same concerns and I think that Nim look promising (at least for me). I was giving Go a try, but nah - there just wasn't magic between us ;)
- singularity2001 11y agoCrystalGems would be really a boon!!
- anonyfox 11y agohttp://elixir-lang.org http://elixir-lang.org may be even faster than go. web apps respond in microseconds.
- jacquesm 11y agoElixer and Erlang are not faster than go. The ability to respond in microseconds is a latency issue, not a raw speed issue. Erlang and Elixer can do that because of the way the core systems are architected but the underlying VM and language constructs are quite a bit slower than anything that Go has to offer. For maximum throughput out of a given chunk of hardware you'd want Go. Erlang / Elixer and the associated VM and eco-system have their own strength, reliability for instance, with some C code thrown in for heavy lifting if required.
- bad_user 11y agoIf we are talking about maximum throughput, then you want C++ and in my tests Java has been better than Go, .NET probably is better than Go as well - because when speaking of maximum throughput RAM becomes the biggest bottleneck. And as soon as you're talking about platforms with a non-optional GC, then we start speaking about the performance and predictability of that GC. Go doesn't bring improvements for managing memory access patterns over other GC-enabled platforms, like Java or .NET and compared to those, its garbage collector story has been much, much worse, albeit improving.
- AYBABTME 11y agoThat's not entirely true, not everything is garbage collected. With some care, you can get a whole lots of things allocated on the stack. Tooling can also help you figure if things escape to the heap. You can also control the size and number of objects your program creates, which impacts the performance of GC. Sure you can't pick a GC from a stack of GCs, but you do have many things in your hand to control how memory will behave.
- tptacek 11y agoBut we're not talking about maximum throughput above all else. We're talking about the differing throughputs of high-level languages, which Golang is, but C++ is obviously not.
- infraruby 11y ago> I'm looking for something beautiful like Ruby but fast like Go. Have you tried InfraRuby? InfraRuby is a compiler and runtime for statically typed Ruby: http://infraruby.com/blog/why-infraruby http://infraruby.com/blog/why-infraruby
- wtetzner 11y agoWhat makes InfraRuby better than Crystal (or vis-versa)?
- infraruby 11y agoInfraRuby code runs in Ruby interpreters.
- wtetzner 11y agoCool. I assume that makes interop with Ruby easier?
- infraruby 11y agoYes! Ruby language features supported by InfraRuby have the same behavior as Ruby interpreters. InfraRuby projects are created with rake tasks to run your code with either the InfraRuby runtime or Ruby interpreters. You could implement a file format or protocol in InfraRuby, and use that code in a Ruby project too. You could use Ruby interpreters for development and the InfraRuby runtime for production. And if you decide that InfraRuby is not for you then you can take your code with you!
- jagtesh 11y agoNim perhaps? There's very little boilerplate but it is statically typed. Someone mentioned infra-ruby, which is worth checking out. Lastly, crystal-lang is pretty awesome. You could use this opportunity to create what is missing in the ecosystem and make it open source. This will encourage others to chime in, accelerating development for everyone.
- CyberDildonics 11y agoYou definitely should at least look into Julia. I would say it is more elegant than any other language I've seen while being faster than pretty much anything except for straight C / C++ / D / Rust (native systems languages). It should be easy to beat Go in performance and match or exceed Ruby in elegance and simplicity. It's Achilles heel(s) right now though are multi-threading and JIT compilation times (which should be alleviated once caching is implemented). It sounds really close to what you want. Its package management is even based off of github. Want to get a package to write out image files? Pkg.add("Image"). Update all your libraries? Pkg.update() Over the next 5 years I think it might eat into a lot of the territory of scripting languages. Also the generic programming focus means you should never have to write anything more than a new comparison for your new types.
- zeeone 11y agoJulia's 1-based array indexing is counter-intuitive and a turn off.
- CyberDildonics 11y agoI've seen people say this but really 1 based indexing should be extremely trivial to all the other complexities of writing a worthwhile program for anything more than a one liner.
- aldanor 11y agoBut Matlab users love it! oh wait..
- CyberDildonics 11y agoWow, are people really that offended by someone suggesting Julia? It is a bullseye answer to the question.
- wtetzner 11y agoFrom your description, it sounds like Crystal is exactly what you want. But yeah, I don't know if it has a library ecosystem yet, or anything like that.
- asterite 11y agoI think Crystal could fit this bill, yes: it has Ruby syntax and the concurrency model will be something like Go (spawn and channels, but we are still working on this). And the code ends up without much repetition, as you have generics, macros, very few type annotations, and things like sort, map, select, inject, etc. The community likes to call a library as "shard", so I think we'll eventually end up using that name :-) You can see a list of shards here: http://crystalshards.herokuapp.com/ http://crystalshards.herokuapp.com/ For now that just lists GitHub repositories. Right now there's a very basic package manager that fetches repositories from GitHub, but it's too basic. Someone is working on a much better package manager ( https://github.com/ysbaddaden/shards https://github.com/ysbaddaden/shards ) that we'll probably incorporate in the future.
- FraaJad 11y agowill beautiful like python and faster than Go do? then Nim - http://nim-lang.org http://nim-lang.org will do just fine. Anecdotal benchmarks like this one https://github.com/kostya/benchmarks https://github.com/kostya/benchmarks will show you that Nim comes out at the top (so does Crystal for some, FWIW).
- steveklabnik 11y agoAs always, take benchmarks with a grain of salt: https://github.com/kostya/benchmarks/pull/26 https://github.com/kostya/benchmarks/pull/26 Or this discussion (which is two months old, so unsure what exactly has changed since. Looking at commits, not much?) http://www.reddit.com/r/programming/comments/30y9mk/go_vs_rust_vs_crystal_vs_nim_vs_c_an_other/ http://www.reddit.com/r/programming/comments/30y9mk/go_vs_ru... Or this one, though it goes off track a bit: http://www.reddit.com/r/rust/comments/38s1n3/why_is_rust_much_slower_and_memory_consuming_than/ http://www.reddit.com/r/rust/comments/38s1n3/why_is_rust_muc...