3 ms·
>so if it does count as a way of satisfying an interface then Right, but it doesn't. Fullstop, end of discussion. In python, if you don't satisfy an interface
by joshuamorton 8y ago
>so if it does count as a way of satisfying an interface then
Right, but it doesn't. Fullstop, end of discussion.
In python, if you don't satisfy an interface, your program immediately breaks. In javascript, it keeps on chugging, unless you do extra error handling.
Really that's all that needs to be said. You can completely ignore the rest of this post if you wish. Because there is nothing else in it that matters. That fact alone makes js weak and python strong. And note it is a property of the language, and not apis. I can absolutely write interfaces that opt out of the weakness or strongness, but that's also true of strong typing (I can write apis that only accept object, or take in go's interface {}, or whatever).
>You can't put a Python while or for loop inside a Tensorflow program, call a python function, or basically do anything that's not encoded in the AST.
This is incorrect. You can indeed have tf call out to python.
But more importantly, to use your own argument, what's a while loop but some specially favored syntax. While and for are really just operators (consider that for in python is used by fulfilling an interface exactly the same way one opts into * or +).
You seem to be arguing both sides here. That using a different set of operators makes you a different languages if those operators are looping constructs, but doesn't make you a different language if they are binary constructs.
>Re: Tensorflow, the resulting Tensorflow program/AST is statically typed, but it isn't a Python program
This is my point. Neither is your "my-own-object-system-built-ontop-of-js" a js program. Its functionally speaking a different language with different semantics. Yes, you can call out from one to the other, but you can also call out from python to C and C to java. And when you do that you lose some level of introspection because the different languages don't implement fully cross compatible internal APIs.
>it can still be used with other JavaScript code in the full generality of any other functions I write.
Well no it can't. You cannot, for example, write a binary function that is polymorphic over all possible combinations of YOURTYPE and int.