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

Support other element types #4

Open
superbobry opened this issue Sep 13, 2016 · 2 comments
Open

Support other element types #4

superbobry opened this issue Sep 13, 2016 · 2 comments
Assignees

Comments

@superbobry
Copy link
Contributor

superbobry commented Sep 13, 2016

There're quite a few data types we could support:

  • byte
  • short
  • int
  • long
  • float

with int probably being the most useful (and common) one. However, I'm not sure how to go about code generation. The usual stringly-typed approach looks too error-prone.

@dievsky
Copy link
Contributor

dievsky commented Nov 22, 2019

Float also looks important, for those users with stringent memory requirements.

Seeing as Kotlin is a strictly-typed language, we would have to eschew NumPy's approach (store the actual element type as a string property) and instead provide a separate class (hierarchy) for each element type (F32Array for floats, I32Array for ints etc.) We certainly can't use generics, because that would just box everything all the time.

The code generation, however, does present a problem. I'm tempted to invent a C++ template / Kotlin crossover which would automatically generate Kotlin code based on a template. Without this, our code is bound to get really WET or even WETTER (Write Everything Three Times and Enjoy Refactoring).

@dievsky dievsky self-assigned this Nov 22, 2019
@dievsky dievsky changed the title Support other dtypes Support other element types Nov 25, 2019
@dievsky
Copy link
Contributor

dievsky commented Dec 3, 2020

https://github.com/JetBrains-Research/kinference-primitives is a C++ template / Kotlin crossover which automatically generates Kotlin code based on a template.

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

No branches or pull requests

2 participants