Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

rbs

< >

rbs is a header lang created in 2020.

#2202on 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 Example Token
Comments # A comment
Line Comments # A comment #
Semantic Indentation X

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements

Built with Scroll v164.7.0