top | item 45035053

(no title)

gurgeous | 6 months ago

I am so excited about this!! Ruby tooling is already pretty good, but we can do better. I will try to contribute. Now we just need types

discuss

order

dismalaf|6 months ago

Please no types... They're worse than pointless for a dynamically typed language.

jameslk|6 months ago

Static analysis through type hints brings plenty of benefits to a dynamic language, such as helping to eliminate bugs at runtime (albeit not perfectly) and making it easier to grok a codebase. It’s a trade off and Ruby is as dynamic as it gets. But there is a point to it

GrantMoyer|6 months ago

Pyright catches an awful lot of dumb mistakes I make in Python.

bmacho|6 months ago

All dynamically typed Ruby competitors like

  Python, Javascript (via Typscript), PHP, Elixir 
have embraced Gradual Typing/Type Inference.

You use typed variables/typed function signatures when it's convenient, they give you some compile-time contracts, easy documentation and probably even speed. Otherwise they don't exist. I don't do Ruby, but Gradual Types/Type Inference is a no-brainer for dynamic languages, practically no drawback, only benefits. (And popular statically typed languages such as C/C++, Java, Rust support Type Inference, or are going there too.)

pxc|6 months ago

Sorbet can actually make programs crash at runtime if a variable's type doesn't match its annotation, right? It's not as busted as some other gradual typing implementations.

seabrookmx|6 months ago

Many smart engineers (including Guido) disagree with you, and have added static types to Python, Javascript, Dart, Elixir, Hack and surely some I'm forgetting.