Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> it’s a shame no language is as beautiful as Ruby [...] I really think it's a bad choice of Ruby not to care for types

Do you think Ruby could change something so fundamental as dynamic => static typing and still retain its beauty?

The only static typing solution I've seen for Ruby is Sorbet, and it's... not beautiful.



Crystal [0] is what comes to mind. I've spent very little time with it, but I find the syntax very appealing.

[0] https://crystal-lang.org/


I use RBS/steep with great success to catch plenty of nil issues early, but it's similarly not great from a dev POV to have to maintain a completely separate set of rbs files (or special comments with rbs-inline). Also in my experience, modern editors don't leverage it for typing/intellisense.


Sorbet now supports inline RBS signatures, which I find a lot more readable. If you use VS code with Ruby LSP, the syntax highlighting is pretty great for the signatures too.

https://sorbet.org/docs/rbs-support


One of the main devs on Sorbet would agree: https://blog.jez.io/history-of-sorbet-syntax/


Based on what Ive read [1], Sorbet was born out of very specific circumstances at Stripe, in the same sort of way that go was at google. I think it missed the mark due to it being a specific tool for specific usecases instead of an "open source project for the general public" first.

I love ruby but I do look forward to having a good option for types at some point. The community makes up for lack of types by adding more tests to their test suite, which is nice but I'd love to layer some encoding into the codebase itself and save the CI time.

[1] - https://blog.jez.io/history-of-sorbet-syntax/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: