https://type-ruby.github.io/ Skip to main content T-Ruby LogoT-Ruby Logo T-RubyDocsPlaygroundBlogNews English * English * Ri Ben Yu * hangugeo GitHub ExperimentalGitHub stars T-Ruby is Ruby with syntax for types. Write .trb files with type annotations. Compile to standard .rb and .rbs files. Just like TypeScript. $gem install t-ruby Get StartedPlayground T-Ruby 0.0.39 is now available What is T-Ruby? Ruby and More T-Ruby extends Ruby with additional syntax. This means static types and compile time. A Result You Can Trust T-Ruby code converts to Ruby and RBS, guaranteeing compatibility with the entire Ruby and RBS ecosystem. Safety at Scale Ensure type safety for your Ruby products with T-Ruby. Stay safe even at large scale. Example Write typed Ruby, compile to standard Ruby with generated type signatures. hello.trbInput # hello.trb def greet(name: String): String "Hello, #{name}!" end def add(a: Integer, b: Integer): Integer a + b end - hello.rbGenerated # hello.rb def greet(name) "Hello, #{name}!" end def add(a, b) a + b end + hello.rbsGenerated # hello.rbs def greet: (name: String) -> String def add: (a: Integer, b: Integer) -> Integer Try it in Playground - Existing Methods Compare with existing Ruby typing solutions and see why T-Ruby is different. SorbetRBSTypeProfAnd more... How it works A static type checker for Ruby developed by Stripe. Uses sig blocks to declare types on methods. # typed: strict require 'sorbet-runtime' class Greeter extend T::Sig sig { params(name: String).returns(String) } def greet(name) "Hello, #{name}!" end end Limitations * Requires runtime dependency (sorbet-runtime gem) * Types must be written separately in sig blocks, like comments above function code. * Requires learning sig block's unique DSL syntax. T-Ruby Approach T-Ruby uses inline types like TypeScript without runtime dependencies, and generates standard RBS files. Quick Start 1 Initialize project gem install t-ruby trc --init 2 Start watch mode trc --watch 3 Write typed Ruby src/hello.trb def greet(name: String): String "Hello, #{name}!" end Read the full guide Works with your tools T-Ruby integrates seamlessly with the Ruby ecosystem. Editors * VS Code Extension * JetBrains Plugin * Neovim Plugin * Language Server (LSP) Type Checkers * Steep * Ruby LSP * Sorbet (via RBS) Ruby Ecosystem * RBS Compatible * Any Ruby version * All gems work Join the Journey T-Ruby is an open source project. Your contribution makes a difference. It's still experimental. The core compiler works, but there's much to improve. Feedback and suggestions are always welcome! Star on GitHub Show your support and help others discover T-Ruby Report Issues Found a bug or have a feature request? Let us know Contribute Code Submit a pull request and help build the future of typed Ruby Learn * Introduction * Quick Start * Basic Types Resources * Playground * Blog * News * Type Cheatsheet * CLI Reference Community * GitHub * Contributing * Roadmap Copyright (c) 2025 Fred & T-Ruby. Built with Docusaurus.