4 ms·
Ask HN: A statically typed alternative to Python with batteries included
I studied in an university that encouraged C and Java. When I started work, I fell in love with Python's succinctness compared to the the verboseness of Java. It was a joy to code in. Python + vim was a great combination.
Fast forward 10 years and I still do most of my development work in Python. Now I am a single person working on multiple projects. Python has been great as it has well maintained libraries for almost all my needs.
I work a lot in Django for a few web projects. I find the structuring of Django to be very clean and lends itself to writing modular code. But debugging it is sometimes a pain, especially if templates have multiple inheritance.
As context switching is hard for me, I want to write the code as modular as possible, as testable and error-free as possible. I believe a statically typed language is better in this respect. I also feel it will result in better performance.
So I am looking for a statically typed language that has well supported libraries esp for web development, is readable and supports atleast some functional constructs like filter, map, list comprehensions etc, and works on linux.
What would you suggest I try?
- DanielStraight 10y agoSuccinct, statically-typed, functional, web-friendly languages are not especially common. Maybe C#, Scala, or TypeScript. Note as well that Java 8 is a lot better for succinctness and functional programming than previous versions were.
- a3n 10y agoA lot of the batteries in Python, and Python itself, is written in C. Perhaps take that as a model/starting point: write the things that you want to be debuggable/whateverable in C (or C++ or Java or ...), and glue them together with Python. It's good enough for Guido.
- phonon 10y agoWhy not try Python 3.5 and mypy? That way you could still use Django.... See https://github.com/caulagi/django-mypy https://github.com/caulagi/django-mypy for an example. You can also use https://www.quantifiedcode.com/ https://www.quantifiedcode.com/ and https://landscape.io/ https://landscape.io/ as well as what's built into PyCharm. And for js, use TypeScript!