ruby / ruby/rbs

A way to distinguish "gradual typing" from "anything possible"

Open
#2,711 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.2k
Forks
256
Avg merge
6d 17h
Merged PRs (30d)
37

Description

Since the renaming any into untyped there is no good way semantically to separate your progress of gradual typing from the uncontrollable type.

In Datadog we build some tools to help us track gradual typing progress and we have to define our way to express situations like "this is user input and literally anything could be given".

For now, we just stick with a simplest solution to alias untyped as any and make an agreement to use any only when we can't narrow down the expected type due to its nature.

module Datadog
  type any = untyped
end

Maybe we also could use some other types for that alias like Object or BasicObject, but this is not the point.

What is your opinion on RBS providing a built-in way to distinguish "I don't have to type it now" from "I don't control the type, it could be anything" or is there a better way of doing that differentiation?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

This issue names no repository files or tests. Start by reading the linked rename pull request and the Datadog example to understand the proposed distinction and existing alias approach. Done would require an agreed RBS design for representing the two meanings and a maintainer decision on whether to provide built-in support.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.