Skip to content

Allow $ in identifiers #8094

Closed
Closed

Description

@cknitt

In JS, an identifier may contain the $ sign.

When using signals, there is the convention to use it to distinguish reactive values like in

const count$ = signal(0);

In ReScript,

let count$ = signal(0)

gives the error

Not sure what to do with this character: "$".

Activity

  1. zth commented on Dec 19, 2025

    @zth
    Member

    Yeah this sounds like a reasonable thing to support.

  2. tsnobip commented on Dec 19, 2025

    @tsnobip
    Member

    would we also allow $ at the beginning of the identifier?

  3. cknitt commented on Dec 19, 2025

    @cknitt
    MemberAuthor

    Yes! See the tests in the PR #8095

  4. tsnobip commented on Dec 19, 2025

    @tsnobip
    Member

    awesome! This is also a quite common naming convention in JS!

  5. fhammerschmidt commented on Dec 19, 2025

    @fhammerschmidt
    Member

    jQuery support incoming

  6. added this to the v12.1 milestone on Dec 26, 2025
  7. cometkim commented on Dec 28, 2025

    @cometkim
    Member

    We need to deal with the possible conflict in outputs with the name mangling.
    The compiler implicitly relies on the fact that $ is not used in user code.

  8. cometkim commented on Dec 28, 2025

    @cometkim
    Member

    Special characters in identifiers are a bad part of js IMO. I don't see any rational reason to support them.

  9. modified the milestones: v12.1, v13 on Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions