Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download


< >

rbs is a header lang created in 2020.

#2221on PLDB 4Years Old

We defined a new language called RBS for type signatures for Ruby 3. The signatures are written in .rbs files which is different from Ruby code. You can consider the .rbs files are similar to .d.ts files in TypeScript or .h files in C/C++/ObjC. The benefit of having different files is it doesn't require changing Ruby code to start type checking. You can opt-in type checking safely without changing any part of your workflow.

Example from the web:
# sig/merchant.rbs class Merchant attr_reader token: String attr_reader name: String attr_reader employees: Array[Employee] def initialize(token: String, name: String) -> void def each_employee: () { (Employee) -> void } -> void | () -> Enumerator[Employee, void] end

Language features

Feature Supported Token Example
# A comment
Line Comments #
# A comment
Semantic Indentation X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll