Skip to content

Typed Janet? #1754

Description

@taoeffect

If there were a clean, clear, intuitive way to add types to Janet I think it would help to both increase the appeal of the language to others, catch bugs quicker, potentially improve the speed of the language, and make it easier to also use Janet with LLMs (which would be less likely to write buggy Janet code by being forced to fix type errors).

EDIT: One additional benefit of adding types is that it would greatly improve the documentation and speed with which Janet could be learned and written. It would also make it possible to create neat IDE autocomplete integrations.

Ideally it would be done in a way that didn't clutter Janet files with too much complicated syntax.

There have been various other attempts to add typing to Lisp-like languages as a reference: Typed Clojure, Typed Racket

Personally, I like the minimal approach of adding type annotations above function definitions to label their inputs and outputs as this keeps the rest of the syntax clean and minimal, and it's familiar to users of other languages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions