Hacker News new | ask | show | jobs
by phoronixrly 303 days ago
My beautiful experience with sorbet: Yeah, ducktyping? We don't do that here.

Depending on a library that uses ducktyping (like any sane library following the Ruby conventions)? Good luck writing a wrapper for it. Or just disable type checking.

This goes so much against the Ruby vibe that I advise you to just go and use Rust instead if you hate Ruby that much that you want to butcher it with types.

1 comments

Sorbet has its flaws. I didn’t like it either. Having used TypeScript extensively, there is a way to do it right and a way to do it wrong. I’d classify TypeScript as the ideal way to introduce static types into a very dynamic language, given its extensive flexibility to handle dynamic features in a language (e.g. smart type inference, ‘is’ keyword, very flexible generics). Sorbet doesn’t have a lot of those features

Ruby has a strong history and tradition of TDD/unit testing. This is partially a crutch for its lack of static type analysis. Ultimately checking for bugs before running code is very useful