Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.64 KB | None | 0 0
  1. * Spec-ulation Keynote
  2. ** 101
  3. - spec is a tool to USE not rules to follow (it's optional to use
  4. features of spec)
  5. - spec is about committing to a specification (not changing
  6. drastically in the future). New modifications should not break
  7. things downstream.
  8.  
  9. ** Deps
  10. Build tools often resolve dependency conflicts by just picking one
  11. version (which can easily break your dependency chain and your
  12. program). The program code doesn't contain the artifacts and
  13. artifacts don't contain each other (both just use dependency lists).
  14.  
  15. Some dependencies are artifact deps that our program code never
  16. actually uses. There are also potentially many namespaces in an
  17. artifact that don't get used. Namespaces also aren't tracked in
  18. the artifact's dependency metadata.
  19.  
  20. Some kind of tree shaking could prune out:
  21. - namespaces from deps that aren't used
  22. - deps of namespaces that aren't used
  23.  
  24. ** SemVer
  25. Meant for a "sane" release and upgrade solution without having to
  26. roll out new versions of dependent packages.
  27.  
  28. Violations to this model can happen when we need to upgrade our
  29. project code to reflect upgraded dependency code. Other problems can
  30. come when we're at the function level calling a :required function of
  31. an artifact. That artifact's functions don't refer to the artifact
  32. (and it's version), only the namespace is referenced!
  33.  
  34. ** Why Use Deps?
  35. - we need 3rd party libs
  36. - maven handles dep conflicts
  37. - packages our program for other downstream consumers
  38.  
  39. it only records the context though... :/
  40.  
  41. ** Changes
  42. required changes:
  43. - fn -> args
  44. - ns -> var names
  45. - artifact -> ns names
  46.  
  47. provided changes:
  48. - fn -> result of the call
  49. - ns -> vars
  50. - artifact -> namespaces
  51.  
  52. good software changes by:
  53. - accretion (providing more features)
  54. - relaxation (need fewer inputs passed)
  55. - fixation (bug fixes)
  56.  
  57. breaking changes happen by:
  58. - require more
  59. - provide less
  60. - unrelated stuff under same name
  61.  
  62. Saying "change" is an inadequate description of the updates to our
  63. program. The update was either: growth or breakage.
  64.  
  65. At the function level, spec can help us determine if our update was
  66. a breakage or normal growth (maybe even programmatically). Don't be
  67. a dummy and version your specs.
  68.  
  69. ** Recognizing Collections
  70. Collections only change by adding or removing items. The adding is
  71. growth and removing is breakage.
  72.  
  73. Our namespaces are collections of vars/fns. Artifacts are collections
  74. of namespaces/packages.
  75.  
  76. Don't confuse the fn, ns, and artifact levels.
  77.  
  78. ** SemVer Revisited
  79. "Sematic Versioning" == who cares (except when your system breaks)
  80.  
  81. Major updates have a higher probability of screwing you because all 3
  82. levels can change and names of things at all 3 levels can randomly
  83. change too (fuck...). Making a major update is for any backwards
  84. incompatible changes but then you're introducing backwards
  85. incompatible change which break downstream consumers, so that's
  86. dumb.
  87.  
  88. DON'T EVER CHANGE THE NAME OF YOUR STUFF!!!
  89.  
  90. levels of badness when updating:
  91. adding < removing < mutating
  92.  
  93. We could detect the changes by using spec to compare the old version
  94. of the library with the new version. Are there incompatibilities? New
  95. fns? New namespaces?
  96.  
  97. ** Fixing Versioning
  98. We could keep function or namespace names versioned for when changes
  99. happen so that new things have versioned names. That's growth and
  100. therefore still compatible.
  101.  
  102. If you want to get rid of a fn, pick a new namespace but keep the old
  103. one.
  104.  
  105. When providing fewer namespaces we should use a new
  106. artifactId. Breakage can happen and since the artifact name has no
  107. relation to namespaces. How do consumers know about a breaking change
  108. if the artifact name is identical?
  109.  
  110. Avoid breakage by turning it into accretion. The old and new can
  111. co-exist (e.g. Nix pkg manager).
  112.  
  113. ** Maven... Broken? Nu-uh
  114. Maven central grows through accretion because people just add
  115. artifacts over time. It doesn't randomly delete or mutate artifacts
  116. (like our programs do).
  117.  
  118. ** SemVer Round 3
  119. Sematic Versioning is broken and promotes software breakage! The
  120. minor versions are also pretty useless.
  121.  
  122. Maybe it'd be better to have a timestamp in the artifactId so we can
  123. tell when something has major changes.
  124.  
  125. ** Git?
  126. Everything is immutable, source code is what matters (not version),
  127. it does content-based addressing (SHA hashing). The SHA hashing makes
  128. it not human readable though :/
  129.  
  130. ** Solutions
  131. This is a social problem. We need to name properly so downstream
  132. projects can use our code freely. If we don't know who will consume
  133. our projects then we don't know who will be broken by our breaking
  134. changes.
  135.  
  136. Open specs are the key to growth. Specs are about what we can do, not
  137. what we can't do. Expect that your functions will get lots of
  138. unnecessary junk, just pull out the keys or whatever that you'll
  139. use.
  140.  
  141. Even alpha versioned software should grow without breakage but it's
  142. less bad since breaking changes are expected.
  143.  
  144. ** Impacts
  145. Breaking changes can cause changes to our runtime execution and
  146. testing can be broken by deps.
  147.  
  148. ** Web Services
  149. We use versioning on our web APIs too (usually major
  150. versioning). Using accretion here too could prevent a ton of issues!
  151.  
  152. ** Why's all this bad?
  153. - our deps have mutability problems because they update in place!
  154. - programs become fragile (a dep could break things at any point)
  155. - we get scared of adding deps (more surface area for breakage)
  156.  
  157. ** What could it be like?
  158. - artifact names are meaningful forever
  159. - orthogonal deps testing by a machine
  160. - we can explore fine-grained deps
  161. - update our deps with impunity
  162. - compose with impunity
  163.  
  164. ** Challenges?
  165. - we can't see some things (like outputs of functions)
  166. - spec compatibility should be aware of the context (e.g. :require vs
  167. :use)
  168. - repo, artifact, namespaces not first class
  169. - tooling is hard to change from status quo
  170.  
  171. ** Opportunities
  172. - spec
  173. - flexible dep awareness (how brittle is the dep)
  174. - Explicit code -> artifact support
  175. - fine-grained deprecation method
  176. - testing based on fine-grained deps, great for generative testing
  177. (so we can test only our latest changes)
  178.  
  179. ** Recap
  180. - grow your software
  181. - give birth to variation (don't break, accrete)
  182. - think of downstream consumers
  183. - move forward without burning bridges (breakage)
  184. - create a lib/service ecosystem of which we can all be proud
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement