3 ms·
> Typed Python, however, scales nicely beyond this size. Could you say more about what tools and practices make this possible, beyond simply adding type annota
by dkarl 4y ago
> Typed Python, however, scales nicely beyond this size.
Could you say more about what tools and practices make this possible, beyond simply adding type annotations in your code? Asking for a friend.
> It's tempting to split a project into a fast "core" language, and high-level "glue" language.
I did this with C++ and Boost Python back in the day and loved the experience. I wonder if Rust will someday get a high-level language for writing applications and scripts on top of a Rust codebase, like Boost Python for C++ or Tcl for C.
- heavyset_go 4y ago> Could you say more about what tools and practices make this possible, beyond simply adding type annotations in your code? Asking for a friend. Python with type annotations works really well with type checkers like Mypy, along with LSP servers, and both of those integrate with most development environments. Using a Python-oriented IDE like Pycharm with type annotated Python also allows for better refactoring options. It reduces the uncertainty and guesswork an IDE's static analyzer must engage in for even basic features you'd take for granted with IDE and statically typed languages. In practice, developers don't have to keep what can be a massively complex application running in their heads to modify code accurately. A nicely typed project makes it easy to see exactly what types of data get passed around and modified. Before gradual typing, you'd have to backtrack to all of a function's call sites to understand exactly what kind of data it takes and returns. With gradual typing, you can just look at types and rely on Mypy to ensure the right data is passed around. > I did this with C++ and Boost Python back in the day and loved the experience. I wonder if Rust will someday get a high-level language for writing applications and scripts on top of a Rust codebase, like Boost Python for C++ or Tcl for C. I haven't used Boost Python, but there are some options for Rust and Python that work well and seem to suit this use case like PyO3.