https://kotlinlang.org logo
#python-contributors
Title
# python-contributors
s

SerVB

08/13/2021, 6:26 PM
Today: opened a PR with initial support for integers (probably there are some hidden bugs but many more things work now) – +52 box tests pass. We still don't support Chars and unsigned integers at all, need to support them. Next time: • I see some integer tests like
binaryOp/call
have lambdas that we can't compile for now. I want to switch my context a bit and try to support lambdas.
👏 1
🆒 1
Also, I guess another big topic with numbers will be boxing/unboxing. For now, I've decided to store all integer numbers as Pyhton's
int
with an invariant that every saved value lies in the range of possible values of the corresponding Kotlin type. Compiler should ensure this invariant: add overflow simulation after arithmetic operations, for example. Plain Python type will make code easier to use from Python and also more perfomant. Sounds workable but the problem will arise when we want to save a number as a generic type, or
Number
, or
Any
and then check its type. I guess in such a situation we will have to box the integer into a Kotlin wrapper class like
Int
to understand its type in the future. Boxing/unboxing isn't supported in my PR at all. We should support it at some point
p

Piotr Krzemiński

08/14/2021, 11:32 AM
Great job! The topic of arithmetics seems to be pretty complex 😅
😅 1
4 Views