Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove packed numbers (Num2 / Num4) #201

Closed
irh opened this issue Jan 12, 2023 · 0 comments · Fixed by #204
Closed

Remove packed numbers (Num2 / Num4) #201

irh opened this issue Jan 12, 2023 · 0 comments · Fixed by #204

Comments

@irh
Copy link
Contributor

irh commented Jan 12, 2023

As much as I like the idea of having the Num2 and Num4 types in Koto, there are good reasons for removing them.

  • They're not mutable, so any operations on them have to be assigned, which is fiddly in practice.
  • They add complexity to the language, making Koto harder to learn.
  • Their presence adds complexity for library authors (more than one standard number type to accept as function arguments).
  • Having standard packed number types means their standard library modules need to cover too many use cases.
    • e.g. should num4 be a color type or a 3d or 4d vector? Or a rect?
  • Libraries/apps will generally add wrappers for their own internal geometry or color ops.

In the end, I think their value is limited compared to the cost of including them, so they should be removed as soon as possible to avoid breaking too many existing programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant