Open-Sourcing the Sorbet (Ruby) VS Code Extension

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • sorbet

    A fast, powerful type checker designed for Ruby

  • Our goal with new Sorbet versions is to break things where it makes sense (fix bugs that might introduce new type errors, improve types for the standard library), but wherever possible, build autocorrects for fixing any breakages.

    One little known feature here that works mostly well right now but could definitely be better is the `--suggest-unsafe` [1] flag, which will attempt to insert `T.unsafe(...)` in places in the program where there was a type error.

    Then in places where we improved Sorbet so that it no longer thought something was untyped, and started reporting errors downstream, you could run `bundle exec srb tc --autocorrect --suggest-unsafe` once after upgrading, and commit or delete the autocorrects as desired.

    We don't currently have a plan or a desire to get to a state where upgrading to a new Sorbet version will not introduce new errors on a codebase that previously type checked, which is what I think you might imply you want out of a v1.0 release.

    [1]: https://github.com/sorbet/sorbet/blob/master/main/options/op...

  • rbs_parser

    Discontinued Ruby RBS parsing and translation to Sorbet RBI

  • This article might help clear some things up:

    https://sorbet.org/blog/2020/07/30/ruby-3-rbs-sorbet

    tl;dr:

    - RBS files are what Ruby 3 uses to describe types in separate files

    - RBI files are what Sorbet uses to describe types in separate files

    - Sorbet invented its RBI file syntax before RBS files existed. RBI files use the same syntax for types and signatures as in type annotations that live inside `*.rb` source code with Sorbet.

    - We've been meaning to add support to Sorbet to consume both RBI files and RBS files, but we haven't had a chance to get around to it.

    If someone beat us to it and implemented support for RBS files in Sorbet that would be amazing! Shopify took an early stab at implementing an RBS parser in C++ for performance[1], but I'm not sure what the status of it is today.

    [1] https://github.com/Shopify/rbs_parser

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • sorbet-typed

    A central repository for sharing type definitions for Ruby gems

  • stdlib rbis are shipped with Sorbet. A limited selection of gem RBIs are available at https://github.com/sorbet/sorbet-typed.

  • Packagist

    Package Repository Website - try https://packagist.com if you need your own -

  • > COBOL, PHP, and FORTRAN all lack modern ecosystems (package managers, etc) which hinder them significantly.

    Its unfortunate that PHP has been clubbed with COBOL :-).

    You may not be aware but PHP has a great package manager called composer. It is intensively used in the PHP community for a long time now. The packages are available at https://packagist.org/ .

    Packagist houses 300,000+ packages and has received 50 Billion package downloads since 2012 (See https://packagist.org/statistics ). PHP's Packagist would actually would easily rank amongst the biggest package management ecosystems among programming languages.

    PHP is certainly not disappearing. While it is no longer as dominant as it used to be and there is a slow, long term decline, it continues to be very active. Ruby's decline actually is sharper than PHP. Here is an interesting resource https://redmonk.com/rstephens/2021/08/05/top-20-june-2021/ . All statistics need to be taken into perspective but if you look at other proxy activity like GitHub PRs, projects, jobs etc. for PHP, it continues to be very strong. Using the word "disappearing" feels wrong to me. Trends are not irreversible. Over the years, languages have gone down, only to come back up.

    P.S. Fortran is still going strong also. It is still used extensively in the Scientific Computing community. While, I'm not familiar with the ecosystem there are package managers in Fortran too. I'm now familiar with how good or popular they are though.

  • tapioca

    The swiss army knife of RBI generation

  • Regarding Sorbet and Rails, I recommend Tapioca [1].

    The Rails app that I worked on had a few edge cases Tapioca didn't cover so I wrote a simple script to load the Rails app and generate RBI files (e.g. generate RBI definitions for fixture methods in ApplicationTestCase). The Tapioca codebase helped provide a path for that [2]. Tapioca also continues to add to their DSL compilers. The work to integrate Sorbet paid off very quickly.

    Also, T::Enum and T::Struct are handy in any Ruby codebase.

    [1] https://github.com/Shopify/tapioca

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts