The second thing that I miss in Odin is Operator Overloading. And that make me confused. #2731
Replies: 5 comments
-
There is no operator overloading, but there is support for array programming with vector and matrix math operations on the base language itself. Link |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you drmargarido for the fast reply, I have read the array programming section and the Matrix section of seen the matrix and array operation overloading, but the is steel one aspect that is not compatible of using Odin in language operator overloading and that is this citation that I put here from the manual: " There should be support for unlimited size of matrix's of any type of data, ex: f32, f64, f128, complex32 and complex64, complex 128. I'm thinking about scientific data calculations or processing and not only computer graphical matrix transformations. Thank you very much, Best regards, |
Beta Was this translation helpful? Give feedback.
-
From the FAQ: Why does Odin not have operator overloading? # The design goals of Odin were explicitness and simplicity. Operator overloading is very easily abused and can be used to do many magical things. A procedure is clearer and more explicit. Array programming is available in Odin; this removes some of the need for operator overloading when creating mathematical libraries. |
Beta Was this translation helpful? Give feedback.
-
Why? The number one scientific language (Python) doesn't have it without resorting to a third-party package. On what theory then should Odin have it as a base type? |
Beta Was this translation helpful? Give feedback.
-
Hello Kelimion, thank you for the rapid response. Note: Like I said, I like almost all decisions in the design of Odin, they are really nice and simple, especially when compared to C++ or Rust, in my list the one that lacks is Operator Overloading for the implementation of a good mathematical library , but I know that it can be improperly used and that not having it will simplify enormously the source code of the language. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hello,
I really like the design of Odin, and it's design decision, it's simplicity and elegance, but I must not be seeing something in Odin, because in my brain is confused, it's not making sense that Odin is used for high performance computing and that gingerBill is a Physicist and uses it for high performance mathematical computation of real time fire, smoke and water special effect simulations in the CPU and GPU and Odin doesn't have Operator Overloading for any user structure of custom math ?!??!??!!?
I'm I missing something?
This two realities seem worlds apart, so I must be missing or not understanding something?
Can please someone help to clarify my mind?
Thank you very much.
The very best regards,
João Carvalho
Beta Was this translation helpful? Give feedback.
All reactions