I am baffled by how much trouble I’m having at writing #rust at a decent clip. #Golang I felt pretty good at after a few months, same with #Python and #PHP. Meanwhile I’ve been trying to write anything useful in Rust for months and it’s so incredibly slow going.

I’m shocked people are enthusiastic about adopting this for their jobs. If I had a specific part of an app that needed more speed, absolutely. But as a general purpose language? I’m not seeing it yet.

I’ll keep ramming my head against it but have not enjoyed myself thus far. If writing a proof of concept in python takes me 4 hours, rewriting that in rust clocks in easily at 12-16 hours.

@matdevdug I'm reasonably good at #rust but I still don't get why people try to push it as a high level language. Rust is infinitely better than C an C++ but I wouldn't put it as an alternative to #golang or #python in places where they are a good fit. Rust has some good static safety features, but so it doesn't have some. For instance, the type system in Python or TypeScript is a lot more powerful.

@orsinium "The type system of Python is much more powerful"

Is this an objective conclusion that you can explain?

Python's "type system" is an optional very late after thought to improve the language on a fragile base.

@mo8it Sure I can. In Python, you have literal types, function overload, protocols for attributes, annotations for descriptors, and lots of other things. And TS can do even more with dependent types, there are even examples of JSON parser and Assembler on type system. But in Rust, for example, you can't say that a function returns or accepts only a specific member of an enum. Having type system independent from the runtime types naturally gives a certain degree of freedom.
@orsinium Usually, you use the type state pattern for that in Rust. But I agree that enum variants as a full type could be a nice improvement.

@orsinium @mo8it i think you're not talking about how strong or not a type system is, but how strict. Rusts type system is very strict, and pythons is the opposite. That means you can do things in python which are a really bad idea but it just lets you do it.

In Rust this is not the case - it restricts you in many ways like not allowing overloads.

by the way, python doesn't have overloading either. a function can accept different types due to the weak type system, but that's not overloading.

@laund @mo8it No, I am talking about the power of the type system. In case of Python and TS, I mean the types that type checkers check, not the runtime.

And by overload I also mean the one you do for static type checking:
https://docs.python.org/3/library/typing.html#typing.overload

On a side note, if you want to try the next level of type safety, take a peak at #Idris. It builds on dependent types, and that's something beyond any of the type checkers I mentioned earlier (TS has basic dependent types, though).

typing — Support for type hints

Source code: Lib/typing.py This module provides runtime support for type hints. Consider the function below: The function surface_area_of_cube takes an argument expected to be an instance of float,...

Python documentation

@orsinium @mo8it a type system is only powerful if it can meaningfully help assure the programmer or compiler about things. Pythons type checkers are better than nothing but far from ideal. They do not inform the language about anything (in most cases, yes i know mypyc exists) and they only slightly assure me as a programmer that I'm not misusing things.

Rust strikes a great balance here, having a strict type system which assures me a lot, while not making types their own programming language.