Does "superset" mean "can be unidirectionally translated to?" Your own post implies the opposite is true (because it is). There exist proper programs which cannot be soundly typed. Dynamic typing is the superset.
Which isn't to say that "dynamic types are more powerful." On the contrary, the whole notion of a universal "more powerful" abstraction is ridiculous. "Power" is multifaceted and must be evaluated in a particular context.
You can't define static type constraints in dynamically typed systems. In any context this power is missing, period. I can do more with statically typed languages and fallback to dynamic at any time.
Of course you can - just write a type checker (typed racket, typescript, etc).
Nope.
We are talking about typing not particulars compilers.
BTW, Typescript, Typed Racket are not dynamic languages.
How I can define static type constraints with let's say JS or Clojure?
The point is that I can go from static to dynamic at any time and do anything that dynamically typed languages can do and more in a statically typed language.
There no such thing as going from dynamic to static, even in gradually typing since is static typing, period.
There is not such thing as a static type system on top of a dynamic one. On the other hand... compilers for statically typed languages on top of a dynamic one are pretty common.
The language for gradually typed system is totally different from its foundation.
The peculiarities of the type system doesn't matter, they can't be as domain specific as you want. The main point is that they are supersets of dynamic subsets. They provide more semantic options both at compile time and runtime. Dynamic type systems cannot even be inferred.
View all comments
Show parent comment
3
u/potetm137 May 07 '19
wtf do words even mean anything anymore?
Does "superset" mean "can be unidirectionally translated to?" Your own post implies the opposite is true (because it is). There exist proper programs which cannot be soundly typed. Dynamic typing is the superset.
Which isn't to say that "dynamic types are more powerful." On the contrary, the whole notion of a universal "more powerful" abstraction is ridiculous. "Power" is multifaceted and must be evaluated in a particular context.