r/javascript • • Mar 30 '18

TensorFlow.js

https://js.tensorflow.org/
471 Upvotes

101 comments sorted by

View all comments

Show parent comments

2

u/raiderrobert Mar 30 '18

Python 3.6 has type annotations: https://docs.python.org/3/library/typing.html

But I admit that project organization has room for improvement.

1

u/nickguletskii200 Mar 30 '18 edited Mar 30 '18

I know about the type annotations. The problem is that pretty much nobody else uses them, and they don't seem to be very expressive.

2

u/raiderrobert Mar 30 '18

Could you elaborate on the expressiveness part. I've used C#, C, and Rust before. If any of those help explain what you mean, that would be great.

1

u/nickguletskii200 Mar 31 '18

I am sorry, I was very tired yesterday and didn't clarify that it's not the typing package's fault.

The problem is that due to the "Pythonic way" most developers don't write code with types in mind, which means that it's impossible to require that something is something (i.e. it implements an interface). For instance, try requiring something to be the equivalent of ICloseable in C# using typing. You'd have to create an ABC (bleh) for that, and good luck forcing every Python user to describe the capabilities this way.

typing itself seems pretty OK.