6 ms·
Sorry for my ignorance, but since you already doing Rust, why not just use Rust? I mean, what's the benefit you could get from FFI Rust code into Ruby that you
by rqs 9y ago
Sorry for my ignorance, but since you already doing Rust, why not just use Rust?
I mean, what's the benefit you could get from FFI Rust code into Ruby that you cannot get by directly writing Rust?
- ajmurmann 9y agoIt's a lot easier to write Ruby. For lots of things Ruby also had much more mature libraries. Of course there are other benefits to writing everything in Rust as well. Everything is a trade off. It's quite disappointing . I would have liked free lunch...
- kenhwang 9y agoBy avoiding rewriting all of an existing ruby project too. This way you can just speed up the slow parts and convert piecemeal when necessary.
- rapsey 9y agoRust is a fantastic C replacement. It is nowhere near being a replacement for higher level languages in terms of productivity and ease of use.
- adamnemecek 9y agoNot quite. Rust embraces "zero cost abstractions" which means you can build up pretty high level abstractions without losing any speed. TBH I would much rather write Rust vs Ruby.
- rapsey 9y agoI'm talking about developer productivity not computing efficiency. Those high level abstractions are nowhere near as easy to use or easy to understand as they are in higher level languages.
- adamnemecek 9y agoThey are related. I can build higher abstractions in rust than in ruby.
- mmun 9y agoDepending on the application, I might agree. However, if there were a Ruby-with-types language (like TypeScript) I would prefer that over the other two options.
- bluejekyll 9y agoWhen you become comfortable with Rust and start relying on type inference heavily, Rust often feels very much like Ruby.
- shakna 9y agoYou mean Crystal? [0] [0] https://crystal-lang.org/ https://crystal-lang.org/
- ShinTakuya 9y agoLike Python using mypy?
- bluejekyll 9y agoI think you might have that slightly incorrect. Rust is a high level language, capable of C and C++ speeds. As you get to know the language, I find it just as productive as Java, Ruby and Python. In some ways more so, because the compiler catches so many bugs before you even run (not to imply you won’t have bugs, just different ones). YMMV.
- rapsey 9y agoMy work has morphed from Erlang/C to Erlang/Rust and it's mostly Rust atm. I have enough experience to see the good and bad parts of Rust. The mental effort of writing Erlang is an order of magnitude lower compared to Rust. While Rust is more fun, it does not and can not come close. I'm not much for Java/Python/Ruby. I don't see those as productive as Erlang so Rust may be closer.
- kenhwang 9y agoI find Rust to be about as productive as Scala (which I find to be generally more productive than Java). Both are generally functional, with a powerful type system, with a lot of flexibility in the level of abstraction, with an expansive preexisting ecosystem you could shim in (C or JVM). However, I don't think Rust is a more productive general programming language than Ruby/Python. I think Rust is more productive when solving systems-level concerns, but most problems aren't systems problems. Crystal is also looking to be a nice compromise for a productive, C/C++ level performance language (if the ecosystem catches up).
- 9y ago
- Twirrim 9y agoDepending on the size of the original project, it could take months to rebuild the entire thing in Rust from Ruby. By leveraging this you could quickly re-write some slow parts in Rust, gaining the benefits with only a few days work. It's certainly worth exploring.