4 ms·
Microsoft, please make one for Ruby! C# vet and lover of VS and VS Code, now working on a legacy Ruby/Rails code base and hating a new life of lifecycle callbac
by StaticRedux 8y ago
Microsoft, please make one for Ruby! C# vet and lover of VS and VS Code, now working on a legacy Ruby/Rails code base and hating a new life of lifecycle callbacks, fat controllers, fat models, magic methods, and un-upgradeable gems. Ugh.
- realusername 8y agoIt's a shame Crystal isn't taking off that much, I use it for some personal projects and it's such a joy to work with thanks to the static typing, unfortunately the community is a bit too small. A static-typed ruby is just the best thing I can wish personally.
- save_ferris 8y agoStripe is working on one called sorbet. The playground[0] is available, but to my knowledge the gem hasn't dropped just yet. [0] https://sorbet.run/ https://sorbet.run/
- hardwaresofton 8y agoStripe has one called Sorbet[0] (StrangeLoop2018 had a good talk[1] on it) that hasn't been released yet but hopefully will be soon. There's also soutaro/steep[2] which looks really promising and is available now. [0]: https://sorbet.run https://sorbet.run [1]: https://www.youtube.com/watch?v=uFFJyp8vXQI https://www.youtube.com/watch?v=uFFJyp8vXQI (slides: https://sorbet.run/talks/StrangeLoop2018 https://sorbet.run/talks/StrangeLoop2018) [2]: https://github.com/soutaro/steep https://github.com/soutaro/steep
- jrs95 8y agoRails has so much metaprogramming that static typing isn't really going to get you very far. Type checkers and linters won't know what the hell is going on.
- wrmsr 8y ago+1. ruby is by a good degree the hardest language to statically analyze that ive ever worked significantly with. type anns fit python relatively well due to it's philosophy being pretty much the direct opposite of ruby's: "explicit > implicit" vs "having a conversation" ed: to the degree that the man himself is adamantly against them in his language (except as perf hints) https://bugs.ruby-lang.org/issues/9999#note-13 https://bugs.ruby-lang.org/issues/9999#note-13
- syastrov 8y agoDjango has quite a lot of "magic" as well. There is work being done on a mypy plugin to support this magic in addition to type stubs. It is already quite usable and supports type-checking many common patterns: https://github.com/mkurnikov/django-stubs https://github.com/mkurnikov/django-stubs See also mypy's recent blog post on plugins (which are also used for supporting Python 3.7's dataclasses, which are quite dynamic as well): http://mypy-lang.blogspot.com/2019/03/extending-mypy-with-plugins.html http://mypy-lang.blogspot.com/2019/03/extending-mypy-with-pl...
- stefano 8y agoDjango and django rest framework make such a heavy use of metaclasses that I gave up on using mypy for a Python project. My code was littered with annotations and stubs and it still wasn't catching obvious type errors, and I had to fall back to use `Any` in way too many places. Couple that with the horrible typing syntax and the fact that mypy was slow, kept crashing with segfaults and often wouldn't even signal type errors on fully typed functions, and the result was a lot of effort for almost no gain. If I compare that experience to when I switched from JS to TypeScript, it's like night and day. TypeScript is designed to work well with development tools and already existing libraries, while Python's static types feels designed by someone who never worked with static types while completely ignoring code patterns used in existing libraries.