Deklan Webster
06/20/2019, 6:55 PMDaniel Hines
06/20/2019, 7:05 PMDaniel Hines
06/20/2019, 7:07 PMDeklan Webster
06/20/2019, 7:09 PMDeklan Webster
06/20/2019, 7:10 PMDaniel Hines
06/20/2019, 7:12 PMeval
). I don’t know if its possible to have all my fun Clojure features with a static typed language. I really love the simplicity of Lisp syntax, but types do seem really neat - it would be great if I didn’t have to choose only one.Daniel Hines
06/20/2019, 7:12 PMDeklan Webster
06/20/2019, 7:15 PMDrewverlee
06/20/2019, 7:24 PMDrewverlee
06/20/2019, 7:26 PMDrewverlee
06/20/2019, 7:32 PMeverything is just lists, sets, maps, or vectors, and once you learn the core library, you can do anything on those that you need to do.This is part of the equation, Rich has really put his foot down and said these are the Types you need. He has constrained the language in such a way that its easy to use those and harder to make others. I think this is part of the philosophy behind "simple made easy" It seems static typing proponents are looking for strong guarantees and Clojure offers them by limiting types to those which have proven utility and synergy with the physical world while exposing high level abstractions over them. This allows you to offload the burden of juggling the types and compose with confidence knowing everything can be used as a collection.
fyr
06/20/2019, 8:04 PMclojure.spec
a static type system, vs not a static type system?Daniel Hines
06/20/2019, 8:06 PMfyr
06/20/2019, 8:09 PMDrewverlee
06/20/2019, 8:11 PMpotentially-infinite set is equivalent to a predicate…what do you mean? i think of predicates as defining set membership. So in that regard, i feel like they are the same as a Type.
fyr
06/20/2019, 8:11 PMDrewverlee
06/20/2019, 8:13 PMfyr
06/20/2019, 8:14 PMfyr
06/20/2019, 8:18 PMinstanceof
operator, or structural equivalence insofar as the types are observations about the shapes of maps which are not explicitly reflected in the program text(though they can be for e.g. React.propTypes)
In static languages, this is explicitly enforced by the compiler, as all those relationships are explicitly reflected in the program text; in theory anywayfyr
06/20/2019, 8:23 PM.then
method" or such; even if there are more specific (sub)types that the values individually inhabit(browser.HTTPPromise
and npm.fancyforms.DialogDismissedPromise
respectively for example)Drewverlee
06/20/2019, 8:28 PMfyr
06/20/2019, 8:33 PMdata
keyword" or "anything in Java/Clojure declared by a class
or interface
keyword", but obviously those two are not completely compatible when trying to translate code or conceptsGarth Goldwater
06/21/2019, 12:06 AMGarth Goldwater
06/21/2019, 12:06 AMGarth Goldwater
06/21/2019, 12:06 AMDeklan Webster
06/21/2019, 12:32 AMDaniel Hines
06/21/2019, 1:01 AMGarth Goldwater
06/21/2019, 4:06 AMyairchu
06/21/2019, 9:54 AMhttps://gist.github.com/halgari/f431b2d1094e4ec1e933969969489854Many known static languages like Java, C++, Haskell have nominal type system which require a lot of ceremony to declare types, and functions specify exactly what types they get or you do a lot of work to define interfaces for has-x, has-y. But looks like languages with structural type systems, like PureScript, would fit well the needs he describes.
Doug Moen
06/21/2019, 7:47 PMDoug Moen
06/21/2019, 8:15 PMDrewverlee
06/26/2019, 10:26 PMDoug Moen
06/27/2019, 2:24 PM