krzema12 / kotlin-python

Python target for the Kotlin Programming Language. See https://github.com/krzema12/kotlin-python/tree/python-backend/python
https://discuss.kotlinlang.org/t/idea-python-backend/19852
47 stars 1 forks source link

Implement DCE #102

Open krzema12 opened 2 years ago

krzema12 commented 2 years ago

Something is already inherited from JS backend, maybe it can be reused easily. I also hope that DCE is a solution to MemoryError in MicroPython.

krzema12 commented 2 years ago

It's not trivial - enabling it with the flag produces an empty file. It needs deeper investigation.

SerVB commented 2 years ago

I remember it worked at some point (when we had out-pir dir generated, at least). Probably a revision can be found.

Also, I remember Kotlin Team suggested that we don't reuse complex and smart KJS DCE that can still contain bugs but implement our own that just removes unused declarations but not code inside bodies.