alamb commented on issue #3999:
URL: https://github.com/apache/arrow-rs/issues/3999#issuecomment-1493410568

   Having a kernel like `add(array: &dyn Array, scalar: &Scalar)` is certainly  
compelling
   
   I agree traits would likely be nicer than arcane names.
   
   One thing I think would be a step back was if the traits were complicated 
enough to express things like `can't add PrimitiveType to TimestampType` -- 
because I think that would generate very hard to understand compiler error 
messages. 
   
   
   
   # why use a trait for `Scalar` rather than an `enum`? 
   
   The seems the main usescases for trait are:
   1. Users can supply their own implementations
   2. Can let the compiler generate specialized code. 
   
   
   Maybe it would more naturally extend to nested types 🤔  but I am not sure 
how one would add a `StructArray` ...
   
   ```rust
   enum Scalar {
     Int8(..)
   ...}
   ```
   
   # Do we plan to remove all typed kernels?
    I wonder if you are thinking about deprecating all the strongly typed 
kernels in favor of the dyn kernels?
   
   I seems like the dyn kernels would be easier to use for general purpose 
computing, though would increase binary code size (e.g. anything linking with 
arrow-rs would get all the arithmetic kernels even if it only used UInt64 for 
example)
   
   🤔  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to