News for hackers. Stuff that matters.
Re:LPython: Novel, Fast, Retargetable Python Compiler by westurner on Saturday July 29, 2023 @02:12PM (#36922924)
Shedskin is a Python-to-C++ transpiler that does type inference and does not support the full standard library: https://en.wikipedia.org/wiki/Shed_Skin#Type_inference

From "Show HN: Python Tests That Write Themselves" (2019) https://news.ycombinator.com/item?id=21012133:

> pytype (Google) [1], PyAnnotate (Dropbox) [2], and MonkeyType (Instagram) [3] all do dynamic / runtime PEP-484 type annotation type inference [4]

Hypothesis (@given decorator tests) also does type inference IIUC? https://hypothesis.readthedocs.io/en/latest/

icontract and pycontracts do runtime Preconditions and Postconditions with Design-by-Contract patterns similar to Eiffel DbC; they check the types and values of arguments passed while the program in running and not just at coding or compile time.

Re:LPython: Novel, Fast, Retargetable Python Compiler by certik on Saturday July 29, 2023 @02:31PM (#36923095)
Yes, we have Shedskin in the list at the bottom of https://lpython.org/. Note that the Shedskin compiler is written in Python, so the speed of compilation might be lower than other Python compilers written in C++. Unless it compiles itself, that would be interesting. We thought about eventually writing LPython in LPython, but for now we are focusing on delivering, so we are sticking to C++.
Re:LPython: Novel, Fast, Retargetable Python Compiler by westurner on Saturday July 29, 2023 @08:47PM (#36926502)
Can LPython transpile existing Python type inference libraries written in Python to C++?
Re:LPython: Novel, Fast, Retargetable Python Compiler by certik on Saturday July 29, 2023 @09:28PM (#36926777)
Only if the libraries used the subset of Python that LPython can compile. So currently no.