Piotr KrzemiĆski
11/21/2020, 8:54 PM> tail -1 python/experiments/python.kt
fun returnString() = "Hello from Kotlin!"
> tail -2 python/experiments/out_ir.py
def returnString():
return 'Hello from Kotlin!'
> cat python/experiments/consumer.py
from out_ir import returnString
print(returnString())
> python3.8 python/experiments/consumer.py
Hello from Kotlin!
but for dead-simple functions - treat is a tracer bullet. I'm still working on getting the standard library to work. For now I just made it interpret without Python returning syntax error đ so that the generated module can be loaded by Python and this little simple function can be invoked.
More importantly, I got in touch with @Roman Artemev [JB] from Kotlin compiler's team who gave me directions where to go next, like creating black-box tests. Roman is super-helpful, a pleasure to learn about Kotlin internals from him. So called 'box tests' are a bunch of high-level tests, some of them platform-specific, and some of them platform-agnostic. Ultimately I'm aiming at making all platform-agnostic box tests pass, and short-term I'll use this test infra to test against some simpler cases. As soon as simple functions using Kotlin's stdlib work properly, it will be another nice milestone.CLOVIS
12/08/2020, 1:51 PMmartmists
07/03/2021, 4:54 PMPiotr KrzemiĆski
07/15/2021, 8:08 PMSerVB
07/15/2021, 8:29 PMPATCH
Python version, so I guess it would be difficult to support all the reasonable versions. On the other hand, when we have a py
file as an output, we can do anything to it: run as is, compile to pyc
, or even use a preprocessor to make it 2.X compatible (lib3to6
).
All these extra steps can be implemented to be performed by the Kotlin plugin, if there is such demand.
@martmists, actually, why do you think it's better to have pyc
?martmists
07/16/2021, 7:30 AMmartmists
07/16/2021, 7:50 AM<version_magic_number:short>\r\n<flags:int><timestamp:int><source_size:int>
(native byte ordering) if I remember correctly. As for differences between bytecode versions along with a list of magic numbers: https://stackoverflow.com/a/7807661/6122145Piotr KrzemiĆski
07/16/2021, 11:55 AMSerVB
07/17/2021, 1:28 PM