Skip to content

Consider supporting Typescript #253

@oveddan

Description

@oveddan

I want to open the discussion here around allowing models to be developed in typescript in ml5. I feel like using Typescript would bring many advantages.

  • We are dealing often with new libraries to import that in general are made in typescript. These libraries have a lot of unknowns; being able to have autosuggest for all of the possible library methods when we don't know the full api would make things much easier.
  • We would know right away when we have typos or use a tensorflow.js or third party method incorrectly, saving a lot of debug time.
  • When new developers come into contributing ml5, they can more quickly get accustomed to what all the methods are by just pressing a dot when typing in the IDE and having all the options appear right away. If we encourage descriptions on the method signatures, these would show up too. They'd also be less scared of mistyping something and breaking things because typescript lets you know right away if there was a mistake.
  • Typescript annotations make reading code a lot easier, especially when there are tons of different internal types going around.

I know there is the argument that we want to make ml5 easy for people new to coding to contribute to, and that by throwing in Typescript they'd have to learn something new on top of javascript and it would potentially hinder them from contributing. I actually would think in the long term it would make it easier for them to contribute and make it faster for them to fix bugs and add features because of the points stated above. They should be able to learn the basics of Typescript by seeing existing code in the repo and reading some intro documentation (it's very well documented) and once they get over that hump with VSCode's awesome typescript integration they'd have a much better experience coding with the repo.

I think a basic start would be to allow (but not require) new models to be made in Typescript. This could be a trial.

What are your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions