Need help?
<- Back

Comments (71)

  • kace91
    Honest question:I like typescript and I think it makes sense:, the web makes you married to JavaScript, so it’s the reasonable path forward if you want types in that context.But what is the point of the recent wave of types for python, Ruby, and similar languages?If it’s type safety you want there, there’s a bajillion other languages you can use right?
  • t-writescode
    That article was way better prepared than I was prepared for. I like how it translates its code into Ruby's official types-in-headers format. Very nice.I think this is a nice way to include types into a project if you like it. I know when you're working on large Ruby projects - 10s of thousands of lines across hundreds of files - types become really, really helpful to figure out what on earth is happening where. In the past I've used DryRb and was pretty happy with it; but an even deeper connection, like this, looks wonderful.I'd really enjoy it, I think :)
  • gls2ro
    > Requires learning sig block's unique DSL syntax.This is an interesting proposal. But for posterity I am going to critique the critique on the website about Sorbet:Sorbet is Ruby and while it has a DSL that is no different than any other gem providing methods or objects to use. For example you can define a type and assign it to a Ruby constant. Because Sorbet is Ruby.In general I would say any type system has its own syntax when you go deep into it and need more than this param has this simple primitive type and the method returns this simple primitive type. So you have to learn a DSL and the syntax of a type system.
  • omarqureshi
    I don't programme much any more but the whole beauty of Ruby that it pretty much heavily relies on #respond_to? / duck typing and thus you don't rely on types or class checking at all.
  • satyanash
    On Firefox, newlines in code blocks are broken for this website. This causes the page to scroll horizontally to accommodate all the code blocks. The code is all wrapped in a single line.
  • exabrial
    Worth mentioning is Crystal lang: Ruby, with types!
  • zingar
    I don’t like types in separate files but I also don’t want them cluttering my signatures. Types in comments would be my ideal, am I the only one who prefers this?Edit: I see sorbet supports this as an experimental feature https://sorbet.org/docs/rbs-support
  • rajangdavis
    If it is at all possible, it would be nice to have a little bit better support for metaprogramming namely around `define_method` and supplying a typed lambda or block for the dynamic method. I can see why this would be a pain to implement, so I don't expect it :).Otherwise, I think in terms of typed Ruby, this is an incredible undertaking with very well written documentation. Thank you for making this library, I think there's a lot that the Ruby community can benefit from with it. Cheers!
  • jhealy
    interesting idea, good on them for trying something different in the Ruby ecosystem.The website is quite extensive, but the gem only has ~1.5k downloads. It’s presumably very early on the adoption curve
  • omoikane
    > https://type-ruby.github.io/playgroundThe playground seems broken, I can't get it to report any kind of error. It seems to accept even syntactically incorrect files (e.g. just one unmatched closing parenthesis).
  • wsc981
    In the context of Lua, I’ve taken a liking to LuaLS (Lua Language Server). You can just write your Lua scripts with annotations (where needed) and the language server can help auto-complete and verify type usage. No compilation step needed.I never tried “typed Lua” variants (such as MoonScript IIRC), but I believe those do require a compilation step.
  • shevy-java
    def greet(name: String): String "Hello, #{name}!" end Yep - looks like utter s...I understand that many programmers come from languages where their brain has been adjusted to necessitate and depend on types. And they get help from the compiler in capturing some errors. But it is the wrong way to think about programs and logic. I'd wish these guys would stop trying to ruin existing languages. Go add types somewhere else please.Note: I also use java, so I am not against types per se. I am against a want-on need to slap down types onto everything and your Grandma, merely because your brain (of type afficionados) needs them for survival.
  • bataowt
    As someone who has been raising the concern of lack of type hinting in Python and Ruby since the beginning, this is a welcoming change with a “meh” on top. Also the whole shitshow with Go and generics that never made any sense.Oh well.
  • rubyfan
    looks a lot like Crystal
  • jrochkind1
    Wait, what happens if you want keyword arguments?
  • burnt-resistor
    Yes. The proper way of adding gradual typing like Python, Typescript, and other platforms have. steep doesn't work in the rbs camp and sorbet in the rbi camp is more powerful with static and dynamic analysis, but it's also painful. The half-measures hand-wringing of separate type files, type, checking fragmentation that isn't usable, and awkward magic boilerplate comments are signs of leadership failure. Matz ain't software Jesus, sorry.
  • koteelok
    Don't show this to DHH
  • fatih-erikli-cg
    [dead]